After decompiling and recompiling with apktool, the contents of the AndroidManifest.xml file are changed as follows.
apktool -version) - 2.3.4 & 2.4.0If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)
If this APK can be freely shared, please upload/attach a link to it.
sample_compilesdkversion.zip
apktool d, apktool b without changing anything? Yes.I have same issue. Also after compile the app and open it is crashing.
Not sure how we regressed here. I have a test that ensures compileSdkVersion does not change. This must be aapt1 related
I'm using the latest aapt.exe from build-tools v28.0.3. I can confirm that the compileSDK is changed to 23. Is there any tag to force the version?
Same problem here, compileSdk changed from "9" to "6.0-2438415" with apkTool 2.3.4 or 2.4.0.
But no problem with apkTool 2.3.3 (compileSdk not modified) so regression seems be in 2.3.4 version.
Facing same issue.
Same exact issue, android:compileSdkVersion got changed from 28 to 23 and android:compileSdkVersionCodename from 9 to 6.0-2438415.
Using 2.4 on Windows and Java 64 bits. Commands were simply _apktool d_ and _apktool b_.
I have the same problem and it doesn't work properly after compiling the app
Reasons and solutions ๏ผ
I have found that the version used ("6.0-2438415") is taken from the version of the framwork apk (1.apk).
โ /tmp unzip /opt/apktool_2.4.1.jar brut/androlib/android-framework.jar
Archive: /opt/apktool_2.4.1.jar
inflating: brut/androlib/android-framework.jar
โ /tmp ~/Android/Sdk/tools/bin/apkanalyzer manifest print brut/androlib/android-framework.jar | grep -i version
<?xml version="1.0" encoding="utf-8"?>
android:versionCode="23"
android:versionName="6.0-2438415"
android:minSdkVersion="23"
android:targetSdkVersion="23" />
I don't know why all last version of apkTool have a framework with this version but if I use another framwork (take from an emulator device). It will use the version of this framework.
And I don't know if it is better to take the version of the framwork or keep the version of original apk.
I just want to raise awareness of this issue because i am facing the same and it causes my App to immediately crash after rebuilding it. Is there any proposal on how it could be fixed?
Old
โ debug git:(master) โ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1d
A: android:compileSdkVersionCodename(0x01010573)="10" (Raw: "10")
โ debug git:(master) โ
Rebuilt
โ dist git:(master) โ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x17
A: android:compileSdkVersionCodename(0x01010573)="6.0-2438415" (Raw: "6.0-2438415")
โ dist git:(master) โ
Indeed changed (aapt1).
Let me try aapt2.
โ app-debug git:(master) โ apktool b . --use-aapt2
I: Using Apktool 2.4.2-f545c2-SNAPSHOT
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...
โ app-debug git:(master) โ cd dist
โ dist git:(master) โ aapt d xmltree app-debug.apk AndroidManifest.xml | grep 'compileSdkVersion'
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x17
A: android:compileSdkVersionCodename(0x01010573)="6.0-2438415" (Raw: "6.0-2438415")
โ dist git:(master) โ
Nope, still busted. Marking as bug.
Most helpful comment
Same problem here, compileSdk changed from "9" to "6.0-2438415" with apkTool 2.3.4 or 2.4.0.
But no problem with apkTool 2.3.3 (compileSdk not modified) so regression seems be in 2.3.4 version.