这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: aapt gives weird result #22712

@RichardLuo0

Description

@RichardLuo0

Problem description

I am trying to build the following file with command aapt package -f -M AndroidManifest.xml -S res/ -I android.jar -F app.apk.unaligned:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.dummy.iconPack">

  <application
    android:label="test">

    <activity android:name="android.app.Activity">
      <intent-filter>
        <action android:name="com.novalauncher.THEME" />
        <category android:name="com.novalauncher.category.CUSTOM_ICON_PICKER" />
      </intent-filter>
    </activity>
  </application>
</manifest>

Then I decompile the generated apk with jadx-gui, and I get this result:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dummy.iconPack">
    <application android:colorPrimary="test">
        <activity android:windowLightNavigationBar="android.app.Activity">
            <intent-filter>
                <action android:windowLightNavigationBar="com.novalauncher.THEME"/>
                <category android:windowLightNavigationBar="com.novalauncher.category.CUSTOM_ICON_PICKER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>

However, if I compile the same file on a windows PC, I get the correct output:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:compileSdkVersion="35"
    android:compileSdkVersionCodename="15"
    package="com.dummy.iconPack"
    platformBuildVersionCode="35"
    platformBuildVersionName="15">
    <application android:label="test">
        <activity android:name="android.app.Activity">
            <intent-filter>
                <action android:name="com.novalauncher.THEME"/>
                <category android:name="com.novalauncher.category.CUSTOM_ICON_PICKER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>

The android.jar is from android SDK 35. But it seems the android.jar doesn't matter, the aapt on windows PC uses the same android.jar.

What steps will reproduce the bug?

Run the command aapt package -f -M AndroidManifest.xml -S res/ -I android.jar -F app.apk.unaligned with empty res folder and the above AndroidManifest.xml

What is the expected behavior?

The correct output as in PC

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=6988
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
x86_64
Subscribed repositories:
# sources.list
deb https://packages-cf.termux.dev/apt/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.44.6
Android version:
15
Kernel build information:
Linux localhost 6.6.30-android15-7-gbb616d66d8a9-ab11968886 #1 SMP PREEMPT Thu Jun 13 23:09:10 UTC 2024 x86_64 Android
Device manufacturer:
Google
Device model:
sdk_gphone64_x86_64
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions