'How to edit android manifest for android apk and rebuild it for chrome app
I am trying to edit AndroidManifest.xml for chrome app using apktool
Using the below command to decompile the jar, I am able to get the AndroidManifest.xml file and edit file to remove android:allowAudioPlaybackCapture="false" attribute from application node.
<application android:allowAudioPlaybackCapture="false" android:allowBackup="true" android:appComponentFactory="org.chromium.chrome.browser.base.SplitCompatAppComponentFactory" android:backupAgent="org.chromium.chrome.browser.ChromeBackupAgent" android:fullBackupOnly="false" android:icon="@drawable/APKTOOL_DUPLICATE_drawable_0x7f08022c" android:label="@string/APKTOOL_DUPLICATE_string_0x7f1401e0" android:largeHeap="false" android:manageSpaceActivity="@string/APKTOOL_DUPLICATE_string_0x7f1405e9" android:name="org.chromium.chrome.browser.base.SplitChromeApplication" android:networkSecurityConfig="@xml/APKTOOL_DUPLICATE_xml_0x7f180025" android:restoreAnyVersion="true" android:roundIcon="@drawable/APKTOOL_DUPLICATE_drawable_0x7f08022d" android:supportsRtl="true" android:zygotePreloadName="org.chromium.content_public.app.ZygotePreload">
apktool d google-chrome-98-0-4758-101.apk
But when I trying to build again using below command I get following error
apktool b google-chrome-98-0-4758-101
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/dk/1p87jm1d4c1c7rq4s385xfqc0000gn/T/brut_util_Jar_44412591478507968185529954203449703541.tmp, p, --forced-package-id, 127, --min-sdk-version, 23, --target-sdk-version, 23, --max-sdk-version, 23, --max-res-version, 23, --version-code, 475810110, --version-name, 98.0.4758.101, --no-version-vectors, -F, /var/folders/dk/1p87jm1d4c1c7rq4s385xfqc0000gn/T/APKTOOL503548586151793248.tmp, -e, /var/folders/dk/1p87jm1d4c1c7rq4s385xfqc0000gn/T/APKTOOL1736943765463305431.tmp, -0, arsc, -I, /apktool/framework/1.apk, -S, /androidrtc/ChromeApk/google-chrome-98-0-4758-101/res, -M, /androidrtc/ChromeApk/google-chrome-98-0-4758-101/AndroidManifest.xml]
Solution 1:[1]
I wouldn't recommend doing that. There is a reason why Google requires you to sign the APK/AAB files before uploading, and that is to prevent tampering like you are doing here.
At most, if you want to use Chrome in your app, your best bet is to use Chrome Custom Tabs.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Oliver Spryn |
