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() { fun commonNext() {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
if (MainApplication.forceDebugLogging) Timber.d("Common next")
moduleViewListBuilder.addNotification(NotificationType.DEBUG) moduleViewListBuilder.addNotification(NotificationType.DEBUG)
} }
NotificationType.NO_INTERNET.autoAdd(moduleViewListBuilderOnline) NotificationType.NO_INTERNET.autoAdd(moduleViewListBuilderOnline)

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

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

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

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

Loading…
Cancel
Save