Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
NoName-exe committed Jan 17, 2023
2 parents ad3454d + cb2ee44 commit 37954d5
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 14 deletions.
Empty file modified .github/workflows/build.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/ci.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .gitmodules
100644 → 100755
Empty file.
Empty file modified CONFIG.md
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
14 changes: 12 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ for table_name in $(toml_get_table_names); do
app_args[allow_alpha_version]=$(toml_get "$t" allow-alpha-version) || app_args[allow_alpha_version]=false
app_args[build_mode]=$(toml_get "$t" build-mode) || app_args[build_mode]=apk
app_args[microg_patch]=$(toml_get "$t" microg-patch) || app_args[microg_patch]=""
app_args[uptodown_dlurl]=$(toml_get "$t" uptodown-dlurl) && app_args[uptodown_dlurl]=${app_args[uptodown_dlurl]%/} || app_args[uptodown_dlurl]=""
app_args[uptodown_dlurl]=$(toml_get "$t" uptodown-dlurl) && {
app_args[uptodown_dlurl]=${app_args[uptodown_dlurl]%/}
app_args[uptodown_dlurl]=${app_args[uptodown_dlurl]%download}
app_args[uptodown_dlurl]=${app_args[uptodown_dlurl]%/}
} || app_args[uptodown_dlurl]=""
app_args[apkmirror_dlurl]=$(toml_get "$t" apkmirror-dlurl) && app_args[apkmirror_dlurl]=${app_args[apkmirror_dlurl]%/} || app_args[apkmirror_dlurl]=""

app_args[arch]=$(toml_get "$t" arch) || app_args[arch]="all"
Expand All @@ -58,7 +62,13 @@ for table_name in $(toml_get_table_names); do
elif [ "${app_args[arch]}" = "arm-v7a" ]; then
app_args[apkmirror_regex]='armeabi-v7a</div>[^@]*@\([^"]*\)'
fi
if [ "${app_args[apkmirror_dlurl]:-}" ] && [ "${app_args[apkmirror_regex]:-}" ]; then app_args[dl_from]=apkmirror; else app_args[dl_from]=uptodown; fi
if [ "${app_args[apkmirror_dlurl]:-}" ]; then
app_args[dl_from]=apkmirror
elif [ "${app_args[uptodown_dlurl]:-}" ]; then
app_args[dl_from]=uptodown
else
abort "ERROR: both 'apkmirror_dlurl' and 'uptodown_dlurl' were not set."
fi

app_args[patcher_args]="$(join_args "${excluded_patches}" -e) $(join_args "${included_patches}" -i)"
[ "$merge_integrations" = true ] && app_args[patcher_args]="${app_args[patcher_args]} -m ${RV_INTEGRATIONS_APK}"
Expand Down
Empty file modified config.toml
100644 → 100755
Empty file.
Empty file modified ks.keystore
100644 → 100755
Empty file.
18 changes: 8 additions & 10 deletions scripts/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,26 @@ else
fi
set_perm_recursive $MODPATH/bin 0 0 0755 0777

basepath() {
basepath=$(pm path __PKGNAME | grep base)
echo ${basepath#*:}
}

grep __PKGNAME /proc/self/mountinfo | while read -r line; do
ui_print "- Un-mount"
mountpoint=$(echo "$line" | cut -d' ' -f5)
umount -l "${mountpoint%%\\*}"
done
am force-stop __PKGNAME

BASEPATH=$(basepath)
BASEPATH=$(pm path __PKGNAME | grep base)
BASEPATH=${BASEPATH#*:}
if [ -n "$BASEPATH" ] && cmpr $BASEPATH $MODPATH/__PKGNAME.apk; then
ui_print "- __PKGNAME is up-to-date"
else
ui_print "- Updating __PKGNAME (v__PKGVER)"
set_perm $MODPATH/__PKGNAME.apk 1000 1000 644 u:object_r:apk_data_file:s0
if ! op=$(cmd package install --user 0 -i com.android.vending -r -d $MODPATH/__PKGNAME.apk 2>&1); then
if ! op=$(pm install --user 0 -i com.android.vending -r -d $MODPATH/__PKGNAME.apk 2>&1); then
ui_print "ERROR: APK installation failed!"
abort "$op"
fi
BASEPATH=$(basepath)
BASEPATH=$(pm path __PKGNAME | grep base)
BASEPATH=${BASEPATH#*:}
if [ -z "$BASEPATH" ]; then
abort "ERROR: install __PKGNAME manually and reflash the module"
fi
Expand All @@ -55,9 +52,10 @@ ui_print "- Mounting __PKGNAME"
RVPATH=/data/adb/__PKGNAME_rv.apk
ln -f $MODPATH/base.apk $RVPATH

if ! op=$(mount -o bind $RVPATH $BASEPATH 2>&1); then
if ! op=$(su -Mc mount -o bind $RVPATH $BASEPATH 2>&1); then
ui_print "ERROR: Mount failed!"
abort "$op"
ui_print "$op"
abort "Flash the module in official Magisk Manager app"
fi
am force-stop __PKGNAME
ui_print "- Optimizing __PKGNAME"
Expand Down
2 changes: 1 addition & 1 deletion scripts/service.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [ $BASEPATH ] && [ -d ${BASEPATH%base.apk}lib ]; then
umount -l "${mountpoint%%\\*}"
done
chcon u:object_r:apk_data_file:s0 $RVPATH
mount -o bind $RVPATH $BASEPATH
su -Mc mount -o bind $RVPATH $BASEPATH
am force-stop __PKGNAME
fi
fi
Empty file modified scripts/uninstall.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ get_cmpr() {
dl_if_dne "${MODULE_TEMPLATE_DIR}/bin/arm/cmpr" "https://github.com/j-hc/cmpr/releases/latest/download/cmpr-armeabi-v7a"
}

abort() { echo "abort: $1" && exit 1; }
abort() { echo >&2 "abort: $1" && exit 1; }

set_prebuilts() {
[ -d "$TEMP_DIR" ] || abort "${TEMP_DIR} directory could not be found"
Expand Down

0 comments on commit 37954d5

Please sign in to comment.