disable trial stuff on debug builds
This commit is contained in:
parent
42eed3019f
commit
e483893a24
@ -478,61 +478,64 @@ public class OnlineActivity extends CommonActivity {
|
||||
}
|
||||
|
||||
public void checkTrial(boolean notify) {
|
||||
boolean isTrial = getPackageManager().checkSignatures(
|
||||
getPackageName(), "org.fox.ttrss.key") != PackageManager.SIGNATURE_MATCH;
|
||||
if (!BuildConfig.DEBUG) {
|
||||
|
||||
if (isTrial) {
|
||||
long firstStart = m_prefs.getLong("date_firstlaunch_trial", -1);
|
||||
boolean isTrial = getPackageManager().checkSignatures(
|
||||
getPackageName(), "org.fox.ttrss.key") != PackageManager.SIGNATURE_MATCH;
|
||||
|
||||
if (firstStart == -1) {
|
||||
firstStart = System.currentTimeMillis();
|
||||
if (isTrial) {
|
||||
long firstStart = m_prefs.getLong("date_firstlaunch_trial", -1);
|
||||
|
||||
SharedPreferences.Editor editor = m_prefs.edit();
|
||||
editor.putLong("date_firstlaunch_trial", firstStart);
|
||||
editor.commit();
|
||||
}
|
||||
if (firstStart == -1) {
|
||||
firstStart = System.currentTimeMillis();
|
||||
|
||||
if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) {
|
||||
SharedPreferences.Editor editor = m_prefs.edit();
|
||||
editor.putLong("date_firstlaunch_trial", firstStart);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.trial_expired)
|
||||
.setMessage(R.string.trial_expired_message)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.trial_purchase),
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int which) {
|
||||
if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) {
|
||||
|
||||
openUnlockUrl();
|
||||
finish();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.trial_expired)
|
||||
.setMessage(R.string.trial_expired_message)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.trial_purchase),
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int which) {
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel),
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int which) {
|
||||
openUnlockUrl();
|
||||
finish();
|
||||
|
||||
finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel),
|
||||
new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog,
|
||||
int which) {
|
||||
|
||||
}
|
||||
});
|
||||
finish();
|
||||
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
int daysLeft = Math.round((firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000) - System.currentTimeMillis()) / (24 * 60 * 60 * 1000));
|
||||
AlertDialog dialog = builder.create();
|
||||
dialog.show();
|
||||
|
||||
if (notify) {
|
||||
toast(getResources().getQuantityString(R.plurals.trial_mode_prompt, daysLeft, daysLeft));
|
||||
}
|
||||
}
|
||||
} else if (notify) {
|
||||
//toast(R.string.trial_thanks);
|
||||
}
|
||||
} else {
|
||||
int daysLeft = Math.round((firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000) - System.currentTimeMillis()) / (24 * 60 * 60 * 1000));
|
||||
|
||||
if (notify) {
|
||||
toast(getResources().getQuantityString(R.plurals.trial_mode_prompt, daysLeft, daysLeft));
|
||||
}
|
||||
}
|
||||
} else if (notify) {
|
||||
//toast(R.string.trial_thanks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void openUnlockUrl() {
|
||||
|
Loading…
Reference in New Issue
Block a user