Add files via upload
This commit is contained in:
parent
9e2fa39ed2
commit
7cfc42ce8c
13 changed files with 52 additions and 69 deletions
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
|
|
@ -62,7 +62,7 @@ object CustomBundleDialog {
|
|||
container.addView(toggleContainer)
|
||||
|
||||
val urlInput = EditText(context).apply {
|
||||
hint = "http://localhost:4040/shiggycord.js"
|
||||
hint = "http://localhost:4040/gooncord.js"
|
||||
setTextColor(colors.onSurface)
|
||||
setHintTextColor(colors.onSurfaceVariant)
|
||||
background = LogBoxUtils.createM3Background(context, colors.surfaceVariant, 12f)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.Toast
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import ShiggyXposed.xposed.Utils.Companion.reloadApp
|
||||
import ShiggyXposed.xposed.Constants
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Utils.Companion.reloadApp
|
||||
import GoonXposed.xposed.Constants
|
||||
import kotlinx.coroutines.*
|
||||
|
||||
object LogBoxActions {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.graphics.Color
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
|
||||
object LogBoxDialogs {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
|
|
@ -14,8 +14,8 @@ import android.content.res.ColorStateList
|
|||
import android.view.animation.DecelerateInterpolator
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import ShiggyXposed.xposed.Utils
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Utils
|
||||
|
||||
object LogBoxMenu {
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ object LogBoxMenu {
|
|||
val container = createMenuContainer(context, colors)
|
||||
|
||||
// Title
|
||||
container.addView(createTitle(context, colors, "ShiggyXposed Recovery", center = true))
|
||||
container.addView(createTitle(context, colors, "GoonXposed Recovery", center = true))
|
||||
|
||||
// Subtitle
|
||||
container.addView(createSubtitle(context, colors, "Select an option to continue"))
|
||||
|
|
@ -782,7 +782,7 @@ object LogBoxMenu {
|
|||
) { LogBoxActions.refetchBundle(context) }
|
||||
|
||||
2 -> showCustomBundleDialog(context)
|
||||
3 -> ShiggyXposed.xposed.Utils.Companion.reloadApp()
|
||||
3 -> Utils.reloadApp()
|
||||
4 -> showConfirmAction(
|
||||
context, "Clear Cache & Reset",
|
||||
"This will clear all cached bundles and reset to default settings."
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import ShiggyXposed.xposed.Module
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Constants
|
||||
import GoonXposed.xposed.Module
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.hook
|
||||
import android.content.Context
|
||||
import de.robv.android.xposed.XC_MethodHook.MethodHookParam
|
||||
import de.robv.android.xposed.XC_MethodReplacement
|
||||
import de.robv.android.xposed.XposedBridge
|
||||
import de.robv.android.xposed.XposedHelpers
|
||||
import de.robv.android.xposed.callbacks.XC_LoadPackage
|
||||
import kotlinx.coroutines.*
|
||||
import java.io.File
|
||||
|
||||
object LogBoxModule : Module() {
|
||||
lateinit var packageParam: XC_LoadPackage.LoadPackageParam
|
||||
|
|
@ -24,7 +28,12 @@ object LogBoxModule : Module() {
|
|||
|
||||
getUseDeveloperSupportMethod.hook {
|
||||
before {
|
||||
result = true
|
||||
// Only enable dev support when the injected bundle is already present. A fresh
|
||||
// install (no bundle yet) must load Discord's own bundle; otherwise React Native
|
||||
// waits for a Metro packager and Discord never opens.
|
||||
result = File(
|
||||
appInfo.dataDir, "${Constants.CACHE_DIR}/${Constants.MAIN_SCRIPT_FILE}"
|
||||
).exists()
|
||||
}
|
||||
}
|
||||
Log.e("Successfully hooked DCDReactNativeHost")
|
||||
|
|
@ -89,21 +98,6 @@ object LogBoxModule : Module() {
|
|||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
val handleReloadJSMethod = clazz.methods.firstOrNull { it.name == "handleReloadJS" }
|
||||
if (handleReloadJSMethod != null) {
|
||||
XposedBridge.hookMethod(handleReloadJSMethod, object : XC_MethodReplacement() {
|
||||
override fun replaceHookedMethod(param: MethodHookParam): Any? {
|
||||
Log.e("handleReloadJS called - reloading app")
|
||||
ShiggyXposed.xposed.Utils.Companion.reloadApp()
|
||||
return null
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Log.e("Failed to hook handleReloadJS: ${e.message}")
|
||||
}
|
||||
|
||||
try {
|
||||
val showDevOptionsDialogMethod = clazz.methods.firstOrNull { it.name == "showDevOptionsDialog" }
|
||||
if (showDevOptionsDialogMethod != null) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.content.Context
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
|
||||
object LogBoxTheme {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.content.Context
|
||||
import android.util.TypedValue
|
||||
|
|
@ -9,8 +9,8 @@ import android.view.View
|
|||
import android.widget.Toast
|
||||
import org.json.JSONObject
|
||||
import java.io.File
|
||||
import ShiggyXposed.xposed.Constants
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Constants
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
|
||||
object LogBoxUtils {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
|
|
@ -19,40 +19,29 @@ object OptionsMenu {
|
|||
container.addView(LogBoxComponents.createM3Button(context, injectionText, colors) {
|
||||
dialog.dismiss()
|
||||
LogBoxActions.toggleBundleInjection(context)
|
||||
GoonXposed.xposed.Utils.Companion.reloadApp()
|
||||
})
|
||||
|
||||
container.addView(LogBoxComponents.createM3Button(context, "Refetch Bundle", colors) {
|
||||
dialog.dismiss()
|
||||
RecoveryMenu::class.java.getDeclaredMethod(
|
||||
"showConfirmAction",
|
||||
Context::class.java,
|
||||
String::class.java,
|
||||
String::class.java,
|
||||
Runnable::class.java
|
||||
).apply { isAccessible = true }.invoke(
|
||||
null,
|
||||
RecoveryMenu.showConfirmAction(
|
||||
context,
|
||||
"Refetch Bundle",
|
||||
"This will download the latest bundle from Github.",
|
||||
Runnable { LogBoxActions.refetchBundle(context) }
|
||||
)
|
||||
"This will download the latest bundle from Github."
|
||||
) {
|
||||
LogBoxActions.refetchBundle(context)
|
||||
}
|
||||
})
|
||||
|
||||
container.addView(LogBoxComponents.createM3Button(context, "Clear Cache & Reset", colors) {
|
||||
dialog.dismiss()
|
||||
RecoveryMenu::class.java.getDeclaredMethod(
|
||||
"showConfirmAction",
|
||||
Context::class.java,
|
||||
String::class.java,
|
||||
String::class.java,
|
||||
Runnable::class.java
|
||||
).apply { isAccessible = true }.invoke(
|
||||
null,
|
||||
RecoveryMenu.showConfirmAction(
|
||||
context,
|
||||
"Clear Cache & Reset",
|
||||
"This will clear all cached bundles and reset to default settings.",
|
||||
Runnable { LogBoxActions.clearCacheAndReset(context) }
|
||||
)
|
||||
"This will clear all cached bundles and reset to default settings."
|
||||
) {
|
||||
LogBoxActions.clearCacheAndReset(context)
|
||||
}
|
||||
})
|
||||
|
||||
container.addView(LogBoxComponents.createM3Button(context, "Back", colors) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package ShiggyXposed.xposed.modules.LogBox
|
||||
package GoonXposed.xposed.modules.LogBox
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.widget.LinearLayout
|
||||
import ShiggyXposed.xposed.Utils.Log
|
||||
import GoonXposed.xposed.Utils.Log
|
||||
|
||||
object RecoveryMenu {
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ object RecoveryMenu {
|
|||
|
||||
val container = LogBoxComponents.createMenuContainer(context, colors)
|
||||
|
||||
container.addView(LogBoxComponents.createTitle(context, colors, "ShiggyXposed Recovery", center = true))
|
||||
container.addView(LogBoxComponents.createTitle(context, colors, "GoonXposed Recovery", center = true))
|
||||
container.addView(LogBoxComponents.createSubtitle(context, colors, "Select an option to continue"))
|
||||
|
||||
val safeModeText = if (LogBoxUtils.isSafeModeEnabled(context)) "Disable Safe Mode" else "Enable Safe Mode"
|
||||
|
|
@ -63,7 +63,7 @@ object RecoveryMenu {
|
|||
}
|
||||
|
||||
2 -> CustomBundleDialog.showCustomBundleDialog(context)
|
||||
3 -> ShiggyXposed.xposed.Utils.Companion.reloadApp()
|
||||
3 -> GoonXposed.xposed.Utils.Companion.reloadApp()
|
||||
4 -> showConfirmAction(
|
||||
context,
|
||||
"Clear Cache & Reset",
|
||||
|
|
@ -76,7 +76,7 @@ object RecoveryMenu {
|
|||
}
|
||||
}
|
||||
|
||||
private fun showConfirmAction(context: Context, title: String, message: String, action: () -> Unit) {
|
||||
fun showConfirmAction(context: Context, title: String, message: String, action: () -> Unit) {
|
||||
val colors = LogBoxTheme.getM3Colors(context)
|
||||
val container = LogBoxComponents.createMenuContainer(context, colors)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue