refactor: optimize wallet JWT management, update security checks for debug builds, and improve pricing data parsing

This commit is contained in:
Hamza-Ayed
2026-06-27 22:50:28 +03:00
parent 43e3f8c939
commit a87cb7c082
7 changed files with 93 additions and 18 deletions

View File

@@ -122,7 +122,7 @@ dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation 'com.scottyab:rootbeer-lib:0.1.0'
implementation 'com.scottyab:rootbeer-lib:0.1.2'
// تمت الترقية لتطابق تطبيق الراكب
implementation 'com.google.android.gms:play-services-safetynet:18.1.0'

View File

@@ -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
}
}