forked from jqssun/android-helium-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.sh
More file actions
executable file
·21 lines (18 loc) · 721 Bytes
/
common.sh
File metadata and controls
executable file
·21 lines (18 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
export SCRIPT_DIR=$(realpath $(dirname $0))
replace() {
export org=$2 new=$3
find $1 -type f -exec sed -i 's@'$org'@'$new'@g' {} \;
}
set_keys() {
mkdir -p $SCRIPT_DIR/keys
echo $LOCAL_TEST_JKS | base64 -d > $SCRIPT_DIR/keys/local.properties
echo $STORE_TEST_JKS | base64 -d > $SCRIPT_DIR/keys/test.jks
unset LOCAL_TEST_JKS
unset STORE_TEST_JKS
}
sign_apk() {
export apksigner=$(find $ANDROID_HOME/build-tools -name apksigner | sort | tail -n 1)
source $SCRIPT_DIR/keys/local.properties
$apksigner sign -verbose -ks $SCRIPT_DIR/keys/test.jks --ks-pass pass:$storePassword --key-pass pass:$keyPassword --ks-key-alias $keyAlias --out $2 $1 || exit 1
rm -rf $SCRIPT_DIR/keys
}