Update paths

Close #2244
This commit is contained in:
topjohnwu 2020-01-11 12:37:08 +08:00
parent b39f407596
commit 984997e73b
2 changed files with 6 additions and 13 deletions

View File

@ -6,7 +6,7 @@ import java.io.File
object Const { object Const {
// Paths // Paths
const val MAGISK_PATH = "/sbin/.magisk/img" const val MAGISK_PATH = "/sbin/.magisk/modules"
var MAGISK_DISABLE_FILE = File("xxx") var MAGISK_DISABLE_FILE = File("xxx")
const val TMP_FOLDER_PATH = "/dev/tmp" const val TMP_FOLDER_PATH = "/dev/tmp"
const val MAGISK_LOG = "/cache/magisk.log" const val MAGISK_LOG = "/cache/magisk.log"
@ -23,8 +23,8 @@ object Const {
val USER_ID = Process.myUid() / 100000 val USER_ID = Process.myUid() / 100000
object Version { object Version {
const val MIN_VERSION = "v18.0" const val MIN_VERSION = "v19.0"
const val MIN_VERCODE = 18000 const val MIN_VERCODE = 19000
const val CONNECT_MODE = 20100 const val CONNECT_MODE = 20100
const val PROVIDER_CONNECT = 20102 const val PROVIDER_CONNECT = 20102
} }

View File

@ -89,8 +89,8 @@ EOF
add_hosts_module() { add_hosts_module() {
# Do not touch existing hosts module # Do not touch existing hosts module
[ -d /sbin/.magisk/img/hosts ] && return [ -d /sbin/.magisk/modules/hosts ] && return
cd /sbin/.magisk/img cd /sbin/.magisk/modules
mkdir -p hosts/system/etc mkdir -p hosts/system/etc
cat << EOF > hosts/module.prop cat << EOF > hosts/module.prop
id=hosts id=hosts
@ -99,17 +99,10 @@ version=1.0
versionCode=1 versionCode=1
author=Magisk Manager author=Magisk Manager
description=Magisk Manager built-in systemless hosts module description=Magisk Manager built-in systemless hosts module
minMagisk=17000
EOF EOF
if [ -f .core/hosts ]; then cp -f /system/etc/hosts hosts/system/etc/hosts
# Migrate old hosts file to new module
mv -f .core/hosts hosts/system/etc/hosts
else
cp -f /system/etc/hosts hosts/system/etc/hosts
fi
magisk --clone-attr /system/etc/hosts hosts/system/etc/hosts magisk --clone-attr /system/etc/hosts hosts/system/etc/hosts
touch hosts/update touch hosts/update
touch hosts/auto_mount
cd / cd /
} }