error: Error: Resource is not public
场景
APKTOOL version 2.7.0
APP targetVersion 32
PS C:\Users\liyd\Desktop\1> apktool b C:\Users\liyd\Desktop\1\appoppo-release
I: Using Apktool 2.7.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: Failed to generate resource table for split ''
W: C:\Users\liyd\Desktop\1\appoppo-release\res\values-v31\colors.xml:3: error: Error: Resource is not public. (at 'm3_ref_palette_dynamic_neutral0' with value '@android:color/Teal_800').
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\liyd\AppData\Local\Temp\brut_util_Jar_91013826925412902538510430581108450727.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 32, --version-code, 99999999, --version-name, 9.9.9, --no-version-vectors, -F, C:\Users\liyd\AppData\Local\Temp\APKTOOL7906512351040721351.tmp, -e, C:\Users\liyd\AppData\Local\Temp\APKTOOL3874216853597748733.tmp, -0, arsc, -I, C:\Users\liyd\AppData\Local\apktool\framework\1.apk, -S, C:\Users\liyd\Desktop\1\appoppo-release\res, -M, C:\Users\liyd\Desktop\1\appoppo-release\AndroidManifest.xml]
解决
找到res\values-v31\colors.xml文件,替换其中的@android 为 @*android
。再次打包,成功回编译。
Not a valid dex magic value:
I: Baksmaling assets/39285EFA.dex...
Exception in thread "main" org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: cf 77 4c c7 9b 21 01 cd
at org.jf.dexlib2.util.DexUtil.verifyDexHeader(DexUtil.java:93)
at org.jf.dexlib2.dexbacked.DexBackedDexFile.getVersion(DexBackedDexFile.java:157)
at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:81)
at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:184)
at org.jf.dexlib2.dexbacked.ZipDexContainer$1.getDexFile(ZipDexContainer.java:181)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:89)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:37)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:103)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:151)
at brut.apktool.Main.cmdDecode(Main.java:175)
at brut.apktool.Main.main(Main.java:79)
加上 --only-main-classes
apktool d C:\Users\liyd\Desktop\1\100055-yyb-202012161746.apk --only-main-classes
apktool 回编译报错 Resource is not public
PS C:\Users\liyd\Desktop\1> apktool b C:\Users\liyd\Desktop\1\app-release
I: Using Apktool 2.7.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral12.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral12.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral17.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral17.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral22.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral22.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral24.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral24.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral4.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral4.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral6.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral6.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral87.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral87.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral92.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral92.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral94.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral94.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral96.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral96.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral98.xml:4: error: No resource identifier found for attribute 'lStar' in package 'android'
W:
W: C:\Users\liyd\Desktop\1\app-release\res\color-v31\m3_ref_palette_dynamic_neutral98.xml:4: error: Error: Resource is not public. (at 'color' with value '@android:color/Purple_800').
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\liyd\AppData\Local\Temp\brut_util_Jar_38511936636253097763340320537866973820.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 33, --version-code, 1, --version-name, 1.0, --no-version-vectors, -F, C:\Users\liyd\AppData\Local\Temp\APKTOOL2062842539787796223.tmp, -e, C:\Users\liyd\AppData\Local\Temp\APKTOOL7327551238451499604.tmp, -0, arsc, -I, C:\Users\liyd\AppData\Local\apktool\framework\1.apk, -S, C:\Users\liyd\Desktop\1\app-release\res, -M, C:\Users\liyd\Desktop\1\app-release\AndroidManifest.xml]
Press any key to continue . . .