mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
minor fixes
This commit is contained in:
parent
d904f17fee
commit
206392262f
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "Usage: $0 kiwix-android.keystore [PACKAGE] [APP_NAME] [APP_VERSION]"
|
echo "Usage: $0 kiwix-android.keystore [PACKAGE] [APP_VERSION]"
|
||||||
echo "You must specify the path of the certificate keystore."
|
echo "You must specify the path of the certificate keystore."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -21,20 +21,6 @@ function die {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "x$2" = "x" ];
|
|
||||||
then
|
|
||||||
PACKAGE=`python -c "from xml.dom.minidom import parse; d=parse('AndroidManifest.xml'); print([e.getAttribute('package').strip() for e in d.getElementsByTagName('manifest')][-1])"`
|
|
||||||
else
|
|
||||||
PACKAGE=$2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "x$3" = "x" ];
|
|
||||||
then
|
|
||||||
APP_VERSION=`python -c "from xml.dom.minidom import parse; d=parse('AndroidManifest.xml'); print([e.getAttribute('android:versionName').strip() for e in d.getElementsByTagName('manifest')][-1])"`
|
|
||||||
else
|
|
||||||
APP_VERSION=$3
|
|
||||||
fi
|
|
||||||
|
|
||||||
# default values are guessed from repo (AndroidManifest and res/values/branding)
|
# default values are guessed from repo (AndroidManifest and res/values/branding)
|
||||||
APP_NAME=`python -c "from xml.dom.minidom import parse; d=parse('res/values/branding.xml'); print([e.childNodes[0].data.strip() for e in d.getElementsByTagName('string') if e.getAttribute('name') == 'app_name'][-1])"`
|
APP_NAME=`python -c "from xml.dom.minidom import parse; d=parse('res/values/branding.xml'); print([e.childNodes[0].data.strip() for e in d.getElementsByTagName('string') if e.getAttribute('name') == 'app_name'][-1])"`
|
||||||
TARGET_VERSION=`grep "compileSdkVersion" build.gradle | awk '{print $2}'`
|
TARGET_VERSION=`grep "compileSdkVersion" build.gradle | awk '{print $2}'`
|
||||||
@ -45,14 +31,10 @@ if [ "x$2" != "x" ];
|
|||||||
PACKAGE=$2
|
PACKAGE=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ "x$3" != "x" ];
|
if [ "x$3" != "x" ];
|
||||||
then
|
then
|
||||||
APP_NAME=$3
|
APP_VERSION=$3
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "x$4" != "x" ];
|
|
||||||
then
|
|
||||||
APP_VERSION=$4
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
../src/dependencies/android-sdk/tools/android update project -p . -n kiwix -t android-${TARGET_VERSION}
|
../src/dependencies/android-sdk/tools/android update project -p . -n kiwix -t android-${TARGET_VERSION}
|
||||||
|
@ -47,7 +47,6 @@ DEFAULT_JSDATA = {
|
|||||||
# 'package': "org.kiwix.zim.custom",
|
# 'package': "org.kiwix.zim.custom",
|
||||||
# 'version_name': "1.0",
|
# 'version_name': "1.0",
|
||||||
# 'zim_file': "wikipedia_bm.zim",
|
# 'zim_file': "wikipedia_bm.zim",
|
||||||
# 'license': None,
|
|
||||||
'enforced_lang': None,
|
'enforced_lang': None,
|
||||||
'embed_zim': False,
|
'embed_zim': False,
|
||||||
|
|
||||||
@ -70,6 +69,8 @@ DEFAULT_JSDATA = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SIZE_MATRIX = {
|
SIZE_MATRIX = {
|
||||||
|
'xxxhdpi': 192,
|
||||||
|
'xxhdpi': 144,
|
||||||
'xhdpi': 96,
|
'xhdpi': 96,
|
||||||
'mdpi': 72,
|
'mdpi': 72,
|
||||||
'ldpi': 48,
|
'ldpi': 48,
|
||||||
@ -231,7 +232,7 @@ def step_prepare_launcher_icons(jsdata, **options):
|
|||||||
.format(inf=os.path.join(ANDROID_PATH, 'ic_launcher_512.png'),
|
.format(inf=os.path.join(ANDROID_PATH, 'ic_launcher_512.png'),
|
||||||
p=pixels,
|
p=pixels,
|
||||||
outf=os.path.join(ANDROID_PATH, 'res',
|
outf=os.path.join(ANDROID_PATH, 'res',
|
||||||
'drawable-{}'.format(density),
|
'mipmap-{}'.format(density),
|
||||||
'kiwix_icon.png')))
|
'kiwix_icon.png')))
|
||||||
|
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ def step_update_main_menu_xml(jsdata, **options):
|
|||||||
flushxml(soup, 'menu', menu_xml, head=False)
|
flushxml(soup, 'menu', menu_xml, head=False)
|
||||||
|
|
||||||
|
|
||||||
def step_update_preferences_xml(jsdata, **options):
|
def step_update_xml_nodes(jsdata, **options):
|
||||||
''' change package-named item reference in preference UI xml '''
|
''' change package-named item reference in preference UI xml '''
|
||||||
|
|
||||||
move_to_android_placeholder()
|
move_to_android_placeholder()
|
||||||
@ -309,6 +310,14 @@ def step_update_preferences_xml(jsdata, **options):
|
|||||||
item.name = '{}.settings.SliderPreference'.format(jsdata.get('package'))
|
item.name = '{}.settings.SliderPreference'.format(jsdata.get('package'))
|
||||||
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
flushxml(soup, 'PreferenceScreen', preferences_xml, head=False)
|
||||||
|
|
||||||
|
# rename AnimatedProgressBar node in res/layout/toolbar.xml
|
||||||
|
toolbar_xml = os.path.join(ANDROID_PATH, 'res', 'layout', 'toolbar.xml')
|
||||||
|
soup = soup = BeautifulSoup(open(toolbar_xml, 'r'),
|
||||||
|
'xml', from_encoding='utf-8')
|
||||||
|
item = soup.find('org.kiwix.kiwixmobile.AnimatedProgressBar')
|
||||||
|
item.name = '{}.AnimatedProgressBar'.format(jsdata.get('package'))
|
||||||
|
flushxml(soup, 'LinearLayout', toolbar_xml, head=False)
|
||||||
|
|
||||||
|
|
||||||
def step_update_gradle(jsdata, **options):
|
def step_update_gradle(jsdata, **options):
|
||||||
''' uncomment compiling the content-libs.jar file into the APK '''
|
''' uncomment compiling the content-libs.jar file into the APK '''
|
||||||
@ -489,7 +498,7 @@ ARGS_MATRIX = OrderedDict([
|
|||||||
('branding', step_update_branding_xml),
|
('branding', step_update_branding_xml),
|
||||||
('constants', step_gen_constants_java),
|
('constants', step_gen_constants_java),
|
||||||
('menu', step_update_main_menu_xml),
|
('menu', step_update_main_menu_xml),
|
||||||
('preferences', step_update_preferences_xml),
|
('xmlnodes', step_update_xml_nodes),
|
||||||
('manifest', step_update_android_manifest),
|
('manifest', step_update_android_manifest),
|
||||||
('jni', step_update_kiwix_c),
|
('jni', step_update_kiwix_c),
|
||||||
('libkiwix', step_compile_libkiwix),
|
('libkiwix', step_compile_libkiwix),
|
||||||
|
@ -181,7 +181,7 @@ def upload_to_play_store(jsdata, channel=None):
|
|||||||
packageName=package_name,
|
packageName=package_name,
|
||||||
body={'versionCodes': [apk_response['versionCode']]}).execute()
|
body={'versionCodes': [apk_response['versionCode']]}).execute()
|
||||||
|
|
||||||
logger.debug("Publicatio set to {} for version code {}"
|
logger.debug("Publication set to {} for version code {}"
|
||||||
.format(track_response['track'],
|
.format(track_response['track'],
|
||||||
str(track_response['versionCodes'])))
|
str(track_response['versionCodes'])))
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ STORES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def main(json_path, store='{}:{}'.format(PLAY_STORE, ALPHA)):
|
def main(json_path, store='{}:{}'.format(PLAY_STORE, ALPHA), *args):
|
||||||
jsdata = json.load(get_local_remote_fd(json_path))
|
jsdata = json.load(get_local_remote_fd(json_path))
|
||||||
|
|
||||||
logger.info("Uploading {} APK to {}".format(jsdata['package'], store))
|
logger.info("Uploading {} APK to {}".format(jsdata['package'], store))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user