fdroiddata/metadata/org.fox.ttrss/notrial_new.patch

158 lines
4.6 KiB
Diff
Raw Normal View History

diff --git a/res/menu/main_menu.xml b/res/menu/main_menu.xml
index 282da0c..6364c00 100644
--- a/res/menu/main_menu.xml
+++ b/res/menu/main_menu.xml
@@ -138,11 +138,6 @@
android:title="@string/article_set_unread"/>
</group>
-
- <item
- android:id="@+id/donate"
- android:showAsAction=""
- android:title="@string/trial_purchase"/>
</group>
<item
diff --git a/src/org/fox/ttrss/FeedsActivity.java b/src/org/fox/ttrss/FeedsActivity.java
index f1ddcd0..a8c47b4 100644
--- a/src/org/fox/ttrss/FeedsActivity.java
+++ b/src/org/fox/ttrss/FeedsActivity.java
@@ -98,7 +98,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
ft.commit();
AppRater.appLaunched(this);
- checkTrial(true);
} else { // savedInstanceState != null
m_actionbarUpEnabled = savedInstanceState.getBoolean("actionbarUpEnabled");
diff --git a/src/org/fox/ttrss/OnlineActivity.java b/src/org/fox/ttrss/OnlineActivity.java
index 033b119..0361079 100644
--- a/src/org/fox/ttrss/OnlineActivity.java
+++ b/src/org/fox/ttrss/OnlineActivity.java
@@ -63,7 +63,6 @@ import org.jsoup.select.Elements;
public class OnlineActivity extends CommonActivity {
private final String TAG = this.getClass().getSimpleName();
- private final static int TRIAL_DAYS = 8;
protected SharedPreferences m_prefs;
protected Menu m_menu;
@@ -175,7 +174,6 @@ public class OnlineActivity extends CommonActivity {
if (isOffline) {
switchOfflineSuccess();
} else {
- checkTrial(false);
/* if (getIntent().getExtras() != null) {
Intent i = getIntent();
@@ -466,81 +464,6 @@ public class OnlineActivity extends CommonActivity {
finish();
}
- public void checkTrial(boolean notify) {
- boolean isTrial = getPackageManager().checkSignatures(
- getPackageName(), "org.fox.ttrss.key") != PackageManager.SIGNATURE_MATCH;
-
- if (isTrial) {
- long firstStart = m_prefs.getLong("date_firstlaunch_trial", -1);
-
- if (firstStart == -1) {
- firstStart = System.currentTimeMillis();
-
- SharedPreferences.Editor editor = m_prefs.edit();
- editor.putLong("date_firstlaunch_trial", firstStart);
- editor.commit();
- }
-
- if (!notify && System.currentTimeMillis() > firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000)) {
-
- 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) {
-
- openUnlockUrl();
- finish();
-
- }
- })
- .setNegativeButton(getString(R.string.cancel),
- new OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog,
- int which) {
-
- finish();
-
- }
- });
-
- AlertDialog dialog = builder.create();
- dialog.show();
-
- } else {
- long daysLeft = Math.round((firstStart + (TRIAL_DAYS * 24 * 60 * 60 * 1000) - System.currentTimeMillis()) / (24 * 60 * 60 * 1000));
-
- if (notify) {
- toast(getString(R.string.trial_mode_prompt, Long.valueOf(daysLeft)));
- }
- }
- } else if (notify) {
- //toast(R.string.trial_thanks);
- }
- }
-
- private void openUnlockUrl() {
- try {
- Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse("market://details?id=org.fox.ttrss.key"));
- startActivity(intent);
- } catch (ActivityNotFoundException ae) {
- try {
- Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse("https://play.google.com/store/apps/details?id=org.fox.ttrss.key"));
- startActivity(intent);
- } catch (Exception e) {
- e.printStackTrace();
- toast(R.string.error_other_error);
- }
- }
- }
-
@Override
public boolean onContextItemSelected(android.view.MenuItem item) {
/* AdapterContextMenuInfo info = (AdapterContextMenuInfo) item
@@ -694,11 +617,6 @@ public class OnlineActivity extends CommonActivity {
}
}
return true;
- case R.id.donate:
- if (true) {
- openUnlockUrl();
- }
- return true;
case R.id.logout:
logout();
return true;
@@ -1227,14 +1145,6 @@ public class OnlineActivity extends CommonActivity {
List<PackageInfo> pkgs = getPackageManager()
.getInstalledPackages(0);
- for (PackageInfo p : pkgs) {
- if ("org.fox.ttrss.key".equals(p.packageName)) {
- Log.d(TAG, "license apk found");
- menu.findItem(R.id.donate).setVisible(false);
- break;
- }
- }
-
return true;
}