Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

Usage of empty namespaces in AndroidManifest.xml

Open bagipro opened this issue 5 years ago • 6 comments

Information

  1. Apktool Version (apktool -version) - 2.4.1
  2. Operating System (Mac, Linux, Windows) - Mac
  3. APK From? (Playstore, ROM, Other) - Playstore

Steps to Reproduce

apktool d com.xoom.android.app.apk

APK

https://drive.google.com/file/d/1N9p7Jdt153UIrWJvsG_Knwr0-FIdJS45/view?usp=sharing

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? +
  2. If you are trying to install a modified apk, did you resign it? +
  3. Are you using the latest apktool version? +

The whole AndroidManifest.xml looks like so

<manifest xmlns:android="http://schemas.android.com/apk/res/android" compileSdkVersion="29" compileSdkVersionCodename="10" package="com.xoom.android.app" platformBuildVersionCode="29" platformBuildVersionName="10" versionName="8.0.1">
    <uses-permission name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission name="android.permission.INTERNET"/>
    <uses-permission name="android.permission.VIBRATE"/>
    <uses-permission name="android.permission.WAKE_LOCK"/>
    <uses-permission name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission name="android.permission.CAMERA"/>
    <uses-feature name="android.hardware.camera" required="false"/>
    <uses-feature name="android.hardware.camera.autofocus" required="false"/>
    <uses-feature name="android.hardware.camera.flash" required="false"/>
    <permission name="com.xoom.android.app.permission.C2D_MESSAGE" protectionLevel="signature"/>

So all attributes don't contain android namespace

bagipro avatar Oct 25 '20 20:10 bagipro

Not sure what you are reporting here. Just looks like a bunch of permissions to me.

iBotPeaches avatar Oct 30 '20 15:10 iBotPeaches

Hey @iBotPeaches Almost all of the attributes should be declared in android: namespace like so

<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="com.xoom.android.app" platformBuildVersionCode="29" platformBuildVersionName="10" android:versionName="8.0.1">
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

bagipro avatar Oct 30 '20 15:10 bagipro

Did this change recently? Since apktool normally doesn't kill/forget about namespaces on properties. Or is it expected going forward with newer Android's that android properties are always namespaced.

iBotPeaches avatar Oct 30 '20 16:10 iBotPeaches

@iBotPeaches Nope, it's a kind of obfuscation that truncates namespace values

bagipro avatar Oct 30 '20 16:10 bagipro

I replicate. Adding Bug.

iBotPeaches avatar Nov 28 '20 23:11 iBotPeaches

@iBotPeaches This APK can be installed and used on a device (originally this is an apks file, so you should install it directly from Google Play or use split APK install apps), how it can be incorrect?

I didn't post that. I don't agree with @pashamcr - this looks like a bug to me.

iBotPeaches avatar Nov 30 '20 19:11 iBotPeaches

This was fixed today in this PR: https://github.com/iBotPeaches/Apktool/commit/cd275ff48baed0fd84220e72ea62c98d1eeaac72

<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="29" android:compileSdkVersionCodename="10" package="com.xoom.android.app" platformBuildVersionCode="29" platformBuildVersionName="10">
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.CAMERA"/>

I see namespaces now. You are still far from assembly due to undecoded values being in a raw format that aapt2 cannot understand. I'm still debating that resolution in this ticket: https://github.com/iBotPeaches/Apktool/issues/1407

Where we either remove them or figure out some nomenclature of unknown values that aapt can understand.

iBotPeaches avatar Jul 30 '23 18:07 iBotPeaches