From c703dd602b07cb8976a63d4e7ab8b9b7a8f6c308 Mon Sep 17 00:00:00 2001 From: Effortless Date: Fri, 3 Nov 2023 10:52:08 +0530 Subject: [PATCH] adb enabled --- .idea/misc.xml | 1 - .../java/bug/bazzar/profiling/yyydddy.java | 23 ++++++++++ .../java/com/BugBazaar/ui/SplashActivity.java | 13 +++--- .../BugBazaar/utils/AlertDialogManager.java | 43 ++++++++----------- .../main/java/com/bug/hook/AdbEnabled.java | 15 +++++++ .../main/java/com/bug/hook/checkdetect.java | 31 +++++++++++++ 6 files changed, 96 insertions(+), 30 deletions(-) create mode 100644 app/src/main/java/bug/bazzar/profiling/yyydddy.java create mode 100644 app/src/main/java/com/bug/hook/AdbEnabled.java create mode 100644 app/src/main/java/com/bug/hook/checkdetect.java diff --git a/.idea/misc.xml b/.idea/misc.xml index eab6608..0a274d3 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - diff --git a/app/src/main/java/bug/bazzar/profiling/yyydddy.java b/app/src/main/java/bug/bazzar/profiling/yyydddy.java new file mode 100644 index 0000000..57da9ee --- /dev/null +++ b/app/src/main/java/bug/bazzar/profiling/yyydddy.java @@ -0,0 +1,23 @@ +package bug.bazzar.profiling; + +public class yyydddy { + private static final boolean h0068hhhhh = false; + private static final boolean hh0068hhhh = false; + public static final String n006E006E006En006E006E = "adb_enabled"; + private static final boolean n006E006En006E006E006E = false; + private static final String n006E006Enn006E006E = "ADB_ENABLED"; + private static final boolean n006En006E006E006E006E = false; + public static final String n006En006En006E006E = "android_id"; + private static final boolean n006Enn006E006E006E = false; + private static final String n006Ennn006E006E = "ANDROID_ID"; + private static final boolean nn006E006E006E006E006E = false; + public static final String nn006E006En006E006E = "mock_location"; + private static final boolean nn006En006E006E006E = false; + private static final String nn006Enn006E006E = "ALLOW_MOCK_LOCATION"; + private static final boolean nnn006E006E006E006E = false; + private static final String nnn006En006E006E = "DEVELOPMENT_SETTINGS_ENABLED"; + public static final String nnnn006E006E006E = "development_settings_enabled"; + private static final String nnnnn006E006E = "getString"; + + +} diff --git a/app/src/main/java/com/BugBazaar/ui/SplashActivity.java b/app/src/main/java/com/BugBazaar/ui/SplashActivity.java index 3304be2..a4a7065 100644 --- a/app/src/main/java/com/BugBazaar/ui/SplashActivity.java +++ b/app/src/main/java/com/BugBazaar/ui/SplashActivity.java @@ -19,6 +19,7 @@ import com.BugBazaar.R; import com.BugBazaar.ui.detectAppInt.checkroot; import com.BugBazaar.utils.AlertDialogManager; +import com.bug.hook.checkdetect; import com.bug.hook.runtime; import com.darvin.security.DetectMagisk; import com.darvin.security.Native; @@ -78,7 +79,9 @@ public void run() { else if (switch3State) { - alertDialogManager.showRootedDeviceAlert(SplashActivity.this,"WE ARE IN PROGRESS"); + + +// alertDialogManager.showRootedDeviceAlert(SplashActivity.this,"WE ARE IN PROGRESS"); } @@ -135,17 +138,19 @@ public void run() { @Override public void onMagiskNotDetected() { + checkdetect checkdetect = new checkdetect(); + checkdetect.someMethod(SplashActivity.this); + if(checkfrida()){ alertDialogManager.showRootedDeviceAlert(SplashActivity.this,"FRIDA"); } - else { - launchapp(); + } } @@ -156,8 +161,6 @@ private void launchapp() { startActivity(mainIntent); finish(); } - - private boolean checkfrida() { if(runtime.areFridaFilesPresent() || runtime.isFridaDetectedinmounts() || runtime.isFridaServerRunning() || runtime.isFridaDetectedfile()){ diff --git a/app/src/main/java/com/BugBazaar/utils/AlertDialogManager.java b/app/src/main/java/com/BugBazaar/utils/AlertDialogManager.java index 329ffe8..cec75a4 100644 --- a/app/src/main/java/com/BugBazaar/utils/AlertDialogManager.java +++ b/app/src/main/java/com/BugBazaar/utils/AlertDialogManager.java @@ -4,32 +4,27 @@ import android.app.AlertDialog; import android.content.Context; import android.os.Handler; - -import com.BugBazaar.ui.SplashActivity; +import android.os.Looper; public class AlertDialogManager { - - // Constructor to set the Context - - - public void showRootedDeviceAlert(Context context, String message) { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); - alertDialogBuilder.setTitle("This device is rooted."); - alertDialogBuilder.setMessage("Found=>> "+ message +"!Exiting in 3 Seconds."); - alertDialogBuilder.setCancelable(false); - final AlertDialog alertDialog = alertDialogBuilder.create(); - alertDialog.show(); - - // Schedule a task to exit the application after 3 seconds - new Handler().postDelayed(new Runnable() { - @Override - public void run() { - alertDialog.dismiss(); // Dismiss the dialog if it's still visible - ((Activity) context).finish(); - - - } - }, 3000); + public void showRootedDeviceAlert(final Context context, String message) { + if (context instanceof Activity) { + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context); + alertDialogBuilder.setTitle("This device is rooted."); + alertDialogBuilder.setMessage("Found =>> " + message + "! Exiting in 3 Seconds."); + alertDialogBuilder.setCancelable(false); + final AlertDialog alertDialog = alertDialogBuilder.create(); + alertDialog.show(); + + // Schedule a task to exit the application after 3 seconds + new Handler(Looper.getMainLooper()).postDelayed(new Runnable() { + @Override + public void run() { + alertDialog.dismiss(); // Dismiss the dialog if it's still visible + ((Activity) context).finish(); + } + }, 3000); + } } } diff --git a/app/src/main/java/com/bug/hook/AdbEnabled.java b/app/src/main/java/com/bug/hook/AdbEnabled.java new file mode 100644 index 0000000..f2be38f --- /dev/null +++ b/app/src/main/java/com/bug/hook/AdbEnabled.java @@ -0,0 +1,15 @@ +package com.bug.hook; +import bug.bazzar.profiling.yyydddy; +import android.content.Context; +import android.provider.Settings; +import android.util.Log; + +public class AdbEnabled { + public static boolean AdbEnabled1(Context context) { + StringBuilder sb = new StringBuilder(); + sb.append("AdbEnabled: "); + sb.append(Settings.Secure.getInt(context.getContentResolver(), yyydddy.n006E006E006En006E006E, 0) == 1); + Log.i("AdbEnabled", sb.toString()); + return Settings.Global.getInt(context.getContentResolver(), yyydddy.n006E006E006En006E006E, 0) == 1; + } +} diff --git a/app/src/main/java/com/bug/hook/checkdetect.java b/app/src/main/java/com/bug/hook/checkdetect.java new file mode 100644 index 0000000..ac376ce --- /dev/null +++ b/app/src/main/java/com/bug/hook/checkdetect.java @@ -0,0 +1,31 @@ +package com.bug.hook; + +import android.content.Context; +import android.os.Handler; +import android.os.Looper; +import com.BugBazaar.utils.AlertDialogManager; +import com.BugBazaar.ui.SplashActivity; + +public class checkdetect { + + private AlertDialogManager alertDialogManager = new AlertDialogManager(); + + public void someMethod(final Context context) { + + if (AdbEnabled.AdbEnabled1(context)) { + + if (Looper.myLooper() == Looper.getMainLooper()) { + // You are on the UI thread, you can show the dialog directly + alertDialogManager.showRootedDeviceAlert(context, "adb enabled"); + } else { + // You are on a non-UI thread, use a Handler to execute on the UI thread + new Handler(Looper.getMainLooper()).post(new Runnable() { + @Override + public void run() { + alertDialogManager.showRootedDeviceAlert(context, "adb enabled"); + } + }); + } + } + } +}