From 41df086ba4436389ff104b73dbd00217703cd38c Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 12 Aug 2017 23:12:58 -0700 Subject: Fix/pro crash without play store (#155) * Update changelog * Check if iab service exists * Add checker before launching play store request * Separate strings --- .../pitchedapps/frost/activities/AboutActivity.kt | 1 + .../com/pitchedapps/frost/utils/iab/IABBinder.kt | 9 ++-- .../com/pitchedapps/frost/utils/iab/IABDialogs.kt | 9 ++-- app/src/main/res/values/strings.xml | 48 ++++++---------------- app/src/main/res/values/strings_about.xml | 23 ----------- app/src/main/res/values/strings_download.xml | 11 +++++ app/src/main/res/values/strings_play_store.xml | 25 +++++++++++ app/src/main/res/values/strings_web_context.xml | 13 ++++++ app/src/main/res/xml/frost_changelog.xml | 21 ++++++---- docs/Changelog.md | 17 ++++---- gradle.properties | 2 +- 11 files changed, 95 insertions(+), 84 deletions(-) delete mode 100644 app/src/main/res/values/strings_about.xml create mode 100644 app/src/main/res/values/strings_download.xml create mode 100644 app/src/main/res/values/strings_play_store.xml create mode 100644 app/src/main/res/values/strings_web_context.xml 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 @@ pitchedapps@gmail.com + https://www.paypal.me/Allanw9 + PayPal com.pitchedapps.frost + + Feed Most Recent Top Stories @@ -23,6 +27,8 @@ Notes On This Day + + Getting everything ready… Welcome %s Select Facebook Account @@ -38,47 +44,17 @@ Feature Request Subject Share - Share Link - Debug Link - Frost for Facebook: Link Debug - 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. - If a link isn\'t loading properly, you can email me so I can help debug it. Clicking okay will open an email request - Open Link - Copy Link - Copy Text - Frost for Facebook: Image Link Debug Swipe right to go back to the previous window. Profile Picture - Custom [Pro] - Uh Oh - Reload - 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. - It seems like app version can\'t purchase pro. Please reinstall from the play store if this is a persisting issue. - 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. - Something went wrong. Please try again later. - Thank you! - Thank you for your support! Enjoy the pro version. - Already Purchased - Looks like you\'ve already purchased %s. Enjoy! - Found Frost Pro! - Looks like you have frost pro! We\'ll reload the app so you can enjoy the awesome features! - Restoring purchases… - Purchases Restored - Frost Pro has been restored. Enjoy the features! - It seems like you don\'t have pro. If this is a persistent issue, contact me and attach your purchase receipt. - - Login failed; id not found - IAB query is still in progress New Message No text - Image downloaded - Image failed to download - Failed to share image - Downloading Video - Video Downloaded - Downloading File - File Downloaded + + + Frost is a fully themable, + fully functional alternative to the official Facebook app, made from scratch and proudly open sourced. + + Frost FAQ 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 @@ - - - - Frost is a fully themable, - fully functional alternative to the official Facebook app, made from scratch and proudly open sourced. - - Frost FAQ - - Can you add feature xxx? - 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 - issue tracker - - I can\'t scroll horizontally in the webviews. - 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. - - Can I get more frequent notifications? - 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 - \ 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 @@ + + + Image downloaded + Image failed to download + Failed to share image + + Downloading Video + Video Downloaded + Downloading File + File Downloaded + \ 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 @@ + + + Found Frost Pro! + Looks like you have frost pro! We\'ll reload the app so you can enjoy the awesome features! + + Already Purchased + Looks like you\'ve already purchased %s. Enjoy! + Thank you for your support! Enjoy the pro version. + Something went wrong. Please try again later. + 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. + 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. + 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. + Thank you! + + Purchases Restored + Frost Pro has been restored. Enjoy the features! + It seems like you don\'t have pro. If this is a persistent issue, contact me and attach your purchase receipt. + + Restoring purchases… + + Custom [Pro] + Uh Oh + Reload + 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 @@ + + + + Share Link + Debug Link + Frost for Facebook: Link Debug + 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. + If a link isn\'t loading properly, you can email me so I can help debug it. Clicking okay will open an email request + Open Link + Copy Link + Copy Text + Frost for Facebook: Image Link Debug + \ 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 @@ - - - - - - - - + + + + - + + + + + + + + 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 -- cgit v1.2.3