apk反编译重打包
apktool b -f xxx_dir -o xxx_repack.apk
apksigner sign --ks xxx.keystore --out xxx_repack_signed.apk xxx_repack.apk
異常處理
error: Public symbol drawable declared here is not defined.多數情況下我們修改完后使用“apktool b xxx”命令并不能保證可以順利地回編譯。常見的錯誤是.../res/values/public.xml:數字 error: Public symbol.../xxxx declared here is not defined這跳debug信息告訴我們/res/values/public.xml文件中第“數字”行出錯,里面指定的對象在res目錄下不存在。這是精簡或圖片資源引用錯誤引起的,比如某張圖片在其他dpi里定義了,在當前保留的dpi里卻用不到,當我們把它刪除后,并沒有刪除它在public.xml文件中的定義,程序回編譯的時候按照public.xml去找它卻已經找不到了,于是就報錯了。解決的方法就是打開public.xml文件,刪除相應的行 error: Error retrieving parent for item: No resource found that matches the given name '@android:style/WindowTitle'.error: Error retrieving parent for item: No resource found that matches the given name '@android:style/WindowTitleBackgroun加*號 <style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="@*android:style/WindowTitle" /><style name="Base.Widget.AppCompat.Button.Colored" parent="@*android:style/WindowTitleBackground" />總結
- 上一篇: 默认(1sp = 1dp) , sp:带
- 下一篇: so使用原则(要么不支持,要么全部支持)