aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-12 23:12:58 -0700
committerGitHub <noreply@github.com>2017-08-12 23:12:58 -0700
commit41df086ba4436389ff104b73dbd00217703cd38c (patch)
tree2e7ad094f8c71d766b5cf9437d31e84e96719ebf
parent894c1c4d2c7568d26165baf0d9d192bdf3b288ef (diff)
downloadfrost-41df086ba4436389ff104b73dbd00217703cd38c.tar.gz
frost-41df086ba4436389ff104b73dbd00217703cd38c.tar.bz2
frost-41df086ba4436389ff104b73dbd00217703cd38c.zip
Fix/pro crash without play store (#155)v1.4.4
* Update changelog * Check if iab service exists * Add checker before launching play store request * Separate strings
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt9
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt9
-rw-r--r--app/src/main/res/values/strings.xml48
-rw-r--r--app/src/main/res/values/strings_about.xml23
-rw-r--r--app/src/main/res/values/strings_download.xml11
-rw-r--r--app/src/main/res/values/strings_play_store.xml25
-rw-r--r--app/src/main/res/values/strings_web_context.xml13
-rw-r--r--app/src/main/res/xml/frost_changelog.xml21
-rw-r--r--docs/Changelog.md17
-rw-r--r--gradle.properties2
11 files changed, 95 insertions, 84 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
index 304e4182..670e8669 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt
@@ -35,6 +35,7 @@ class AboutActivity : AboutActivityBase(null, {
backgroundColor = Prefs.bgColor.withMinAlpha(200)
cutoutForeground = if (0xff3b5998.toInt().isColorVisibleOn(Prefs.bgColor)) 0xff3b5998.toInt() else Prefs.accentColor
cutoutDrawableRes = R.drawable.frost_f_256
+ faqPageTitleRes = R.string.faq_title
faqXmlRes = R.xml.frost_faq
faqParseNewLine = false
}) {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
index e90fbd65..7f6e8a6d 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABBinder.kt
@@ -98,6 +98,7 @@ abstract class IABBinder : FrostBilling {
= bp?.handleActivityResult(requestCode, resultCode, data) ?: false
override fun purchasePro() {
+ val bp = this.bp
if (bp == null) {
frostAnswers {
logPurchase(PurchaseEvent()
@@ -107,10 +108,12 @@ abstract class IABBinder : FrostBilling {
L.eThrow("IAB null bp on purchase attempt")
return
}
- if (!(bp?.isOneTimePurchaseSupported ?: false))
- activity?.playStorePurchaseUnsupported()
+ val a = activity ?: return
+
+ if (!BillingProcessor.isIabServiceAvailable(a) || !bp.isOneTimePurchaseSupported)
+ a.playStorePurchaseUnsupported()
else
- bp?.purchase(activity, FROST_PRO)
+ bp.purchase(a, FROST_PRO)
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt
index df0f04fd..e997731b 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt
@@ -2,6 +2,7 @@ package com.pitchedapps.frost.utils.iab
import android.app.Activity
import ca.allanwang.kau.utils.restart
+import ca.allanwang.kau.utils.startLink
import ca.allanwang.kau.utils.startPlayStoreLink
import ca.allanwang.kau.utils.string
import com.crashlytics.android.answers.PurchaseEvent
@@ -69,9 +70,11 @@ fun Activity.playStorePurchaseUnsupported() {
materialDialogThemed {
title(R.string.uh_oh)
content(R.string.play_store_unsupported)
- positiveText(R.string.kau_ok)
- neutralText(R.string.kau_play_store)
- onNeutral { _, _ -> startPlayStoreLink(R.string.play_store_package_id) }
+ negativeText(R.string.kau_close)
+ positiveText(R.string.kau_play_store)
+ neutralText(R.string.paypal)
+ onPositive { _, _ -> startPlayStoreLink(R.string.play_store_package_id) }
+ onNeutral { _, _ -> startLink(string(R.string.dev_paypal)) }
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 412d5f34..b4119ece 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,7 +1,11 @@
<resources>
<string name="dev_email" translatable="false">pitchedapps@gmail.com</string>
+ <string name="dev_paypal" translatable="false">https://www.paypal.me/Allanw9</string>
+ <string name="paypal" translatable="false">PayPal</string>
<string name="play_store_package_id" translatable="false">com.pitchedapps.frost</string>
+ <!--Tabs-->
+
<string name="feed">Feed</string>
<string name="most_recent">Most Recent</string>
<string name="top_stories">Top Stories</string>
@@ -23,6 +27,8 @@
<string name="notes">Notes</string>
<string name="on_this_day">On This Day</string>
+ <!--Login-->
+
<string name="loading_account">Getting everything ready…</string>
<string name="welcome">Welcome %s</string>
<string name="select_facebook_account">Select Facebook Account</string>
@@ -38,47 +44,17 @@
<string name="feature_request">Feature Request</string>
<string name="subject">Subject</string>
<string name="share">Share</string>
- <string name="share_link">Share Link</string>
- <string name="debug_link">Debug Link</string>
- <string name="debug_link_subject">Frost for Facebook: Link Debug</string>
- <string name="debug_link_content">Write here. Note that your link may contain private information, but I won\'t be able to see it as the post isn\'t public. The url will still help with debugging though.</string>
- <string name="debug_link_desc">If a link isn\'t loading properly, you can email me so I can help debug it. Clicking okay will open an email request</string>
- <string name="open_link">Open Link</string>
- <string name="copy_link">Copy Link</string>
- <string name="copy_text">Copy Text</string>
- <string name="debug_image_link_subject">Frost for Facebook: Image Link Debug</string>
<string name="web_overlay_swipe_hint">Swipe right to go back to the previous window.</string>
<string name="profile_picture">Profile Picture</string>
- <string name="custom_pro">Custom [Pro]</string>
- <string name="uh_oh">Uh Oh</string>
- <string name="reload">Reload</string>
- <string name="play_store_not_pro">It seems like you are a pro user, but we couldn\'t find your purchasing info. If this error persists, please try clearing the Play Store cache and reinstalling the app.</string>
- <string name="play_store_unsupported">It seems like app version can\'t purchase pro. Please reinstall from the play store if this is a persisting issue.</string>
- <string name="play_store_not_found_pro_query">This is a pro feature, but this app doesn\'t seem to be installed from the Play Store. Please reinstall if this is an issue.</string>
- <string name="play_store_billing_error">Something went wrong. Please try again later.</string>
- <string name="play_thank_you">Thank you!</string>
- <string name="play_purchased_pro">Thank you for your support! Enjoy the pro version.</string>
- <string name="play_already_purchased">Already Purchased</string>
- <string name="play_already_purchased_content">Looks like you\'ve already purchased %s. Enjoy!</string>
- <string name="found_pro">Found Frost Pro!</string>
- <string name="found_pro_desc">Looks like you have frost pro! We\'ll reload the app so you can enjoy the awesome features!</string>
- <string name="restoring_purchases">Restoring purchases…</string>
- <string name="purchases_restored">Purchases Restored</string>
- <string name="purchases_restored_with_pro">Frost Pro has been restored. Enjoy the features!</string>
- <string name="purchases_restored_without_pro">It seems like you don\'t have pro. If this is a persistent issue, contact me and attach your purchase receipt.</string>
-
- <string name="login_id_failed">Login failed; id not found</string>
- <string name="iab_still_in_progress">IAB query is still in progress</string>
<string name="new_message">New Message</string>
<string name="no_text">No text</string>
- <string name="image_download_success">Image downloaded</string>
- <string name="image_download_fail">Image failed to download</string>
- <string name="image_share_failed">Failed to share image</string>
- <string name="downloading_video">Downloading Video</string>
- <string name="downloaded_video">Video Downloaded</string>
- <string name="downloading_file">Downloading File</string>
- <string name="downloaded_file">File Downloaded</string>
+ <!--About-->
+
+ <string name="frost_description">Frost is a fully themable,
+ fully functional alternative to the official Facebook app, made from scratch and proudly open sourced.</string>
+
+ <string name="faq_title">Frost FAQ</string>
</resources>
diff --git a/app/src/main/res/values/strings_about.xml b/app/src/main/res/values/strings_about.xml
deleted file mode 100644
index 68590718..00000000
--- a/app/src/main/res/values/strings_about.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-
- <string name="frost_description">Frost is a fully themable,
- fully functional alternative to the official Facebook app, made from scratch and proudly open sourced.</string>
-
- <string name="faq_title">Frost FAQ</string>
-
- <string name="faq_feature">Can you add feature xxx?</string>
- <string name="faq_feature_desc">I\'m always opened to suggestions,
- and if a feature will enhance your experience, I\'d like to hear it.
- However, please consider taking a look at my
- <a href="https://github.com/AllanWang/Frost-for-Facebook/issues">issue tracker</a></string>
-
- <string name="faq_cannot_scroll_horizontally">I can\'t scroll horizontally in the webviews.</string>
- <string name="faq_cannot_scroll_horizontally_desc">This is known since the viewpager takes priority for horizontal scrolling.
- Frost has addressed this by allowing horizontal web scrolls if you tap and hold before scrolling.</string>
-
- <string name="faq_more_frequent_notifications">Can I get more frequent notifications?</string>
- <string name="faq_more_frequent_notifications_desc">I made the decision to prioritize battery life by using a newer job scheduler for Android.
- This means that your framework picks the best time to fetch the notifications, and the lowest window is 15 minutes.
- This is also why I don\'t require the wakelock permission</string>
-</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/strings_download.xml b/app/src/main/res/values/strings_download.xml
new file mode 100644
index 00000000..383daf56
--- /dev/null
+++ b/app/src/main/res/values/strings_download.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string name="image_download_success">Image downloaded</string>
+ <string name="image_download_fail">Image failed to download</string>
+ <string name="image_share_failed">Failed to share image</string>
+
+ <string name="downloading_video">Downloading Video</string>
+ <string name="downloaded_video">Video Downloaded</string>
+ <string name="downloading_file">Downloading File</string>
+ <string name="downloaded_file">File Downloaded</string>
+</resources> \ No newline at end of file
diff --git a/app/src/main/res/values/strings_play_store.xml b/app/src/main/res/values/strings_play_store.xml
new file mode 100644
index 00000000..8d37ee16
--- /dev/null
+++ b/app/src/main/res/values/strings_play_store.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<resources>
+ <string name="found_pro">Found Frost Pro!</string>
+ <string name="found_pro_desc">Looks like you have frost pro! We\'ll reload the app so you can enjoy the awesome features!</string>
+
+ <string name="play_already_purchased">Already Purchased</string>
+ <string name="play_already_purchased_content">Looks like you\'ve already purchased %s. Enjoy!</string>
+ <string name="play_purchased_pro">Thank you for your support! Enjoy the pro version.</string>
+ <string name="play_store_billing_error">Something went wrong. Please try again later.</string>
+ <string name="play_store_not_found_pro_query">This is a pro feature, but this app doesn\'t seem to be installed from the Play Store. Please reinstall if this is an issue.</string>
+ <string name="play_store_not_pro">It seems like you are a pro user, but we couldn\'t find your purchasing info. If this error persists, please try clearing the Play Store cache and reinstalling the app.</string>
+ <string name="play_store_unsupported">It seems like this app version can\'t purchase pro. Please reinstall from the play store if this is a persistent issue.
+ \nIf you would like to donate without any additional features, you may do so through PayPal.</string>
+ <string name="play_thank_you">Thank you!</string>
+
+ <string name="purchases_restored">Purchases Restored</string>
+ <string name="purchases_restored_with_pro">Frost Pro has been restored. Enjoy the features!</string>
+ <string name="purchases_restored_without_pro">It seems like you don\'t have pro. If this is a persistent issue, contact me and attach your purchase receipt.</string>
+
+ <string name="restoring_purchases">Restoring purchases…</string>
+
+ <string name="custom_pro">Custom [Pro]</string>
+ <string name="uh_oh">Uh Oh</string>
+ <string name="reload">Reload</string>
+</resources>
diff --git a/app/src/main/res/values/strings_web_context.xml b/app/src/main/res/values/strings_web_context.xml
new file mode 100644
index 00000000..3b93a202
--- /dev/null
+++ b/app/src/main/res/values/strings_web_context.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string name="share_link">Share Link</string>
+ <string name="debug_link">Debug Link</string>
+ <string name="debug_link_subject">Frost for Facebook: Link Debug</string>
+ <string name="debug_link_content">Write here. Note that your link may contain private information, but I won\'t be able to see it as the post isn\'t public. The url will still help with debugging though.</string>
+ <string name="debug_link_desc">If a link isn\'t loading properly, you can email me so I can help debug it. Clicking okay will open an email request</string>
+ <string name="open_link">Open Link</string>
+ <string name="copy_link">Copy Link</string>
+ <string name="copy_text">Copy Text</string>
+ <string name="debug_image_link_subject">Frost for Facebook: Image Link Debug</string>
+</resources> \ No newline at end of file
diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml
index 3d349ec3..7bbf1979 100644
--- a/app/src/main/res/xml/frost_changelog.xml
+++ b/app/src/main/res/xml/frost_changelog.xml
@@ -11,23 +11,26 @@
<!--<version title="Beta Updates" />-->
<version title="Beta Updates"/>
- <item text="Fix notification titles" />
- <item text="ALPHA: Add support for downloading videos (hit the download button)" />
- <item text="Deny intents for login so the page loads properly (thank you @Zenexer)" />
- <item text="Reduce injection offset and move injectors to an earlier method" />
- <item text="Add option to disable media loading on metered network" />
- <item text="Fix menu section" />
- <item text="Add more background setters to help transparent themes" />
- <item text="Fixed crash for users with non english characters" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
<item text="" />
- <version title="v1.5.0"/>
+ <version title="v1.4.2"/>
<item text="Experimental: Add notifications for messages; report to me if this drains your battery" />
<item text="Add FAQ in the about section" />
<item text="Add video uploading" />
<item text="Add open link option in context menu" />
<item text="Add geolocation" />
<item text="Update theme" />
+ <item text="Fix notification titles" />
+ <item text="ALPHA: Add support for downloading videos (hit the download button)" />
+ <item text="Deny intents for login so the page loads properly (thank you @Zenexer)" />
+ <item text="Reduce injection offset and move injectors to an earlier method" />
+ <item text="Add option to disable media loading on metered network" />
+ <item text="Fix menu section" />
+ <item text="Add more background setters to help transparent themes" />
<version title="v1.4.1"/>
<item text="Add intro pages" />
diff --git a/docs/Changelog.md b/docs/Changelog.md
index b65e7dca..17fa69d3 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -1,22 +1,21 @@
# Changelog
## Beta Updates
-* Fix notification titles
-* ALPHA: Add support for downloading videos (hit the download button)
-* Deny intents for login so the page loads properly (thank you @Zenexer)
-* Reduce injection offset and move injectors to an earlier method
-* Add option to disable media loading on metered network
-* Fix menu section
-* Add more background setters to help transparent themes
-* Fixed crash for users with non english characters
-## v1.5.0
+## v1.4.2
* Experimental: Add notifications for messages; report to me if this drains your battery
* Add FAQ in the about section
* Add video uploading
* Add open link option in context menu
* Add geolocation
* Update theme
+* Fix notification titles
+* ALPHA: Add support for downloading videos (hit the download button)
+* Deny intents for login so the page loads properly (thank you @Zenexer)
+* Reduce injection offset and move injectors to an earlier method
+* Add option to disable media loading on metered network
+* Fix menu section
+* Add more background setters to help transparent themes
## v1.4.1
* Add intro pages
diff --git a/gradle.properties b/gradle.properties
index 59f1af52..9c9fe04c 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,7 +17,7 @@ MIN_SDK=21
TARGET_SDK=26
BUILD_TOOLS=26.0.1
-KAU=6d9201e
+KAU=4d3d570
KOTLIN=1.1.3-2
CRASHLYTICS=2.6.8