Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: aapt gives weird result #22712

Open
RichardLuo0 opened this issue Dec 29, 2024 · 3 comments
Open

[Bug]: aapt gives weird result #22712

RichardLuo0 opened this issue Dec 29, 2024 · 3 comments
Labels
bug report Something is not working properly untriaged

Comments

@RichardLuo0
Copy link

RichardLuo0 commented Dec 29, 2024

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
@RichardLuo0 RichardLuo0 added bug report Something is not working properly untriaged labels Dec 29, 2024
@Anonymous2716
Copy link

Anonymous2716 commented Dec 30, 2024

specify the api versions using the aapt flags.

for example:

--version-name
--version-code
--debug-mode
--min-sdk-version
--target-sdk-version

etc etc.

@RichardLuo0
Copy link
Author

specify the api versions using the aapt flags.

for example:

--version-name
--version-code
--debug-mode
--min-sdk-version
--target-sdk-version

etc etc.

I get this:
image

@Anonymous2716
Copy link

Anonymous2716 commented Jan 1, 2025

what command did you run? .

this Should work https://www.reddit.com/r/termux/comments/wiobz5/build_apps_on_termux_with_and_without_gradle_its/

except for some attribute errors.

anyways you are better of building with gradle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly untriaged
Projects
None yet
Development

No branches or pull requests

2 participants