Skip to content

Commit

Permalink
Update FindEmulator.java
Browse files Browse the repository at this point in the history
Added hasKnownImsi and isOperatorNameAndroid
  • Loading branch information
jacobsoo committed Dec 19, 2013
1 parent a256239 commit 3714aa3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions AntiEmulator/src/diff/strazzere/anti/emulator/FindEmulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,27 @@ public static boolean hasKnownDeviceId(Context context) {
return false;
}

public static boolean hasKnownImsi(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imsi = telephonyManager.getSubscriberId();

for(String known_imsi : known_imsi_ids) {
if(known_imsi.equalsIgnoreCase(imsi)) {
return true;
}
}
return false;
}

public static boolean isOperatorNameAndroid(Context paramContext) {
String szOperatorName = ((TelephonyManager)paramContext.getSystemService("phone")).getNetworkOperatorName();
boolean isAndroid = szOperatorName.toLowerCase().equals("android");
return isAndroid;
}
/*
Can remove this as it's covered under hasKnownDeviceId
public static boolean hasKnownImei(Context context) {
return false;
}
*/
}

0 comments on commit 3714aa3

Please sign in to comment.