Can‘t find framework resources for package of id: 18. You must install proper framework files

小米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了! 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值