Update org.fox.ttrss, new and better patch
This commit is contained in:
parent
aaae53fcd2
commit
defb750f10
|
@ -13,7 +13,8 @@ read the feeds. Don't forget to enable API access in your tt-rss account
|
|||
preferences (Preferences -> Advanced -> Enable external API).
|
||||
|
||||
The source code for 1.10+ allows the app to be used only for a trial period,
|
||||
after which a key must be purchased. This limitation is removed in this build.
|
||||
after which a key must be purchased. This anti-feature has been patched out in
|
||||
our builds.
|
||||
.
|
||||
|
||||
Repo Type:git
|
||||
|
@ -56,6 +57,13 @@ ActionBarSherlock@4.3.0;ViewPagerIndicator@2.4.1,prebuild=sed -i -e \
|
|||
's@1=.*@1=$$ViewPagerIndicator$$@' -e 's@2=.*@2=$$ActionBarSherlock$$@' project.properties && \
|
||||
cp libs/android-support-v4.jar $$ActionBarSherlock$$/libs && \
|
||||
cp libs/android-support-v4.jar $$ViewPagerIndicator$$/libs
|
||||
Build Version:1.8.1,181,068bc6bb81011364fc605d,patch=notrial_new.patch,srclibs=\
|
||||
ActionBarSherlock@4.3.1;ViewPagerIndicator@2.4.1;SlidingMenu@8fcae2cce29e,prebuild=\
|
||||
sed -i -e 's@1=.*@1=$$ViewPagerIndicator$$@' -e 's@2=.*@2=$$ActionBarSherlock$$@' \
|
||||
-e 's@3=.*@3=$$SlidingMenu$$@' project.properties && \
|
||||
cp libs/android-support-v4.jar $$ActionBarSherlock$$/libs && \
|
||||
cp libs/android-support-v4.jar $$ViewPagerIndicator$$/libs && \
|
||||
cp libs/android-support-v4.jar $$SlidingMenu$$/libs
|
||||
|
||||
Auto Update Mode:None
|
||||
Update Check Mode:Market
|
||||
|
|
157
metadata/org.fox.ttrss/notrial_new.patch
Normal file
157
metadata/org.fox.ttrss/notrial_new.patch
Normal file
|
@ -0,0 +1,157 @@
|
|||
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;
|
||||
}
|
||||
|
Loading…
Reference in a new issue