[Android逆向] 重打包时报BrutException
执行apktool b --use-aapt2 进行重打包时,重打包失败,抛出异常
apktool b /Users/***/work/appsApk/testApp --use-aapt2
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:74: error: resource android:color/Teal_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:75: error: resource android:color/Teal_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:76: error: resource android:color/Blue_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:77: error: resource android:color/Red_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:78: error: resource android:color/Red_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:79: error: resource android:color/Purple_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:80: error: resource android:color/Purple_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:81: error: resource android:color/Pink_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:82: error: resource android:color/Pink_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:83: error: resource android:color/Indigo_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:84: error: resource android:color/Indigo_700 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:85: error: resource android:color/GM2_grey_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:86: error: resource android:color/Blue_800 is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:87: error: resource android:color/background_cache_hint_selector_device_default is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:88: error: resource android:color/autofilled_highlight is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:89: error: resource android:color/accent_device_default is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:90: error: resource android:color/autofill_background_material_light is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:91: error: resource android:color/autofill_background_material_dark is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:92: error: resource android:color/accessibility_focus_highlight is private.
W: /Users/stlior/work/appsApk/testApp/res/values/colors.xml:93: error: resource android:color/accent_material_light is private.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec
出错的XML
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="m3_ref_palette_dynamic_neutral0">@android:color/Teal_800</color>
<color name="m3_ref_palette_dynamic_neutral10">@android:color/Teal_700</color>
<color name="m3_ref_palette_dynamic_neutral100">@android:color/Blue_700</color>
<color name="m3_ref_palette_dynamic_neutral20">@android:color/Red_800</color>
<color name="m3_ref_palette_dynamic_neutral30">@android:color/Red_700</color>
....
....
解决办法
将color.xml 中的 @android 换成 @*android
再次重打包,成功打出apk