Skip to content

Commit 06abc63

Browse files
committed
android: skip sdp hook check if setup skipped
1 parent 6fcefd7 commit 06abc63

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android/app/src/main/java/me/kavishdevar/librepods/utils/RadareOffsetFinder.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ class RadareOffsetFinder(context: Context) {
115115
}
116116

117117
fun isSdpOffsetAvailable(): Boolean {
118+
val sharedPreferences = ServiceManager.getService()?.applicationContext?.getSharedPreferences("settings", Context.MODE_PRIVATE) // ik not good practice- too lazy
119+
if (sharedPreferences?.getBoolean("skip_setup", false) == true) {
120+
Log.d(TAG, "Setup skipped, returning true for SDP offset.")
121+
return true
122+
}
118123
try {
119124
val process = Runtime.getRuntime().exec(arrayOf("/system/bin/getprop", SDP_OFFSET_PROP))
120125
val reader = BufferedReader(InputStreamReader(process.inputStream))
@@ -462,7 +467,7 @@ class RadareOffsetFinder(context: Context) {
462467
// findAndSaveL2cuProcessCfgReqOffset(libraryPath, envSetup)
463468
// findAndSaveL2cCsmConfigOffset(libraryPath, envSetup)
464469
// findAndSaveL2cuSendPeerInfoReqOffset(libraryPath, envSetup)
465-
470+
466471
// findAndSaveSdpOffset(libraryPath, envSetup) Should not be run by default, only when user asks for it.
467472

468473
} catch (e: Exception) {

0 commit comments

Comments
 (0)