反编译 回编译 Apktool回编译时出现的问题 error: Error: Resource is not public.target API版本为31以上,回编译时好像都有此问题

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 . . .
  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学知识拯救世界

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值