Browse Source

Mark third party installs

main
M66B 6 years ago
parent
commit
3943ea1807
2 changed files with 8 additions and 1 deletions
  1. +2
    -1
      app/src/main/java/eu/faircode/email/ActivityBilling.java
  2. +6
    -0
      app/src/main/java/eu/faircode/email/ActivityMain.java

+ 2
- 1
app/src/main/java/eu/faircode/email/ActivityBilling.java View File

@ -200,7 +200,8 @@ abstract class ActivityBilling extends ActivityBase implements PurchasesUpdatedL
if (purchases != null) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor editor = prefs.edit();
editor.remove("pro");
if (prefs.getBoolean("play_store", true))
editor.remove("pro");
for (Purchase purchase : purchases) {
Log.i(Helper.TAG, "IAB SKU=" + purchase.getSku());
if ((BuildConfig.APPLICATION_ID + ".pro").equals(purchase.getSku())) {


+ 6
- 0
app/src/main/java/eu/faircode/email/ActivityMain.java View File

@ -23,6 +23,7 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log;
import java.util.List;
@ -42,6 +43,11 @@ public class ActivityMain extends AppCompatActivity implements FragmentManager.O
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
if (!Helper.isPlayStoreInstall(this)) {
Log.i(Helper.TAG, "Third party install");
prefs.edit().putBoolean("play_store", false).apply();
}
if (prefs.getBoolean("eula", false)) {
DB.getInstance(this).account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
@Override


Loading…
Cancel
Save