fix install

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/102/head
androidacy-user 2 years ago
parent 4bb2fbd04d
commit af7f3e6a8a

@ -419,7 +419,7 @@ class AndroidacyActivity : AppCompatActivity() {
if (url == null) return false if (url == null) return false
for (prefix in arrayOf( for (prefix in arrayOf(
"https://production-api.androidacy.com/magisk/file/", "https://production-api.androidacy.com/magisk/file/",
"https://staging-api.androidacy.com/magisk/file/" "https://production-api.androidacy.com/downloads/"
)) { // Make both staging and non staging act the same )) { // Make both staging and non staging act the same
if (url.startsWith(prefix)) { if (url.startsWith(prefix)) {
return true return true

@ -338,6 +338,13 @@ class InstallerActivity : AppCompatActivity() {
) )
val installerMonitor: InstallerMonitor val installerMonitor: InstallerMonitor
val installJob: Shell.Job val installJob: Shell.Job
val mgskPath = InstallerInitializer.peekMagiskPath()
val ashExec = if (!InstallerInitializer.isKsu) {
"$mgskPath/magisk/busybox ash"
} else {
"$mgskPath/ksu/busybox ash"
}
if (rootless) { // rootless is only used for debugging if (rootless) { // rootless is only used for debugging
val installScript = extractInstallScript("module_installer_test.sh") val installScript = extractInstallScript("module_installer_test.sh")
if (installScript == null) { if (installScript == null) {
@ -365,7 +372,7 @@ class InstallerActivity : AppCompatActivity() {
} }
installerMonitor = InstallerMonitor(installScript) installerMonitor = InstallerMonitor(installScript)
installJob = Shell.cmd( installJob = Shell.cmd(
"export ASH_STANDALONE=1 exec /data/adb/magisk/busybox ash", "export ASH_STANDALONE=1 exec " + ashExec,
"export MMM_EXT_SUPPORT=1", "export MMM_EXT_SUPPORT=1",
"export MMM_USER_LANGUAGE=" + this.resources.configuration.locales[0].toLanguageTag(), "export MMM_USER_LANGUAGE=" + this.resources.configuration.locales[0].toLanguageTag(),
"export MMM_APP_VERSION=" + BuildConfig.VERSION_NAME, "export MMM_APP_VERSION=" + BuildConfig.VERSION_NAME,
@ -382,12 +389,10 @@ class InstallerActivity : AppCompatActivity() {
var magiskModule = false var magiskModule = false
var installZipMagiskModule = false var installZipMagiskModule = false
var mmtReborn = false var mmtReborn = false
val mgskPath = InstallerInitializer.peekMagiskPath()
if (mgskPath == null) { if (mgskPath == null) {
setInstallStateFinished(false, "! Unable to resolve magisk path", "") setInstallStateFinished(false, "! Unable to resolve magisk path", "")
return return
} }
val ashExec = "$mgskPath/.magisk/busybox/busybox ash"
try { try {
ZipFile(file).use { zipFile -> ZipFile(file).use { zipFile ->
// Check if module is AnyKernel module // Check if module is AnyKernel module

@ -56,7 +56,7 @@ class InstallerInitializer {
* For read/write only "/data/adb/modules" should be used * For read/write only "/data/adb/modules" should be used
*/ */
fun peekModulesPath(): String? { fun peekModulesPath(): String? {
return if (mgskPth == null) null else "$mgskPth/.magisk/modules" return if (mgskPth == null) null else "/data/adb/modules"
} }
fun peekMagiskVersion(): Int { fun peekMagiskVersion(): Int {
@ -172,7 +172,7 @@ class InstallerInitializer {
} }
verCode = 0 verCode = 0
} }
mgskPth = "/data/adb/modules" // hardcoded path. all modern versions of ksu and magisk use this path mgskPth = "/data/adb" // hardcoded path. all modern versions of ksu and magisk use this path
if (MainApplication.forceDebugLogging) { if (MainApplication.forceDebugLogging) {
Timber.i("Magisk path: %s", mgskPth) Timber.i("Magisk path: %s", mgskPth)
} }

Loading…
Cancel
Save