2
0
mirror of https://gitlab.com/Nanolx/NanoDroid synced 2024-10-31 09:20:23 +00:00

Yeah, right, TWRP shell can't handle arrays, but substrings

This commit is contained in:
Christopher Roy Bratusek 2018-11-27 20:20:47 +01:00
parent bf8fd318db
commit 559176f60d
4 changed files with 32 additions and 34 deletions

View File

@ -7,8 +7,8 @@
* (Simple) Calendar is now replaced by Simple Calendar Pro. While the app is still Open Source, code available on github and free on F-Droid, the Play Store release is now paid ([see this post by the developer](https://medium.com/@tibbi/some-simple-mobile-tools-apps-are-becoming-paid-d053268f0fb2)), thus the change. NanoDroid-wise the transistion is done in-place, but you will have to re-setup the application.
* nanodroid_play setup variable has changed
* old: nanodroid_play=[0|1]
* new: nanodroid_play=([0|1|2|3] [0|1])
* old: nanodroid_play=[0|1] (default: nanodroid_play=1)
* new: nanodroid_play=[0|1|2|3][0|1] (default: nanodroid_play=10)
* 1st element
* 0 = no App Store
* 1 = Play Store
@ -20,8 +20,8 @@
* your existing .nanodroid-setup file will be migrated
* nanodroid_nlpbackend setup variable has changed
* old: nanodroid_nlpbackend=[0|1|2|3]
* new: nanodroid_nlpbackend=([0|1] [0|1] [0|1])
* old: nanodroid_nlpbackend=[0|1|2|3] (default: nanodroid_nlpbackend=1)
* new: nanodroid_nlpbackend=[0|1][0|1][0|1] (default: nanodroid_nlpbackend=100)
* 1st element = whether to install Déjà Vu location backend
* 2nd element = whether to install Ichnaea (Mozilla) location backend
* 3rd element = whether to install Apple location backend

View File

@ -690,17 +690,17 @@ install_microg () {
NLPBACKEND="nlpBackendNominatim"
NLPSTRING="Nominatim"
if [ "${nanodroid_nlpbackend[0]}" -eq 1 ]; then
if [ "${nanodroid_nlpbackend:0:1}" -eq 1 ]; then
NLPBACKEND="${NLPBACKEND} nlpBackendDejavu"
NLPSTRING="${NLPSTRING}, Déjà Vu"
fi
if [ "${nanodroid_nlpbackend[1]}" -eq 1 ]; then
if [ "${nanodroid_nlpbackend:1:1}" -eq 1 ]; then
NLPBACKEND="${NLPBACKEND} nlpBackendIchnaea"
NLPSTRING="${NLPSTRING}, Ichnaea"
fi
if [ "${nanodroid_nlpbackend[2]}" -eq 1 ]; then
if [ "${nanodroid_nlpbackend:2:1}" -eq 1 ]; then
NLPBACKEND="${NLPBACKEND} nlpBackendApple"
NLPSTRING="${NLPSTRING}, Apple"
fi
@ -812,8 +812,8 @@ install_apps () {
install_store () {
STORE_APPNAME=""
STORE_CHOICE=${nanodroid_play[0]}
FAKE_STORE=${nanodroid_play[1]}
STORE_CHOICE=${nanodroid_play:0:1}
FAKE_STORE=${nanodroid_play:1:1}
[ "${FAKE_STORE}" -eq 1 ] && STORE_CONFLICT="Phonesky" || STORE_CONFLICT=""
@ -1350,18 +1350,17 @@ check_cfg_setup () {
[ -z "${nanodroid_gmscore}" ] && set_prop nanodroid_gmscore 0
[ -z "${nanodroid_apps}" ] && set_prop nanodroid_apps 1
[ -z "${nanodroid_play}" ] && set_prop nanodroid_play "(1 0)"
[ -z "${nanodroid_play}" ] && set_prop nanodroid_play 10
# in NanoDroid <= 20.2 nanodroid_play is an integer
# starting with 20.3 it's an array, migrate the value
if [ "${#nanodroid_play[@]}" -eq 1 ]; then
# in NanoDroid <= 20.2 nanodroid_play has changed
if [ "${#nanodroid_play}" -lt 2 ]; then
case "${nanodroid_play}" in
0 ) tmp_prop="(0 0)" ;;
1 ) tmp_prop="(1 0)" ;;
2 ) tmp_prop="(2 0)" ;;
3 ) tmp_prop="(0 1)" ;;
4 ) tmp_prop="(2 1)" ;;
* ) tmp_prop="(1 0)" ;;
0 ) tmp_prop="00" ;;
1 ) tmp_prop="10" ;;
2 ) tmp_prop="20" ;;
3 ) tmp_prop="01" ;;
4 ) tmp_prop="21" ;;
* ) tmp_prop="10" ;;
esac
sed -e '/^nanodroid_play/d' -i "${cfg_setup}"
@ -1380,17 +1379,16 @@ check_cfg_setup () {
[ -z "${nanodroid_forcesystem}" ] && set_prop nanodroid_forcesystem 0
[ -z "${nanodroid_swipe}" ] && set_prop nanodroid_swipe 0
[ -z "${nanodroid_nlpbackend}" ] && set_prop nanodroid_nlpbackend "(1 0 0)"
[ -z "${nanodroid_nlpbackend}" ] && set_prop nanodroid_nlpbackend 100
# in NanoDroid <= 20.2 nanodroid_nlpbackend is an integer
# starting with 20.3 it's an array, migrate the value
if [ "${#nanodroid_nlpbackend[@]}" -eq 1 ]; then
# in NanoDroid <= 20.2 nanodroid_nlpbackend has changed
if [ "${#nanodroid_nlpbackend}" -eq 1 ]; then
case "${nanodroid_nlpbackend}" in
0 ) tmp_prop="(0 0 0)" ;;
1 ) tmp_prop="(1 0 0)" ;;
2 ) tmp_prop="(0 1 0)" ;;
3 ) tmp_prop="(1 1 0)" ;;
* ) tmp_prop="(1 0 0)" ;;
0 ) tmp_prop="000" ;;
1 ) tmp_prop="100" ;;
2 ) tmp_prop="010" ;;
3 ) tmp_prop="001" ;;
* ) tmp_prop="100" ;;
esac
sed -e '/^nanodroid_nlpbackend/d' -i "${cfg_setup}"

