Skip to content

Commit 584f7e9

Browse files
committed
apply debug setting (actually??)
1 parent 820a8e3 commit 584f7e9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/src/main/java/com/nin0dev/vendroid/MainActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,12 @@ class MainActivity : Activity() {
135135
val editor = sPrefs.edit()
136136

137137
// https://developer.chrome.com/docs/devtools/remote-debugging/webviews/
138-
WebView.setWebContentsDebuggingEnabled(BuildConfig.DEBUG)
138+
WebView.setWebContentsDebuggingEnabled(
139+
BuildConfig.DEBUG || sPrefs.getBoolean(
140+
"allowRemoteDebugging",
141+
false
142+
)
143+
)
139144
setContentView(R.layout.activity_main)
140145

141146
findViewById<GifImageView>(
@@ -163,7 +168,7 @@ class MainActivity : Activity() {
163168
wv?.addJavascriptInterface(VencordNative(this, wv!!), "VencordMobileNative")
164169
try {
165170
fetchVencord(this)
166-
} catch (ex: IOException) {
171+
} catch (_: IOException) {
167172

168173
}
169174
} else {

app/src/main/java/com/nin0dev/vendroid/webview/HttpClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object HttpClient {
2525
val sPrefs = activity.getSharedPreferences("settings", Context.MODE_PRIVATE)
2626
val e = sPrefs.edit()
2727
val bundleURLToUse = if(sPrefs.getString("clientMod", "vencord") == "equicord") Constants.EQUICORD_BUNDLE_URL else Constants.JS_BUNDLE_URL
28-
var vendroidFile = File(activity.filesDir, "vencord.js")
28+
val vendroidFile = File(activity.filesDir, "vencord.js")
2929
val res = activity.resources
3030
res.openRawResource(R.raw.vencord_mobile).use { `is` -> VencordMobileRuntime = readAsText(`is`) }
3131
if (VencordRuntime != null) return

0 commit comments

Comments
 (0)