小米13.0.5的系统应用:相册。
报错id18。
下面这个log是id=16的一个样例,实际报错情况类似,但是不完全一样
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x100d0051
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x100d0051
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x100d0051
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x100d0051
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x100d0074
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0x10070001
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0058
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0058
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0058
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0058
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0058
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0057
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x100d0072
I: Decoding values */* XMLs...
Can't find framework resources for package of id: 16. You must install proper framework files, see project website for more info.
首先需要明确一点的是,我们需要三个小米的框架文件,名字分别是:framework-res.apk,framework-ext-res.apk,miui.apk。其中,framework-res.apk框架文件位于系统目录:/system/framework/,framework-ext-res.apk框架文件位于系统目录:/system/framework/framework-ext-res/,miui.apk框架文件位于系统目录:/system/app/miui/。
但是以上的方案我实测之后,并不能解决id18的问题。
所以我用个了笨方法,直接写代码adb把所有包含miui,xiaomi的apk给拉出来,挨个试!
import os
p = os.popen('adb shell pm list package|findstr miui')
l = p.read().strip().replace('package:','').split('\n')
print(l)
for app in l:
p = os.popen('adb shell pm path '+app)
path = p.read().strip().replace('package:','')
print(path)
p = os.popen('adb pull '+path+' C:\\Users\\0x16FAAB6C\\Desktop\\Android\\xiaomi\\xiaomi_sys_apk\\'+app+'.apk')
print(p.read().strip().split('\n')[-1])
print("===done===")
然后直接批量安装到apktool的framework里面,我看他的id号
import os
import glob
files = glob.glob("C:\\Users\\administrator\\Desktop\\Android\\xiaomi\\xiaomi_sys_apk\\*")
for file in files:
p = os.popen('java -jar "D:\\APKDB\\apktool\\apktool250.jar" if '+file)
print(p.read().strip())
print("===done===")
终于,看到了这个:
这样就知道,还需要第四个文件. com.miui.system
这样就可以正常反编译无报错和warning了!