ReVanced / aapt2

Aapt2 package build workflow
https://revanced.app
GNU General Public License v3.0
51 stars 55 forks source link

aapt2 error in ARM 64 linux #11

Closed ibrunops closed 1 year ago

ibrunops commented 1 year ago

Hello! I'm trying to use revanced with a custom aapt2 bin for ARM64 linux, downloaded from this repository a few months ago. It worked perfect all this time, but today I am encountering this error. I think it's something related to aapt2 and that's why I put the issue in this repo. Maybe a new version of aapt2 is needed? I am using 'revanced-cli-2.22.0-all.jar', 'revanced-patches-2.187.0.jar', 'revanced-integrations-0.115.1.apk' and youtube version 18.23.35 Thanks in advance

(kali-raspberry-pi)-[~/Downloads/revanced]
 $ java -jar cli.jar \
 --custom-aapt2-binary=/home/kali/Downloads/revanced/dist/arm64-v8a/aapt2 \
 -a youtube.apk \
 -c \
 -o revanced.apk \
 -b patches.jar \
 -m unsigned.apk
INFO: Reading dex files 
INFO: Decoding AndroidManifest.xml only, because resources are not needed 
INFO: Skipping change-package-name: Excluded by default 
INFO: Skipping enable-android-debugging: Excluded by default 
INFO: Skipping export-all-activities: Excluded by default 
INFO: Skipping predictive-back-gesture: Excluded by default 
INFO: Skipping remove-player-controls-background: Excluded by default 
INFO: Skipping remove-screen-capture-restriction: Excluded by default 
INFO: Skipping remove-screenshot-restriction: Excluded by default 
INFO: Skipping spoof-wifi-connection: Excluded by default 
INFO: Merging unsigned.apk 
INFO: Deleting existing resource cache directory 
INFO: Decoding resources 
INFO: Executing patches 
INFO: Always autorepeat succeeded 
INFO: Client spoof succeeded 
INFO: Comments succeeded 
INFO: Copy video url succeeded 
INFO: Custom branding succeeded 
INFO: Disable Shorts on startup succeeded 
INFO: Disable auto captions succeeded 
INFO: Disable fullscreen panels succeeded 
INFO: Disable player popup panels succeeded 
INFO: Disable zoom haptics succeeded 
INFO: Enable debugging succeeded 
INFO: External downloads succeeded 
INFO: HDR auto brightness succeeded 
INFO: Hide Shorts components succeeded 
INFO: Hide ads succeeded 
INFO: Hide album cards succeeded 
INFO: Hide autoplay button succeeded 
INFO: Hide breaking news shelf succeeded 
INFO: Hide captions button succeeded 
INFO: Hide cast button succeeded 
INFO: Hide crowdfunding box succeeded 
INFO: Hide email address succeeded 
INFO: Hide endscreen cards succeeded 
INFO: Hide filter bar succeeded 
INFO: Hide floating microphone button succeeded 
INFO: Hide info cards succeeded 
INFO: Hide layout components succeeded 
INFO: Hide load more button succeeded 
INFO: Hide player buttons succeeded 
INFO: Hide player overlay succeeded 
INFO: Hide seekbar succeeded 
INFO: Hide timestamp succeeded 
INFO: Hide video action buttons succeeded 
INFO: Hide watermark succeeded 
INFO: Minimized playback succeeded 
INFO: Navigation buttons succeeded 
INFO: Old video quality menu succeeded 
INFO: Open links externally succeeded 
INFO: Playback speed succeeded 
INFO: Player flyout menu succeeded 
INFO: Premium heading succeeded 
INFO: Remember video quality succeeded 
INFO: Return YouTube Dislike succeeded 
INFO: Seekbar tapping succeeded 
INFO: SponsorBlock succeeded 
INFO: Spoof app version succeeded 
INFO: Swipe controls succeeded 
INFO: Tablet mini player succeeded 
INFO: Theme succeeded 
INFO: Vanced MicroG support succeeded 
INFO: Video ads succeeded 
INFO: Wide searchbar succeeded 
INFO: Compiling resources 
WARNING: aapt2 W 08-09 20:50:41 66684 66684] Unknown chunk type '200'. 
WARNING: /home/kali/Downloads/revanced/revanced-cache/AndroidManifest.xml:136: error: unexpected element <property> found in <manifest><application>. 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/home/kali/Downloads/revanced/dist/arm64-v8a/aapt2, link, -o, /home/kali/Downloads/revanced/revanced-cache/aapt_temp_file, --min-sdk-version, 26, --target-sdk-version, 33, --version-code, 1538252224, --version-name, 18.23.35, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /tmp/APKTOOL1945370467532687801.tmp, -0, arsc, -I, revanced-cache/1.apk, --manifest, /home/kali/Downloads/revanced/revanced-cache/AndroidManifest.xml, /home/kali/Downloads/revanced/revanced-cache/build/resources.zip]                                                       
        at brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:484)
        at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:619)
        at app.revanced.patcher.Patcher.save(Patcher.kt:128)
        at app.revanced.cli.patcher.Patcher.start$revanced_cli(Patcher.kt:21)
        at app.revanced.cli.command.MainCommand.run(MainCommand.kt:167)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.main.MainKt.main(Main.kt:7)
Caused by: brut.common.BrutException: could not exec (exit code = 1): [/home/kali/Downloads/revanced/dist/arm64-v8a/aapt2, link, -o, /home/kali/Downloads/revanced/revanced-cache/aapt_temp_file, --min-sdk-version, 26, --target-sdk-version, 33, --version-code, 1538252224, --version-name, 18.23.35, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, -e, /tmp/APKTOOL1945370467532687801.tmp, -0, arsc, -I, revanced-cache/1.apk, --manifest, /home/kali/Downloads/revanced/revanced-cache/AndroidManifest.xml, /home/kali/Downloads/revanced/revanced-cache/build/resources.zip]                                                                             
        at brut.util.OS.exec(OS.java:99)
        at brut.androlib.res.AndrolibResources.aapt2Package(AndrolibResources.java:480)
        ... 13 more
oSumAtrIX commented 1 year ago

Your aapt2 binary does not work. You can try checking the patches in this repository for a fix.

ibrunops commented 1 year ago

Your aapt2 binary does not work. You can try checking the patches in this repository for a fix.

Hi! Can you explain me more? I don't know how to use the patches from the repo, for example, the one that says aapt2.patch Thanks!

oSumAtrIX commented 1 year ago

You can review the CI to see how the patches are used

ibrunops commented 1 year ago

You can review the CI to see how the patches are used

Sorry, are you referring to the patches that revanced uses? Or those that appear in this repo about aapt2? Where can I review de CI? Thanks in advance

oSumAtrIX commented 1 year ago

Here: https://github.com/ReVanced/aapt2/blob/main/.github/workflows/build.yml#L34

ibrunops commented 1 year ago

Here: https://github.com/ReVanced/aapt2/blob/main/.github/workflows/build.yml#L34

Oh, I see. Is it possible with github actions to build a new aapt2 in the repo itself or do I have to do it myself? I still wouldn't be looking at how to use any of the patches, but I'm going to try to continue investigating.

oSumAtrIX commented 1 year ago

Your custom AAPT may need specific patches from this repository to work. You can see CI how to apply these patches and build AAPT yourself