Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/89/head
androidacy-user 2 years ago
parent 5fc8059501
commit 8a9068d416

@ -211,12 +211,8 @@
-keep class com.topjohnwu.superuser.Shell$Result -keep class com.topjohnwu.superuser.Shell$Result
-keep class com.topjohnwu.superuser.Shell -keep class com.topjohnwu.superuser.Shell
# fix for Parameter specified as non-null is null: method com.fox2code.mmm.installer.InstallerInitializer.a, parameter context which extends com.topjohnwu.superuser.Shell$Initializer # keep settings fragments Appearance, Credits, Debug, Info, Privacy, Repo, Security, and Update
# a is actually onInit and the code is in kotlin -keep,allowobfuscation class com.fox2code.mmm.settings.* { *; }
-keepclassmembers class com.fox2code.mmm.installer.InstallerInitializer {
public onInit(android.content.Context, com.topjohnwu.superuser.Shell);
}
# dontwarn # dontwarn
-dontwarn android.os.SystemProperties -dontwarn android.os.SystemProperties
-dontwarn android.view.ThreadedRenderer -dontwarn android.view.ThreadedRenderer

@ -502,10 +502,7 @@ class MainApplication : FoxApplication(), Configuration.Provider {
init { init {
Shell.setDefaultBuilder(Shell.Builder.create() Shell.setDefaultBuilder(Shell.Builder.create()
.setFlags(Shell.FLAG_REDIRECT_STDERR or Shell.FLAG_MOUNT_MASTER).setTimeout(15) .setFlags(Shell.FLAG_REDIRECT_STDERR or Shell.FLAG_MOUNT_MASTER).setTimeout(15))
.setInitializers(
InstallerInitializer::class.java
).also { shellBuilder = it })
val random = Random() val random = Random()
do { do {
secret = random.nextLong() secret = random.nextLong()

@ -380,6 +380,7 @@ class InstallerActivity : FoxActivity() {
} }
installerMonitor = InstallerMonitor(installScript) installerMonitor = InstallerMonitor(installScript)
installJob = Shell.cmd( installJob = Shell.cmd(
"export ASH_STANDALONE=1",
"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,

@ -4,7 +4,6 @@
package com.fox2code.mmm.installer package com.fox2code.mmm.installer
import android.content.Context
import com.fox2code.mmm.Constants import com.fox2code.mmm.Constants
import com.fox2code.mmm.MainApplication import com.fox2code.mmm.MainApplication
import com.fox2code.mmm.NotificationType import com.fox2code.mmm.NotificationType
@ -15,17 +14,12 @@ import timber.log.Timber
import java.io.File import java.io.File
@Suppress("unused") @Suppress("unused")
class InstallerInitializer : Shell.Initializer() { class InstallerInitializer {
interface Callback { interface Callback {
fun onPathReceived(path: String?) fun onPathReceived(path: String?)
fun onFailure(error: Int) fun onFailure(error: Int)
} }
override fun onInit(context: Context, shell: Shell): Boolean {
return if (!shell.isRoot) true else shell.newJob().add("export ASH_STANDALONE=1")
.exec().isSuccess
}
companion object { companion object {
private val MAGISK_SBIN = File("/sbin/magisk") private val MAGISK_SBIN = File("/sbin/magisk")
private val MAGISK_SYSTEM = File("/system/bin/magisk") private val MAGISK_SYSTEM = File("/system/bin/magisk")
@ -160,7 +154,9 @@ class InstallerInitializer : Shell.Initializer() {
Companion.mgskVerCode = mgskVerCode Companion.mgskVerCode = mgskVerCode
return mgskPth return mgskPth
} catch (ignored: Exception) { } catch (ignored: Exception) {
return if (tries <= 10) { // TODO: REMOVE THIS
throw IllegalStateException(ignored)
/*return if (tries <= 10) {
tries++ tries++
// sleep tries * 25ms // sleep tries * 25ms
try { try {
@ -171,7 +167,7 @@ class InstallerInitializer : Shell.Initializer() {
tryGetMagiskPath(true) tryGetMagiskPath(true)
} else { } else {
null null
} }*/
} }
} }
} }

@ -10,7 +10,7 @@
# This option should only be used with decoupled projects. More details, visit # This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true # org.gradle.parallel=true
#Mon Jul 17 21:53:32 EDT 2023 #Tue Jul 18 21:42:11 EDT 2023
android.defaults.buildfeatures.buildconfig=true android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=false android.enableJetifier=false
android.enableR8.fullMode=true android.enableR8.fullMode=true
@ -18,5 +18,5 @@ android.useAndroidX=true
org.gradle.caching=true org.gradle.caching=true
org.gradle.configuration-cache=true org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn org.gradle.configuration-cache.problems=warn
org.gradle.jvmargs=-Xmx1024M -Dorg.gradle.android.cache-fix.ignoreVersionCheck\=true -Dkotlin.daemon.jvm.options\="-Xmx1024M" -Dfile.encoding\=UTF-8 -XX\:+UseParallelGC -XX\:ReservedCodeCacheSize\=768m org.gradle.jvmargs=-Xmx1536M -Dorg.gradle.android.cache-fix.ignoreVersionCheck\=true -Dkotlin.daemon.jvm.options\="-Xmx1536M" -Dfile.encoding\=UTF-8 -XX\:+UseParallelGC -XX\:ReservedCodeCacheSize\=768m
org.gradle.parallel=true org.gradle.parallel=true

Loading…
Cancel
Save