ctcci: add apksigner support

This commit is contained in:
ave 2019-11-26 21:21:08 +03:00
parent 446fe76e08
commit c3e1a54ff9
No known key found for this signature in database
GPG key ID: 09356ABAA42C842B
2 changed files with 15 additions and 4 deletions

View file

@ -230,10 +230,18 @@ APK_PATH = os.path.join(WORK_FOLDER, "discord",
"dist", f"{PACKAGE_ID}-{VERSION}.apk") "dist", f"{PACKAGE_ID}-{VERSION}.apk")
# Sign the APK # Sign the APK
subprocess.run(f"jarsigner -storepass {KEYSTORE_PASS} -keystore " if DO_APKSIGNER:
f"{KEYSTORE_FILE} {APK_PATH} {KEYSTORE_ALIAS}", subprocess.run(f"apksigner sign --ks {KEYSTORE_FILE}"
shell=True, f"--ks-key-alias {KEYSTORE_ALIAS} "
cwd=WORK_FOLDER) f"--ks-pass pass:{KEYSTORE_PASS}"
f"{APK_PATH}",
shell=True,
cwd=WORK_FOLDER)
else:
subprocess.run(f"jarsigner -storepass {KEYSTORE_PASS} -keystore "
f"{KEYSTORE_FILE} {APK_PATH} {KEYSTORE_ALIAS}",
shell=True,
cwd=WORK_FOLDER)
# Copy the result file # Copy the result file
shutil.copyfile(APK_PATH, OUTPUT_FILE) shutil.copyfile(APK_PATH, OUTPUT_FILE)

View file

@ -23,6 +23,9 @@ RESULT_FOLDER = FDROID_FOLDER + "/repo"
DO_GITPULL = True DO_GITPULL = True
REPO_FOLDER = "/home/ave/distokrepos/cutthecord" REPO_FOLDER = "/home/ave/distokrepos/cutthecord"
# If false, jarsigner will be used for signing the apk.
DO_APKSIGNER = False
# Keystore file, alias and pass. Required. # Keystore file, alias and pass. Required.
KEYSTORE_FILE = "/home/ave/oof.keystore" KEYSTORE_FILE = "/home/ave/oof.keystore"
KEYSTORE_ALIAS = "distok" KEYSTORE_ALIAS = "distok"