Skip to content

Commit

Permalink
we can run signed APK directly with cordova run
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoclpf committed Jun 10, 2023
1 parent 06f0370 commit 91e9d18
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions scripts/runReleaseOnDevice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ export PATH=${PATH}:$ANDROID_SDK_ROOT/tools:$ANDROID_SDK_ROOT/platform-tools
cd "${0%/*}" # directory of the script
cd .. # root directory of the project

# extract $PASS
source keys/keyPassword

#adb kill-server
#adb start-server

Expand All @@ -20,19 +23,4 @@ source keys/keyPassword

cordova clean

cordova build --release android

printf "\033[32m\n\nSIGNING APP...\033[0m\n\n\n"

cp keys/autocosts.keystore platforms/android/app/build/outputs/apk/release/
cd platforms/android/app/build/outputs/apk/release/

# old method of signing; after Android 11 one must use apksigner instead
#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore autocosts.keystore -storepass $PASS app-release-unsigned.apk autocosts

zipalign -v 4 app-release-unsigned.apk formParkingViolation.apk
apksigner sign --ks autocosts.keystore --pass-encoding utf-8 --ks-key-alias autocosts --ks-pass pass:$PASS --key-pass pass:$PASS formParkingViolation.apk

cd ../../../../../../..

cordova run android --device --release --noprepare --nobuild
cordova run android --release -- --keystore=keys/autocosts.keystore --storePassword=$PASS --alias=autocosts --password=$PASS --packageType=apk

0 comments on commit 91e9d18

Please sign in to comment.