Skip to content

Commit

Permalink
Merge pull request #47 from banditAmit/amit
Browse files Browse the repository at this point in the history
adb enabled
  • Loading branch information
banditAmit authored Nov 3, 2023
2 parents b2f0973 + c703dd6 commit ae0e4b5
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 30 deletions.
1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions app/src/main/java/bug/bazzar/profiling/yyydddy.java
Original file line number Diff line number Diff line change
@@ -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";


}
13 changes: 8 additions & 5 deletions app/src/main/java/com/BugBazaar/ui/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");


}
Expand Down Expand Up @@ -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();

}

}
Expand All @@ -156,8 +161,6 @@ private void launchapp() {
startActivity(mainIntent);
finish();
}


private boolean checkfrida() {

if(runtime.areFridaFilesPresent() || runtime.isFridaDetectedinmounts() || runtime.isFridaServerRunning() || runtime.isFridaDetectedfile()){
Expand Down
43 changes: 19 additions & 24 deletions app/src/main/java/com/BugBazaar/utils/AlertDialogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
15 changes: 15 additions & 0 deletions app/src/main/java/com/bug/hook/AdbEnabled.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
31 changes: 31 additions & 0 deletions app/src/main/java/com/bug/hook/checkdetect.java
Original file line number Diff line number Diff line change
@@ -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");
}
});
}
}
}
}

0 comments on commit ae0e4b5

Please sign in to comment.