-
-
Notifications
You must be signed in to change notification settings - Fork 23
fix: Use Magisk mirror only when it is really possible #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from 3 commits
e3de95d
9093262
f25b2c1
89dada7
0820352
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,11 +54,13 @@ internal object Constants { | |
|
||
chcon u:object_r:apk_data_file:s0 ${'$'}base_path | ||
|
||
# Use Magisk mirror, if possible. | ||
if command -v magisk &> /dev/null; then | ||
MIRROR="${'$'}(magisk --path)/.magisk/mirror" | ||
# Mount using Magisk mirror, if available. | ||
MAGISKTMP="$( magisk --path )" || MAGISKTMP=/sbin | ||
MIRROR="${'$'}MAGISKTMP/.magisk/mirror" | ||
if [ -z "$(ls -A "${'$'}MIRROR" 2>/dev/null)" ]; then | ||
MIRROR="" | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no reason to first set MIRROR and then unset it again. Invert the if condition and only set the variable then. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inverting the if check means we would have to write the path twice then this would change MIRROR="${'$'}MAGISKTMP/.magisk/mirror"
if [ -z "$(ls -A "${'$'}MIRROR" 2>/dev/null)" ]; then
MIRROR=""
fi to if [ -n "$(ls -A "${'$'}MAGISKTMP/.magisk/mirror" 2>/dev/null)" ]; then
MIRROR="${'$'}MAGISKTMP/.magisk/mirror"
fi as we need to check if the I think the how it is currently is good because it avoids the need to write the path twice, |
||
|
||
energypatrikhu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
mount -o bind ${'$'}MIRROR${'$'}base_path ${'$'}stock_path | ||
|
||
# Kill the app to force it to restart the mounted APK in case it's currently running. | ||
|
Uh oh!
There was an error while loading. Please reload this page.