mirror of https://github.com/M66B/FairEmail.git
Mark third party installs
This commit is contained in:
parent
710b72b5e8
commit
3943ea1807
|
@ -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())) {
|
||||
|
|
|
@ -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…
Reference in New Issue