Skip to content

Commit

Permalink
fix install
Browse files Browse the repository at this point in the history
Signed-off-by: androidacy-user <opensource@androidacy.com>
  • Loading branch information
androidacy-user committed Dec 10, 2023
1 parent 4bb2fbd commit af7f3e6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class AndroidacyActivity : AppCompatActivity() {
if (url == null) return false
for (prefix in arrayOf(
"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
if (url.startsWith(prefix)) {
return true
Expand Down Expand Up @@ -513,4 +513,4 @@ class AndroidacyActivity : AppCompatActivity() {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,13 @@ class InstallerActivity : AppCompatActivity() {
)
val installerMonitor: InstallerMonitor
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
val installScript = extractInstallScript("module_installer_test.sh")
if (installScript == null) {
Expand Down Expand Up @@ -365,7 +372,7 @@ class InstallerActivity : AppCompatActivity() {
}
installerMonitor = InstallerMonitor(installScript)
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_USER_LANGUAGE=" + this.resources.configuration.locales[0].toLanguageTag(),
"export MMM_APP_VERSION=" + BuildConfig.VERSION_NAME,
Expand All @@ -382,12 +389,10 @@ class InstallerActivity : AppCompatActivity() {
var magiskModule = false
var installZipMagiskModule = false
var mmtReborn = false
val mgskPath = InstallerInitializer.peekMagiskPath()
if (mgskPath == null) {
setInstallStateFinished(false, "! Unable to resolve magisk path", "")
return
}
val ashExec = "$mgskPath/.magisk/busybox/busybox ash"
try {
ZipFile(file).use { zipFile ->
// Check if module is AnyKernel module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class InstallerInitializer {
* For read/write only "/data/adb/modules" should be used
*/
fun peekModulesPath(): String? {
return if (mgskPth == null) null else "$mgskPth/.magisk/modules"
return if (mgskPth == null) null else "/data/adb/modules"
}

fun peekMagiskVersion(): Int {
Expand Down Expand Up @@ -172,7 +172,7 @@ class InstallerInitializer {
}
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) {
Timber.i("Magisk path: %s", mgskPth)
}
Expand Down

0 comments on commit af7f3e6

Please sign in to comment.