Skip to content

Commit

Permalink
As app were not able to installed, hence zipaligning apk
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyank Shah committed Dec 9, 2020
1 parent edc3549 commit 160c9f1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions addSecurityExceptions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ filename=$(basename "$fullfile")
extension="${filename##*.}"
filename="${filename%.*}"
new="_new.apk"
temp="_temp.apk"
tempFileName=$filename$temp
newFileName=$filename$new
tmpDir=/tmp/$filename

Expand All @@ -44,7 +46,9 @@ fi


java -jar "$DIR/apktool.jar" empty-framework-dir --force "$tmpDir"
echo "Building new APK $newFileName"
java -jar "$DIR/apktool.jar" b -o "./$newFileName" "$tmpDir"
jarsigner -verbose -keystore $debugKeystore -storepass android -keypass android "./$newFileName" androiddebugkey

echo "Building temp APK $tempFileName"
java -jar "$DIR/apktool.jar" b -o "./$tempFileName" "$tmpDir"
jarsigner -verbose -keystore $debugKeystore -storepass android -keypass android "./$tempFileName" androiddebugkey
zipalign -p 4 $tempFileName $newFileName
rm -rf $tempFileName
echo "Resigned APK successfully $newFileName"

0 comments on commit 160c9f1

Please sign in to comment.