mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Fixed generation and install of custom apps
This commit is contained in:
parent
2297c10cec
commit
5523edec26
@ -490,6 +490,16 @@ def step_build_apk(jsdata, **options):
|
||||
syscall('./gradlew build --stacktrace')
|
||||
|
||||
|
||||
# rename APKs for better listing
|
||||
folder_name = os.path.split(ANDROID_PATH)[-1]
|
||||
for variant in ('debug', 'release-unsigned'):
|
||||
shutil.move(os.path.join('build', 'outputs', 'apk',
|
||||
"{}-{}.apk".format(folder_name, variant)),
|
||||
os.path.join('build', 'outputs', 'apk',
|
||||
"{}-{}.apk".format(jsdata.get('package'), variant)))
|
||||
|
||||
|
||||
|
||||
def step_move_apk_to_destination(jsdata, **options):
|
||||
""" place and rename built APKs to main output directory """
|
||||
|
||||
@ -501,7 +511,7 @@ def step_move_apk_to_destination(jsdata, **options):
|
||||
except OSError:
|
||||
pass
|
||||
# move generated APK to satisfy other scripts
|
||||
for variant in ('debug', 'debug-unaligned', 'release-unsigned'):
|
||||
for variant in ('debug', 'release-unsigned'):
|
||||
shutil.move(os.path.join(ANDROID_PATH, 'build', 'outputs', 'apk',
|
||||
"{}-{}.apk"
|
||||
.format(jsdata.get('package'), variant)),
|
||||
|
@ -8,12 +8,12 @@ if [ "x$1" != "x" ];
|
||||
PACKAGE=$1
|
||||
fi
|
||||
|
||||
if [ -f build/outputs/apk/${PACKAGE}-debug-unaligned.apk ]
|
||||
if [ -f build/outputs/apk/${PACKAGE}-debug.apk ]
|
||||
then
|
||||
echo "Uninstalling old Kiwix APK..."
|
||||
../src/dependencies/android-sdk/platform-tools/adb uninstall ${PACKAGE} ;
|
||||
${ANDROID_HOME}/platform-tools/adb uninstall ${PACKAGE} ;
|
||||
echo "Installing new Kiwix APK..."
|
||||
../src/dependencies/android-sdk/platform-tools/adb install build/outputs/apk/${PACKAGE}-debug-unaligned.apk
|
||||
${ANDROID_HOME}/platform-tools/adb install build/outputs/apk/${PACKAGE}-debug.apk
|
||||
else
|
||||
echo "No APK file available for package ${PACKAGE} !"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user