mirror of https://github.com/M66B/NetGuard.git
IAB fixes
This commit is contained in:
parent
6d2ed9f4a0
commit
36f5cfc46c
|
@ -376,6 +376,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
|||
if (!"teal".equals(prefs.getString("theme", "teal")))
|
||||
prefs.edit().putString("theme", "teal").apply();
|
||||
}
|
||||
if (!IAB.isPurchased(ActivityPro.SKU_NOTIFY, ActivityMain.this))
|
||||
prefs.edit().putBoolean("install", false).apply();
|
||||
if (!IAB.isPurchased(ActivityPro.SKU_SPEED, ActivityMain.this))
|
||||
prefs.edit().putBoolean("show_stats", false).apply();
|
||||
} catch (Throwable ex) {
|
||||
|
|
|
@ -122,10 +122,12 @@ public class IAB implements ServiceConnection {
|
|||
SharedPreferences prefs = context.getSharedPreferences("IAB", Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = prefs.edit();
|
||||
for (String product : prefs.getAll().keySet())
|
||||
if (!ActivityPro.SKU_DONATION.equals(product))
|
||||
if (!ActivityPro.SKU_DONATION.equals(product)) {
|
||||
Log.i(TAG, "removing SKU=" + product);
|
||||
editor.remove(product);
|
||||
}
|
||||
for (String sku : skus) {
|
||||
Log.i(TAG, "SKU=" + sku);
|
||||
Log.i(TAG, "adding SKU=" + sku);
|
||||
editor.putBoolean(sku, true);
|
||||
}
|
||||
editor.apply();
|
||||
|
|
|
@ -1296,8 +1296,13 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
private void prepareUidIPFilters(String dname) {
|
||||
lock.writeLock().lock();
|
||||
|
||||
if (dname == null)
|
||||
if (dname == null) {
|
||||
mapUidIPFilters.clear();
|
||||
if (!IAB.isPurchased(ActivityPro.SKU_FILTER, ServiceSinkhole.this)) {
|
||||
lock.writeLock().unlock();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Cursor cursor = DatabaseHelper.getInstance(ServiceSinkhole.this).getAccessDns(dname);
|
||||
int colUid = cursor.getColumnIndex("uid");
|
||||
|
|
Loading…
Reference in New Issue