mirror of https://github.com/M66B/NetGuard.git
No trial if all in-app purchased
This commit is contained in:
parent
31304505d5
commit
cd0659d51b
|
@ -97,8 +97,14 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
long now = new Date().getTime();
|
long now = new Date().getTime();
|
||||||
long trial = IAB.getTrialEnd(this);
|
long trial = IAB.getTrialEnd(this);
|
||||||
if (now < trial) {
|
if (now < trial) {
|
||||||
|
if (!IAB.isPurchased(ActivityPro.SKU_SELECT, false, this) ||
|
||||||
|
!IAB.isPurchased(ActivityPro.SKU_NOTIFY, false, this) ||
|
||||||
|
!IAB.isPurchased(ActivityPro.SKU_THEME, false, this) ||
|
||||||
|
!IAB.isPurchased(ActivityPro.SKU_SPEED, false, this) ||
|
||||||
|
!IAB.isPurchased(ActivityPro.SKU_BACKUP, false, this)) {
|
||||||
DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||||
Toast.makeText(this, getString(R.string.title_pro_trial_until, df.format(trial)), Toast.LENGTH_LONG).show();
|
Toast.makeText(this, getString(R.string.title_pro_trial_until, df.format(trial)), Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
editor.putBoolean("show_user", true);
|
editor.putBoolean("show_user", true);
|
||||||
|
|
|
@ -49,11 +49,11 @@ public class ActivityPro extends AppCompatActivity {
|
||||||
// adb shell pm clear com.android.vending
|
// adb shell pm clear com.android.vending
|
||||||
public static final String SKU_SELECT = "select";
|
public static final String SKU_SELECT = "select";
|
||||||
//public static final String SKU_NOTIFY = "notify";
|
//public static final String SKU_NOTIFY = "notify";
|
||||||
|
public static final String SKU_NOTIFY = "android.test.purchased";
|
||||||
public static final String SKU_THEME = "theme";
|
public static final String SKU_THEME = "theme";
|
||||||
public static final String SKU_SPEED = "speed";
|
public static final String SKU_SPEED = "speed";
|
||||||
public static final String SKU_BACKUP = "backup";
|
public static final String SKU_BACKUP = "backup";
|
||||||
public static final String SKU_DONATION = "donation";
|
public static final String SKU_DONATION = "donation";
|
||||||
public static final String SKU_NOTIFY = "android.test.purchased";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
Loading…
Reference in New Issue