2018-01-23 20:11:52 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-18 15:26:18 +00:00
|
|
|
version_code=22.6.91
|
2020-04-18 08:28:32 +00:00
|
|
|
version_date=99999999
|
2019-08-11 20:46:13 +00:00
|
|
|
|
2019-08-11 20:41:24 +00:00
|
|
|
build_date=$(LANG='en_US' date +"%Y%m%d")
|
|
|
|
|
|
|
|
VERSION=${version_code}.${build_date}
|
2020-08-18 18:51:43 +00:00
|
|
|
CWD=$(readlink -n "${BASH_SOURCE[0]}")
|
2018-01-23 20:11:52 +00:00
|
|
|
CWD=$(dirname "${CWD}")
|
|
|
|
|
2020-08-11 19:38:33 +00:00
|
|
|
case $(uname -s) in
|
2020-08-18 19:04:59 +00:00
|
|
|
*Darwin* | *BSD* )
|
|
|
|
export sumsha256="shasum -a 256"
|
|
|
|
export statx="stat -f %Z"
|
|
|
|
;;
|
|
|
|
*Linux* )
|
|
|
|
export sumsha256="sha256sum"
|
|
|
|
export statx="stat -c %Z"
|
|
|
|
;;
|
2020-08-11 19:38:33 +00:00
|
|
|
esac
|
|
|
|
|
2019-08-09 22:55:05 +00:00
|
|
|
# DIRS
|
|
|
|
datafolder="${CWD}/data"
|
|
|
|
repofolder="$datafolder/repo"
|
|
|
|
|
|
|
|
# AppsFolder
|
|
|
|
appsfolder[0]="Full"
|
|
|
|
appsfolder[1]="${appsfolder[0]}/system"
|
|
|
|
appsfolder[2]="${CWD}/${appsfolder[1]}"
|
|
|
|
appsfolder[3]="${appsfolder[1]}/app"
|
|
|
|
appsfolder[4]="${appsfolder[1]}/priv-app"
|
2020-01-17 21:36:13 +00:00
|
|
|
appsfolder[5]="Google/gsync"
|
2019-08-09 22:55:05 +00:00
|
|
|
appsfolder[6]="${CWD}/${appsfolder[5]}"
|
2020-01-17 21:36:13 +00:00
|
|
|
appsfolder[7]="Google/swipe"
|
2019-08-09 22:55:05 +00:00
|
|
|
appsfolder[8]="${CWD}/${appsfolder[7]}"
|
|
|
|
appsfolder[9]="OsmAnd/system"
|
|
|
|
appsfolder[10]="${CWD}/${appsfolder[9]}"
|
|
|
|
appsfolder[11]="BromiteWebView/system"
|
|
|
|
appsfolder[12]="${CWD}/${appsfolder[11]}"
|
|
|
|
|
|
|
|
|
|
|
|
for funcfile in pkg update common download database report; do
|
|
|
|
source "$datafolder/build-package.${funcfile}" || exit 1
|
2018-01-23 20:11:52 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
[[ -z ${1} ]] && show_help
|
|
|
|
|
|
|
|
for opt in ${@}; do
|
|
|
|
case ${opt} in
|
|
|
|
full)
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-01-23 20:11:52 +00:00
|
|
|
mk_pkg_full
|
|
|
|
;;
|
|
|
|
|
|
|
|
microg )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-01-23 20:11:52 +00:00
|
|
|
mk_pkg_microg
|
|
|
|
;;
|
|
|
|
|
|
|
|
fdroid )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-01-23 20:11:52 +00:00
|
|
|
mk_pkg_fdroid
|
|
|
|
;;
|
|
|
|
|
|
|
|
patcher )
|
|
|
|
mk_pkg_patcher
|
|
|
|
;;
|
|
|
|
|
|
|
|
uninstaller )
|
|
|
|
mk_pkg_uninstaller
|
|
|
|
;;
|
|
|
|
|
|
|
|
setupwizard )
|
|
|
|
mk_pkg_setupwizard
|
|
|
|
;;
|
|
|
|
|
2018-11-08 17:27:34 +00:00
|
|
|
bromitewebview )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-11-08 17:34:57 +00:00
|
|
|
mk_pkg_bromite_webview
|
2018-11-08 17:27:34 +00:00
|
|
|
;;
|
|
|
|
|
2018-11-23 20:04:36 +00:00
|
|
|
osmand )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-11-23 20:04:36 +00:00
|
|
|
mk_pkg_osmand
|
|
|
|
;;
|
|
|
|
|
2018-11-20 17:25:52 +00:00
|
|
|
systest )
|
|
|
|
mk_pkg_systest
|
|
|
|
;;
|
|
|
|
|
2020-01-17 21:36:13 +00:00
|
|
|
google )
|
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
|
|
|
mk_pkg_google
|
|
|
|
;;
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
all )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2018-01-23 20:11:52 +00:00
|
|
|
mk_pkg_full
|
|
|
|
mk_pkg_microg
|
|
|
|
mk_pkg_fdroid
|
|
|
|
mk_pkg_patcher
|
|
|
|
mk_pkg_uninstaller
|
|
|
|
mk_pkg_setupwizard
|
2018-11-08 17:27:34 +00:00
|
|
|
mk_pkg_bromite_webview
|
2018-11-23 20:04:36 +00:00
|
|
|
mk_pkg_osmand
|
2018-11-20 17:25:52 +00:00
|
|
|
mk_pkg_systest
|
2020-01-17 21:36:13 +00:00
|
|
|
mk_pkg_google
|
2019-08-09 09:20:38 +00:00
|
|
|
create_report
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
ver )
|
2019-08-13 18:19:01 +00:00
|
|
|
increase_version_number "${2}" "${3}"
|
2019-10-08 18:59:08 +00:00
|
|
|
exit $?
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
bump )
|
|
|
|
increase_module_version
|
2019-10-08 18:59:08 +00:00
|
|
|
exit $?
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
dalvik )
|
2019-08-13 18:19:01 +00:00
|
|
|
dalvikize_jar "${2}" "${3}"
|
2019-10-08 18:59:08 +00:00
|
|
|
exit $?
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
pull )
|
2018-09-15 17:21:52 +00:00
|
|
|
update_indices
|
2018-01-23 20:11:52 +00:00
|
|
|
nanodroid_pull
|
2019-08-10 10:29:57 +00:00
|
|
|
update_master
|
2018-01-23 20:11:52 +00:00
|
|
|
check_nanodroid
|
|
|
|
;;
|
|
|
|
|
|
|
|
u-microg )
|
2018-09-15 17:21:52 +00:00
|
|
|
update_indices
|
2018-01-23 20:11:52 +00:00
|
|
|
update_microg
|
2019-08-10 10:29:57 +00:00
|
|
|
update_master
|
2018-09-15 17:21:52 +00:00
|
|
|
check_nanodroid
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
u-fdroid )
|
2018-09-15 17:21:52 +00:00
|
|
|
update_indices
|
2018-01-23 20:11:52 +00:00
|
|
|
update_fdroid
|
2019-08-10 10:29:57 +00:00
|
|
|
update_master
|
2018-09-15 17:21:52 +00:00
|
|
|
check_nanodroid
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
u-apps )
|
2018-09-15 17:21:52 +00:00
|
|
|
update_indices
|
2018-01-23 20:11:52 +00:00
|
|
|
update_apps
|
2019-08-10 10:29:57 +00:00
|
|
|
update_master
|
2018-09-15 17:21:52 +00:00
|
|
|
check_nanodroid
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
u-swipe )
|
|
|
|
update_swipe
|
2019-08-10 10:29:57 +00:00
|
|
|
update_master
|
2018-09-15 17:21:52 +00:00
|
|
|
check_nanodroid
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
u-gsync )
|
|
|
|
update_gsync
|
2020-01-02 13:23:10 +00:00
|
|
|
update_master
|
2018-09-15 17:21:52 +00:00
|
|
|
check_nanodroid
|
2018-01-23 20:11:52 +00:00
|
|
|
;;
|
|
|
|
|
2018-11-07 19:34:06 +00:00
|
|
|
u-bromite )
|
|
|
|
update_indices
|
|
|
|
update_bromite
|
2020-01-02 13:23:10 +00:00
|
|
|
update_master
|
2018-11-23 20:18:01 +00:00
|
|
|
check_nanodroid
|
2018-11-07 19:34:06 +00:00
|
|
|
;;
|
|
|
|
|
2018-11-23 20:04:36 +00:00
|
|
|
u-osmand )
|
|
|
|
update_indices
|
|
|
|
update_osmand
|
2020-01-02 13:23:10 +00:00
|
|
|
update_master
|
2018-11-23 20:04:36 +00:00
|
|
|
check_nanodroid
|
|
|
|
;;
|
|
|
|
|
2019-03-01 13:23:44 +00:00
|
|
|
u-patch )
|
|
|
|
update_patches
|
|
|
|
;;
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
check )
|
|
|
|
check_nanodroid
|
|
|
|
;;
|
|
|
|
|
|
|
|
clean )
|
|
|
|
echo -ne "\nAre you sure to delete all untracked files?\n >> enter [y] or [j] to continue: "
|
|
|
|
read -r user_input
|
|
|
|
|
|
|
|
case "${user_input}" in
|
|
|
|
y | Y | j | J )
|
|
|
|
git clean -fd
|
|
|
|
;;
|
|
|
|
|
|
|
|
* )
|
|
|
|
echo "aborted"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2019-08-06 08:20:47 +00:00
|
|
|
report )
|
2019-08-06 08:26:05 +00:00
|
|
|
check_nanodroid || error "run 'build-package pull' first!"
|
2019-08-06 08:20:47 +00:00
|
|
|
create_report
|
|
|
|
;;
|
|
|
|
|
2018-01-23 20:11:52 +00:00
|
|
|
* )
|
|
|
|
show_help
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|