Skip to content

Commit

Permalink
download: add a script to re-sign apk before release
Browse files Browse the repository at this point in the history
to avoid installation issues in some ROMs

Signed-off-by: sunilpaulmathew <sunil.kde@gmail.com>
  • Loading branch information
sunilpaulmathew committed Nov 14, 2018
1 parent 0d5c233 commit 362b51e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions download/apkresign.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

COLOR_RED="\033[0;31m"
COLOR_GREEN="\033[1;32m"
COLOR_NEUTRAL="\033[0m"
PROJECT_ROOT=$PWD
APK_SIGN_KEY="../app/sp.jks"

# Checking the existence of apk signing key
if [ -e $APK_SIGN_KEY ]; then
echo -e $COLOR_GREEN"\n Copying apk signing key to the download folder..."$COLOR_NEUTRAL
cp $APK_SIGN_KEY spsigningkey.jks

echo -e $COLOR_GREEN"\n Re-signing apk..."$COLOR_NEUTRAL
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore spsigningkey.jks com.smartpack.kernelmanager.apk sp_key1

# Remove the signing key file once the process is done
rm -r spsigningkey.jks

echo -e $COLOR_GREEN"\n Everything done..."$COLOR_NEUTRAL
else
echo -e $COLOR_RED"\n Signing key not found..."$COLOR_RED
fi

0 comments on commit 362b51e

Please sign in to comment.