mirror of
https://github.com/M66B/NetGuard.git
synced 2025-01-01 12:54:07 +00:00
Prevent crash
This commit is contained in:
parent
d02de65370
commit
13c33d7f87
1 changed files with 28 additions and 20 deletions
|
@ -173,6 +173,7 @@ public class IAB implements ServiceConnection {
|
|||
}
|
||||
|
||||
public static boolean isPurchased(String sku, Context context) {
|
||||
try {
|
||||
if (Util.isDebuggable(context)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
return !prefs.getBoolean("debug_iab", false);
|
||||
|
@ -185,9 +186,13 @@ public class IAB implements ServiceConnection {
|
|||
return (prefs.getBoolean(sku, false) ||
|
||||
prefs.getBoolean(ActivityPro.SKU_PRO1, false) ||
|
||||
prefs.getBoolean(ActivityPro.SKU_DONATION, false));
|
||||
} catch (SecurityException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isPurchasedAny(Context context) {
|
||||
try {
|
||||
if (Util.isDebuggable(context)) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
return !(prefs.getBoolean("debug_iab", false) || prefs.getBoolean("debug_ads", false));
|
||||
|
@ -198,6 +203,9 @@ public class IAB implements ServiceConnection {
|
|||
if (prefs.getBoolean(key, false))
|
||||
return true;
|
||||
return false;
|
||||
} catch (SecurityException ignored) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getResult(int responseCode) {
|
||||
|
|
Loading…
Reference in a new issue