AddSecurityExceptionAndroid icon indicating copy to clipboard operation
AddSecurityExceptionAndroid copied to clipboard

Resigned APK shows successfully, but the build isn't generated at all

Open Sandynaidu opened this issue 2 years ago • 3 comments

Not able to generate the build. this shows error

W: /tmp/test/AndroidManifest.xml:66: error: No resource identifier found for attribute 'allowNativeHeapPointerTagging' in package 'android'
W: 
W: /tmp/test/AndroidManifest.xml:375: error: Error: No resource type specified (at 'resource' with value '@2114060288').
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/86/zqx0vvz95jd8x6whd0j8d7y50vyzm3/T/brut_util_Jar_2084800958329043937.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 80110423, --version-name, 4.2207.0, --no-version-vectors, -F, /var/folders/86/zqx0vvz95jd8x6whd0j8d7y50vyzm3/T/APKTOOL282281327963132326.tmp, -e, /var/folders/86/zqx0vvz95jd8x6whd0j8d7y50vyzm3/T/APKTOOL5889534043134153033.tmp, -0, arsc, -I, /Users/300063668/Library/apktool/framework/1.apk, -S, /tmp/test/res, -M, /tmp/test/AndroidManifest.xml]
jarsigner: unable to open jar file: ./test_temp.apk
./addSecurityExceptions.sh: line 52: zipalign: command not found
Resigned APK successfully test_new.apk

Even though this shows test_new.apk is generated but its isn't available. Attaching the image for your reference

Screenshot 2022-08-01 at 11 21 17 AM

Sandynaidu avatar Aug 01 '22 05:08 Sandynaidu

Hi, Try updating apktool.jar on your env. it looks like the Manifest contains attribute that apktool doesn't recognize thus failing to build the temp apk

levyitay avatar Aug 03 '22 18:08 levyitay

I've encountered the same problem when running from my Mac. It was fixed by manually downloading zipalign.

Remember to give executable permission to zipalign file and change the zipalign reference in addSecurityExceptions.sh file to below.

./zipalign -p 4 $tempFileName $newFileName

shameerahamed avatar Aug 23 '22 15:08 shameerahamed

You can download zipalign for Mac/Win/Linux from here: https://androidsdkmanager.azurewebsites.net/Buildtools

amard33p avatar Sep 06 '22 10:09 amard33p

@amard33p I updated the script let me know if that works

levyitay avatar Nov 23 '22 17:11 levyitay

@amard33p I updated the script let me know if that works

Thanks. It works now

amard33p avatar Nov 30 '22 09:11 amard33p