Comments (7)
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.
from apktool.
Sorry - as you saw above. I cannot replicate.
from apktool.
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.
➜ 3432 aapt2 d xmltree MiuiSystemUI.apk --file res/drawable/miuix_action_icon_cancel_dark.xml
N: android=http://schemas.android.com/apk/res/android (line=1)
N: app=http://schemas.android.com/apk/res-auto (line=1)
E: drawable (line=1)
A: http://schemas.android.com/apk/res/android:height(0x01010155)=26.000000dp
A: http://schemas.android.com/apk/res/android:width(0x01010159)=26.000000dp
A: http://schemas.android.com/apk/res/android:viewportWidth(0x01010402)=26
A: http://schemas.android.com/apk/res/android:viewportHeight(0x01010403)=26
A: http://schemas.android.com/apk/res-auto:actionIconDisabledAlpha(0x7f04004f)=0.5
A: http://schemas.android.com/apk/res-auto:actionIconNormalAlpha(0x7f040050)=0.8
A: http://schemas.android.com/apk/res-auto:actionIconPressedAlpha(0x7f040051)=0.9
➜ 3432 aapt2 d resources MiuiSystemUI.apk| grep 'actionIconDisabledAlpha'
➜ 3432 aapt2 d resources MiuiSystemUI.apk| grep 'actionIcon'
resource 0x7f0a0052 id/actionIcon
from apktool.
@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,
from apktool.
@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?
from apktool.
@HassanMirza01 - I'm not replicating, I confirm the patch is added - a9eacf6
from apktool.
@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.
from apktool.
Related Issues (20)
- [BUG] HOT 1
- [BUG] Recompiling system jars produces strange jars HOT 3
- Bug: Apktool Unable to Resolve Resource Reference in activity_simulation_freefire.xml (Line 23) HOT 2
- [BUG] Facebook: expected element name 'view' and not 'View' HOT 6
- Can't update apktool in kali... Help needed!!
- [BUG] App crashes due to android.content.res.Resources$NotFoundException HOT 3
- [BUG] App breaks after recompiling apk HOT 4
- 应用程序崩溃 UnsatisfiedLinkError: No implementation found for HOT 3
- [BUG] ClassNotFoundException in recompiled app HOT 5
- [BUG] Missing res-xml file after building HOT 5
- [BUG] Attribute android:graph not found HOT 13
- [BUG] apktool cannot recompile obfuscated apks with shrinkResources = true after updating Gradle HOT 4
- [BUG] Duplicate entry stamp-cert-sha256 when rebuilding HOT 2
- [BUG] dexlib2 out of range HOT 1
- Failed with a malform AndroidManifest file HOT 4
- [BUG] Can't rebuild an apk which misses references HOT 2
- decompiling APK that compiled using NP Manager APK , with error Found: NP_MANAGER3 HOT 1
- [BUG] brut.androlib.exceptions.AndrolibException HOT 10
- [BUG] Rebuild of Citra MMJ with altered assets does not put altered assets into data folder HOT 1
- Unable to rebuild apk with apktool HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apktool.