View File

@ -2,7 +2,7 @@ nanodroid_microg=1
nanodroid_gmscore=0
nanodroid_fdroid=1
nanodroid_apps=1
nanodroid_play=(1 0)
nanodroid_play=10
nanodroid_overlay=1
nanodroid_zelda=1
nanodroid_mapsv1=1
@ -10,7 +10,7 @@ nanodroid_init=1
nanodroid_gsync=0
nanodroid_swipe=0
nanodroid_forcesystem=0
nanodroid_nlpbackend=(1 0 0)
nanodroid_nlpbackend=100
nanodroid_nano=1
nanodroid_bash=1
nanodroid_utils=1

View File

@ -20,7 +20,7 @@ nanodroid_microg=1
nanodroid_gmscore=0
nanodroid_fdroid=1
nanodroid_apps=1
nanodroid_play=(1 0)
nanodroid_play=10
nanodroid_overlay=1
nanodroid_zelda=1
nanodroid_mapsv1=1
@ -28,7 +28,7 @@ nanodroid_init=1
nanodroid_gsync=0
nanodroid_swipe=0
nanodroid_forcesystem=0
nanodroid_nlpbackend=(1 0 0)
nanodroid_nlpbackend=100
nanodroid_bash=1
nanodroid_nano=1
nanodroid_utils=1
@ -93,7 +93,7 @@ whether to override an already existing app.
`0` means that a ROM app is preferred against a NanoDroid app, where `1` means the NanoDroid app is prefered. This applies to included applications [> Details](doc/Applications.md)
`nanodroid_play=([0|1|2|3] [0|1])`
`nanodroid_play=[0|1|2|3][0|1]`
what app store to use:
* 1st item
@ -133,7 +133,7 @@ whether to provide Swipe libraries
whether to force system mode installation, regardless whether Magisk is installed
`nanodroid_nlpbackend=([0|1] [0|1] [0|1])`
`nanodroid_nlpbackend=[0|1][0|1][0|1]`
what location backends for microG to install
* 1st element 0|1 = Déjà Vu location backend