-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mss: treewide: add a solution to hard-coded paths
* A modpath defined by magisk itself will be injected on top of our binary and common scripts * This way we can avoid hard-coding paths and thus, potentional breaking changes to the magisk module structure in the future Signed-off-by: chickendrop89 <[email protected]>
- Loading branch information
1 parent
c31dccb
commit 3db9431
Showing
4 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/system/bin/sh | ||
|
||
# Strip _update from current MODPATH | ||
INJECTED_MODPATH="${MODPATH//_update/}" | ||
|
||
# Insert the variable at the beginning of a file | ||
insert_variable() { | ||
sed -i "1i export MODPATH=$INJECTED_MODPATH" "$1" | ||
} | ||
|
||
insert_variable "$MODPATH/system/bin/magiskswap" # Main binary | ||
insert_variable "$MODPATH/common.sh" # Common functions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters