Added option to debug ads

This commit is contained in:
M66B 2016-07-25 08:35:28 +02:00
parent 10594c398b
commit 9ae27cb5b9
3 changed files with 13 additions and 2 deletions

View File

@ -28,6 +28,7 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.util.Log;
import com.android.vending.billing.IInAppBillingService;
@ -184,8 +185,10 @@ public class IAB implements ServiceConnection {
}
public static boolean isPurchasedAny(Context context) {
if (Util.isDebuggable(context))
return true;
if (Util.isDebuggable(context)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
return !prefs.getBoolean("debug_ads", false);
}
SharedPreferences prefs = context.getSharedPreferences("IAB", Context.MODE_PRIVATE);
for (String key : prefs.getAll().keySet())

View File

@ -269,6 +269,10 @@
<Preference
android:key="show_resolved"
android:title="@string/setting_show_resolved" />
<CheckBoxPreference
android:defaultValue="false"
android:key="debug_ads"
android:title="Debug advertisements" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -269,6 +269,10 @@
<Preference
android:key="show_resolved"
android:title="@string/setting_show_resolved" />
<eu.faircode.netguard.SwitchPreference
android:defaultValue="false"
android:key="debug_ads"
android:title="Debug advertisements" />
</PreferenceCategory>
</PreferenceScreen>