From 362b51e33b9498be87be2d97f3c43fc825d97d3d Mon Sep 17 00:00:00 2001 From: sunilpaulmathew Date: Wed, 14 Nov 2018 13:46:24 +0900 Subject: [PATCH] download: add a script to re-sign apk before release to avoid installation issues in some ROMs Signed-off-by: sunilpaulmathew --- download/apkresign.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 download/apkresign.sh diff --git a/download/apkresign.sh b/download/apkresign.sh new file mode 100644 index 000000000..689763d2b --- /dev/null +++ b/download/apkresign.sh @@ -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