Apktool
Apktool copied to clipboard
compileSdkVersion value changed in AndroidManifest.xml file
Information issue #1852 #1909
After decompiling and recompiling with apktool, the contents of the AndroidManifest.xml file are changed as follows. 0. 2.3.3 version works as normal.
-
Apktool Version (
apktool -version
) - 2.3.4 & 2.4.0 - Operating System (Mac, Linux, Windows) -Windows10
- APK From? (Playstore, ROM, Other) - Other
Steps to Reproduce
- original : AndroidManifest.xml -> android:compileSdkVersion="28"
- delete framework(1.apk)
- 'd' option ->
- 'b' option ->
- Check the AndroidManifest.xml file. AndroidManifest.xml -> android:compileSdkVersion="23" compileSdkVersion changed
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks
that live in /system/framework
or /system/priv-app
)
APK
If this APK can be freely shared, please upload/attach a link to it. sample_compilesdkversion.zip
Questions to ask before submission
- Have you tried
apktool d
,apktool b
without changing anything? Yes. - If you are trying to install a modified apk, did you resign it? N/A
- Are you using the latest apktool version? Yes. 2.3.4 & 2.4.0 version
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.
Is there any update on this issue?
Is there any update on this issue?
Not that I see. Still open and waiting to be worked on.
It seem this issue happened on Mac
I took a look at this and debating closing as no-fix. Apktool by nature is using different build tools to rebuild the application. Forging aapt/aapt2 to lie about the build tool version, even though it may be built with different/newer tools just seems wrong.
Removing "bug", adding "feature".
This issue seems still exist in 2.6.1