mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-07 12:22:08 +00:00
Deprecate path /sbin/.core, switch to /sbin/.magisk
Symlink is preserved for backwards compatibility
This commit is contained in:
@@ -27,7 +27,7 @@ public class Const {
|
||||
MAGISK_PATH = MAGISK_DISABLE_FILE = MAGISK_HOST_FILE = new File("xxx");
|
||||
}
|
||||
|
||||
public static final String BUSYBOX_PATH = "/sbin/.core/busybox";
|
||||
public static final String BUSYBOX_PATH = "/sbin/.magisk/busybox";
|
||||
public static final String TMP_FOLDER_PATH = "/dev/tmp";
|
||||
public static final String MAGISK_LOG = "/cache/magisk.log";
|
||||
public static final String MANAGER_CONFIGS = ".tmp.magisk.config";
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MagiskDB {
|
||||
static final String SETTINGS_TABLE = "settings";
|
||||
static final String STRINGS_TABLE = "strings";
|
||||
static final File LEGACY_MANAGER_DB =
|
||||
new File(Utils.fmt("/sbin/.core/db-%d/magisk.db", Const.USER_ID));
|
||||
new File(Utils.fmt("/sbin/.magisk/db-%d/magisk.db", Const.USER_ID));
|
||||
|
||||
@NonNull
|
||||
public static MagiskDB getInstance() {
|
||||
|
||||
@@ -29,12 +29,15 @@ public class RootUtils extends Shell.Initializer {
|
||||
public boolean onInit(Context context, @NonNull Shell shell) {
|
||||
Shell.Job job = shell.newJob();
|
||||
if (shell.isRoot()) {
|
||||
if (!new SuFile("/sbin/.magisk").exists())
|
||||
job.add("ln -s /sbin/.core /sbin/.magisk");
|
||||
|
||||
InputStream magiskUtils = context.getResources().openRawResource(R.raw.util_functions);
|
||||
InputStream managerUtils = context.getResources().openRawResource(R.raw.utils);
|
||||
job.add(magiskUtils).add(managerUtils);
|
||||
|
||||
Const.MAGISK_DISABLE_FILE = new SuFile("/cache/.disable_magisk");
|
||||
SuFile file = new SuFile("/sbin/.core/img");
|
||||
SuFile file = new SuFile("/sbin/.magisk/img");
|
||||
if (file.exists()) {
|
||||
Const.MAGISK_PATH = file;
|
||||
} else if ((file = new SuFile("/dev/magisk/img")).exists()) {
|
||||
|
||||
@@ -6,7 +6,7 @@ db_sepatch() {
|
||||
|
||||
db_clean() {
|
||||
local USERID=$1
|
||||
local DIR="/sbin/.core/db-${USERID}"
|
||||
local DIR="/sbin/.magisk/db-${USERID}"
|
||||
umount -l /data/user*/*/*/databases/su.db $DIR $DIR/*
|
||||
rm -rf $DIR
|
||||
[ "$USERID" = "*" ] && rm -fv /data/adb/magisk.db*
|
||||
@@ -26,7 +26,7 @@ db_restore() {
|
||||
db_setup() {
|
||||
local USER=$1
|
||||
local USERID=$(($USER / 100000))
|
||||
local DIR=/sbin/.core/db-${USERID}
|
||||
local DIR=/sbin/.magisk/db-${USERID}
|
||||
mkdir -p $DIR
|
||||
touch $DIR/magisk.db
|
||||
mount -o bind /data/adb/magisk.db $DIR/magisk.db
|
||||
@@ -49,8 +49,8 @@ fix_env() {
|
||||
sh update-binary extract
|
||||
rm -f update-binary magisk.apk
|
||||
cd /
|
||||
rm -rf /sbin/.core/busybox/*
|
||||
/sbin/.core/mirror/bin/busybox --install -s /sbin/.core/busybox
|
||||
rm -rf /sbin/.magisk/busybox/*
|
||||
/sbin/.magisk/mirror/bin/busybox --install -s /sbin/.magisk/busybox
|
||||
}
|
||||
|
||||
direct_install() {
|
||||
|
||||
Reference in New Issue
Block a user