replace debug log checks

Signed-off-by: androidacy-user <opensource@androidacy.com>
pull/89/head
androidacy-user 2 years ago
parent df0aa1ff17
commit 7fdbac197d

@ -620,7 +620,6 @@ class MainActivity : AppCompatActivity(), OnRefreshListener, OverScrollHelper {
fun commonNext() {
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.d("Common next")
moduleViewListBuilder.addNotification(NotificationType.DEBUG)
}
NotificationType.NO_INTERNET.autoAdd(moduleViewListBuilderOnline)

@ -4,7 +4,6 @@
package com.fox2code.mmm.installer
import com.fox2code.mmm.BuildConfig
import com.fox2code.mmm.Constants
import com.fox2code.mmm.MainApplication
import com.fox2code.mmm.NotificationType
@ -134,8 +133,8 @@ class InstallerInitializer {
"su -V",
).to(output).exec().isSuccess
) {
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i("Failed to search for ramdisk")
if (MainApplication.forceDebugLogging) {
Timber.i("Failed to search for ramdisk")
}
if (output.size != 0) {
hsRmdsk = "false" == output[0] || "true".equals(
@ -145,8 +144,8 @@ class InstallerInitializer {
Companion.hsRmdsk = hsRmdsk
return null
}
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i("Found ramdisk: %s", output[0])
if (MainApplication.forceDebugLogging) {
Timber.i("Found ramdisk: %s", output[0])
if (MainApplication.forceDebugLogging) Timber.i("Searching for Magisk path. Current path: %s", mgskPth)
}
// reset output
@ -156,8 +155,8 @@ class InstallerInitializer {
"not found"
)) {
mgskPth = output[0]
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i("Magisk path 1: %s", mgskPth)
if (MainApplication.forceDebugLogging) {
Timber.i("Magisk path 1: %s", mgskPth)
}
} else if (Shell.cmd("if [ -d /data/adb/ksu ]; then echo true; else echo false; fi", "su -V").to(
output
@ -167,8 +166,8 @@ class InstallerInitializer {
val suVer: ArrayList<String> = ArrayList()
Shell.cmd("su -v").to(suVer).exec()
if (suVer.size > 0 && suVer[0].contains("ksu") || suVer[0].contains("Kernelsu", true)) {
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i("Kernelsu detected")
if (MainApplication.forceDebugLogging) {
Timber.i("Kernelsu detected")
}
mgskPth = "/data/adb"
isKsu = true
@ -177,14 +176,12 @@ class InstallerInitializer {
Countly.sharedInstance().crashes().addCrashBreadcrumb("ksu detected")
}
} else {
if (BuildConfig.DEBUG) {
Timber.e("[ANOMALY] Kernelsu not detected but /data/adb/ksu exists")
if (MainApplication.forceDebugLogging) { Timber.e("[ANOMALY] Kernelsu not detected but /data/adb/ksu exists")
}
return null
}
} else {
if (BuildConfig.DEBUG) {
Timber.e("Failed to get Magisk path")
if (MainApplication.forceDebugLogging) { Timber.e("Failed to get Magisk path")
}
return null
}

@ -11,7 +11,6 @@ import android.os.Looper
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.fox2code.mmm.AppUpdateManager
import com.fox2code.mmm.BuildConfig
import com.fox2code.mmm.MainActivity
import com.fox2code.mmm.MainApplication
import com.fox2code.mmm.NotificationType
@ -73,8 +72,8 @@ class ModuleViewListBuilder(private val activity: Activity) {
}
fun appendRemoteModules() {
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i("appendRemoteModules() called")
if (MainApplication.forceDebugLogging) {
Timber.i("appendRemoteModules() called")
}
synchronized(updateLock) {
if (MainApplication.forceDebugLogging) Timber.i("appendRemoteModules() started")

@ -166,8 +166,8 @@ class RuntimeUtils {
// Restarting setup
firstLaunch = false
}
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.i(
if (MainApplication.forceDebugLogging) {
Timber.i(
"First launch: %s, pref value: %s",
firstLaunch,
prefs.getString("last_shown_setup", null)

@ -120,8 +120,8 @@ class ZipFileOpener : AppCompatActivity() {
zip = ZipFile(zipFile)
if (zip.getEntry("module.prop").also { entry = it } == null) {
Timber.e("onCreate: Zip file is not a valid magisk module")
if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.d(
if (MainApplication.forceDebugLogging) {
Timber.d(
"onCreate: Zip file contents: %s",
zip.stream().map { obj: ZipEntry -> obj.name }
.reduce { a: String, b: String -> "$a, $b" }.orElse("empty")

Loading…
Cancel
Save