refactor: optimize wallet JWT management, update security checks for debug builds, and improve pricing data parsing
This commit is contained in:
@@ -2,6 +2,7 @@ package com.siro.siro_driver
|
||||
|
||||
import android.app.AlertDialog
|
||||
import android.content.Intent
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.widget.LinearLayout
|
||||
@@ -134,11 +135,17 @@ class MainActivity : FlutterFragmentActivity() {
|
||||
|
||||
// --- بقية كود الحماية الخاص بك ---
|
||||
private fun isDeviceCompromised(): Boolean {
|
||||
val isDebug = (applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
|
||||
if (isDebug) {
|
||||
Log.d("MainActivity", "Debug build: bypassing root check")
|
||||
return false
|
||||
}
|
||||
return try {
|
||||
val isRootedByRootBeer = RootBeer(this).isRooted
|
||||
isRootedByRootBeer
|
||||
} catch (e: Exception) {
|
||||
true
|
||||
} catch (t: Throwable) {
|
||||
Log.e("MainActivity", "RootBeer check failed: ", t)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user