-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Issue with attributes while decompiling, seems like its missing many attributes #3432
Comments
This appears to be same issue I disclosed in this comment: #3129 (comment), which in short I believe might be resource shrinking killing an unused resource, but not removing it from all usage. This is ignored on Android (host), but during rebuild since the source attribute is gone - it fails.
|
@iBotPeaches 1 more thing, if i add missing attributes in attr.xml file then it repack apk fine without any issue, with both aapt1 and aapt2, so its only linked to decompile them well with proper values in xml, i saw all those values messed up too in layout xmls which are missing from attrs, |
Problem with Apktool though, it can't know a resource is unused till it's done parsing application. It then further would have to rewrite files. It seems that more invocation with aapt2 to dump resources prior (to detect unused) may be best path forward. |
@iBotPeaches sorry mate, mentioning at wrong place, but 2.9.1 has same issue of that miui related, largeui and godzillaui if i repack with new apktool, when i was compiling 2.9.0 snapshot, it was fine but as i downloaded new 2.9.1. even with --aapt1 usage, those errors are arising, can you confirm if you added that miui patch in 2.9.1? |
@HassanMirza01 - I'm not replicating, I confirm the patch is added - a9eacf6 |
i redownloaded binary and used it again for a fresh unpack/repack, and same result. it was all fine if i compile 2.9.1 from codes. |
Sorry - as you saw above. I cannot replicate. |
Information
apktool -2.9.0-Snapshot
) -17.0.5 LTS
) -Stacktrace/Logcat
same corrected apk recompiled fine with both aapt1 and aapt2
This with AAPT2 option --use-aapt2,
![image](https://private-user-images.githubusercontent.com/26677817/284334634-f6024d7b-a57e-41e2-b9eb-1f1f9f16ac07.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5NTAyNjUsIm5iZiI6MTcyMTk0OTk2NSwicGF0aCI6Ii8yNjY3NzgxNy8yODQzMzQ2MzQtZjYwMjRkN2ItYTU3ZS00MWUyLWI5ZWItMWYxZjlmMTZhYzA3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDIzMjYwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNiNTcyYjIxYjBkNzY5M2UzODdhZmRjMWIwYWM0ZGViMTc1NjdkZTU4MTcxZWIxYTJiNTgwNjFkZjk1ODY5MjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.QLVii20wtVQnVt52iFLfka_z6sWmJn34s_UmZMxB6rI)
this is with AAPT1 option
![image](https://private-user-images.githubusercontent.com/26677817/284334963-0f8b590b-cf62-4f29-bf81-b669cd7acf7f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5NTAyNjUsIm5iZiI6MTcyMTk0OTk2NSwicGF0aCI6Ii8yNjY3NzgxNy8yODQzMzQ5NjMtMGY4YjU5MGItY2Y2Mi00ZjI5LWJmODEtYjY2OWNkN2FjZjdmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDIzMjYwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0NmRmNWY0OWI4YzY0MTM5NjYwMzYyMGM3ZTMwNGEwZTU1NTA3YjM0YTFmZTIyYTUwZjc2OGE4MWI3N2I2N2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VIp4mI5Ai99MJkxiDhKXevV_Kr8R6hQf_DdLhwO8Hjk)
Steps to Reproduce
Frameworks
https://drive.google.com/drive/folders/1btO62pJ95CIBwZbSu_fSX28zCzsC9Pw-?usp=sharing
APK
https://drive.google.com/file/d/14DRWoHieuwLwNSi9DJ04RPG9P7BinxLm/view?usp=sharing
Questions to ask before submission
apktool d
,apktool b
without changing anything? YesThe text was updated successfully, but these errors were encountered: