aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.idea/misc.xml2
-rw-r--r--.travis.yml22
-rw-r--r--app/build.gradle30
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt9
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt27
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt2
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IAB.kt18
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IABDialogs.kt4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt10
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt2
-rw-r--r--build.gradle25
-rw-r--r--gradle.properties2
16 files changed, 113 insertions, 52 deletions
diff --git a/.gitignore b/.gitignore
index 55f44265..b2405399 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,4 +8,6 @@
/captures
.externalNativeBuild
*.min.css
-.sass-cache/ \ No newline at end of file
+.sass-cache/
+files
+!files/secrets.tar.enc \ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 085136f8..7319f021 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -53,7 +53,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
- <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
diff --git a/.travis.yml b/.travis.yml
index d345c5ef..3e80761f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,16 +11,17 @@ android:
- extra-android-m2repository
- extra-google-m2repository
licenses:
- - '.+'
+- ".+"
before_install:
+- openssl aes-256-cbc -K $encrypted_307b34e4ed15_key -iv $encrypted_307b34e4ed15_iv
+ -in files/secrets.tar.enc -out secrets.tar -d
+- tar xvf secrets.tar
- chmod +x gradlew
- export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
- export JAVA_HOME=$JAVA8_HOME
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
-before_script:
-- echo "apiSecret=$FABRIC_SECRET" > app/fabric.properties
after_success:
- chmod +x ./generate-apk-release.sh
- "./generate-apk-release.sh"
@@ -42,15 +43,18 @@ notifications:
Download>"
sudo: false
before_cache:
- - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
- - $HOME/.android/build-cache
- - $HOME/.m2s
+ - "$HOME/.gradle/caches/"
+ - "$HOME/.gradle/wrapper/"
+ - "$HOME/.android/build-cache"
+ - "$HOME/.m2s"
env:
global:
- secure: Sob0b0PXhJ5uq+quf74Vl/jWaJ0RVGqTcn83p45iQI/OCEvCLyLk4FojDrtEuu1wUrWNYnv4EpX2WcAUO8+93e93Y3XIfSltXOWnXtM6usSMm7/2iiT1nR0Q6L1mC0rFLvkkhnm1mlq1DGOZKB3eI6W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tLLJO0mV7r01veV42YhgbRFUEW0nCKocxsW1eMdBBNkYyM/Ve+cT7/h6hgjiXZw=
diff --git a/app/build.gradle b/app/build.gradle
index b64e5a74..6c4f05bf 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,3 +1,6 @@
+import org.eclipse.jgit.api.Git
+import org.eclipse.jgit.storage.file.FileRepositoryBuilder
+
plugins {
id 'com.gladed.androidgitversion' version '0.3.4'
}
@@ -6,16 +9,24 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
+apply plugin: 'com.github.triplet.play'
android {
compileSdkVersion Integer.parseInt(project.TARGET_SDK)
buildToolsVersion project.BUILD_TOOLS
androidGitVersion {
- codeFormat = 'MMNNPP'
+// baseCode ext.commitCount()
+ codeFormat = 'MMNNPPP'
prefix 'v'
}
+ playAccountConfigs {
+ defaultAccountConfig {
+ jsonFile = file('./files/gplay-keys.json')
+ }
+ }
+
defaultConfig {
applicationId "${project.APP_GROUP}." + project.APP_ID.toLowerCase()
minSdkVersion Integer.parseInt(project.MIN_SDK)
@@ -34,6 +45,17 @@ android {
}
signingConfigs {
+
+ def releaseProps = new Properties()
+ file("../files/play.properties").withInputStream { releaseProps.load(it) }
+
+ release {
+ storeFile file("../files/play.keystore")
+ storePassword releaseProps.getProperty('storePassword')
+ keyAlias releaseProps.getProperty('keyAlias')
+ keyPassword releaseProps.getProperty('keyPassword')
+ }
+
test {
storeFile file("../files/test.keystore")
storePassword "testkey"
@@ -65,6 +87,7 @@ android {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ signingConfig signingConfigs.release
resValue "string", "app_name", "Frost"
resValue "string", "frost_web", "Frost Web"
}
@@ -133,4 +156,9 @@ dependencies {
compile("com.crashlytics.sdk.android:crashlytics:${CRASHLYTICS}@aar") {
transitive = true;
}
+
+}
+
+play {
+ track = 'alpha'
} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
index f2fb9c29..b8d47027 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
@@ -43,7 +43,6 @@ import com.pitchedapps.frost.facebook.FbTab
import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL
import com.pitchedapps.frost.fragments.WebFragment
import com.pitchedapps.frost.utils.*
-import com.pitchedapps.frost.utils.iab.IAB
import com.pitchedapps.frost.utils.iab.validatePro
import com.pitchedapps.frost.views.BadgedIcon
import com.pitchedapps.frost.web.FrostWebViewSearch
@@ -395,6 +394,14 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract {
FbCookie.switchBackUser { }
}
+ override fun onStart() {
+ //validate some pro features
+ if (!Prefs.pro) {
+ if (Prefs.theme == Theme.CUSTOM.ordinal) Prefs.theme = Theme.DEFAULT.ordinal
+ }
+ super.onStart()
+ }
+
override fun onBackPressed() {
if (searchView?.onBackPressed() ?: false) return
if (currentFragment.onBackPressed()) return
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
index bf100895..e67fc949 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/SettingsActivity.kt
@@ -69,7 +69,7 @@ class SettingsActivity : KPrefActivity(), IabBroadcastReceiver.IabBroadcastListe
}
plainText(R.string.restore_purchases) {
- descRes = R.string.restore_purchases
+ descRes = R.string.restore_purchases_desc
iicon = GoogleMaterial.Icon.gmd_refresh
onClick = { _, _, _ -> this@SettingsActivity.restorePurchases(); true }
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
index bd8b58ab..b76925f5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragment.kt
@@ -6,7 +6,7 @@ import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
-import ca.allanwang.kau.utils.withBundle
+import ca.allanwang.kau.utils.withArguments
import com.pitchedapps.frost.MainActivity
import com.pitchedapps.frost.facebook.FbTab
import com.pitchedapps.frost.facebook.FeedSort
@@ -28,19 +28,18 @@ class WebFragment : Fragment() {
private const val ARG_URL_ENUM = "arg_url_enum"
private const val ARG_POSITION = "arg_position"
- operator fun invoke(data: FbTab, position: Int) = WebFragment().withBundle {
- putString(ARG_URL, data.url)
- putInt(ARG_POSITION, position)
- putSerializable(ARG_URL_ENUM, when (data) {
- //If is feed, check if sorting method is specified
- FbTab.FEED -> when (FeedSort(Prefs.feedSort)) {
- FeedSort.DEFAULT -> data
- FeedSort.MOST_RECENT -> FbTab.FEED_MOST_RECENT
- FeedSort.TOP -> FbTab.FEED_TOP_STORIES
- }
- else -> data
- })
- }
+ operator fun invoke(data: FbTab, position: Int) = WebFragment().withArguments(
+ ARG_URL to data.url,
+ ARG_POSITION to position,
+ ARG_URL_ENUM to when (data) {
+ //If is feed, check if sorting method is specified
+ FbTab.FEED -> when (FeedSort(Prefs.feedSort)) {
+ FeedSort.DEFAULT -> data
+ FeedSort.MOST_RECENT -> FbTab.FEED_MOST_RECENT
+ FeedSort.TOP -> FbTab.FEED_TOP_STORIES
+ }
+ else -> data
+ })
}
// val refresh: SwipeRefreshLayout by lazy { frostWebView.refresh }
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
index d25e0939..135e621f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Appearance.kt
@@ -85,7 +85,7 @@ fun SettingsActivity.getAppearancePrefs(): KPrefAdapterBuilder.() -> Unit = {
colorPicker(R.string.header_color, { Prefs.customHeaderColor }, {
Prefs.customHeaderColor = it
- if (Prefs.tintNavBar) frostNavigationBar()
+ frostNavigationBar()
toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L)
reload()
shouldRestartMain()
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index f8060d9d..5f0bdc41 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -89,8 +89,10 @@ object Prefs : KPref() {
/**
* Cache like value to determine if user has or had pro
* In most cases, [com.pitchedapps.frost.utils.iab.IS_FROST_PRO] should be looked at instead
+ * This has been renamed to pro for short, but keep in mind that it only reflects the value
+ * of when it was previously verified
*/
- var previouslyPro: Boolean by kpref("previously_pro", false)
+ var pro: Boolean by kpref("previously_pro", false)
var debugPro: Boolean by kpref("debug_pro", false)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
index 6a99021d..b255c59c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -106,7 +106,7 @@ fun Activity.setFrostTheme(forceTransparent: Boolean = false) {
fun Activity.setFrostColors(toolbar: Toolbar? = null, themeWindow: Boolean = true,
texts: Array<TextView> = arrayOf(), headers: Array<View> = arrayOf(), backgrounds: Array<View> = arrayOf()) {
statusBarColor = Prefs.headerColor.darken(0.1f).withAlpha(255)
- navigationBarColor = Prefs.headerColor
+ if (Prefs.tintNavBar) navigationBarColor = Prefs.headerColor
if (themeWindow) window.setBackgroundDrawable(ColorDrawable(Prefs.bgColor))
toolbar?.setBackgroundColor(Prefs.headerColor)
toolbar?.setTitleTextColor(Prefs.iconColor)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IAB.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IAB.kt
index d511f773..b4f8af64 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IAB.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/iab/IAB.kt
@@ -86,7 +86,7 @@ object IAB {
private const val FROST_PRO = "frost_pro"
val IS_FROST_PRO: Boolean
- get() = (BuildConfig.DEBUG && Prefs.debugPro) || Prefs.previouslyPro
+ get() = (BuildConfig.DEBUG && Prefs.debugPro) || Prefs.pro
private val Context.isFrostPlay: Boolean
get() = isFromGooglePlay || BuildConfig.DEBUG
@@ -99,15 +99,15 @@ fun SettingsActivity.restorePurchases() {
}
//called if inventory is not properly retrieved
val reset = {
- if (Prefs.previouslyPro) {
- Prefs.previouslyPro = false
+ if (Prefs.pro) {
+ Prefs.pro = false
Prefs.theme = Theme.DEFAULT.ordinal
}
finishRestore(restore)
}
getInventory(false, true, reset) {
val proSku = it.getSkuDetails(FROST_PRO)
- Prefs.previouslyPro = proSku != null
+ Prefs.pro = proSku != null
finishRestore(restore)
}
}
@@ -116,7 +116,7 @@ private fun SettingsActivity.finishRestore(snackbar: Snackbar?) {
snackbar?.dismiss()
materialDialogThemed {
title(R.string.purchases_restored)
- content(if (Prefs.previouslyPro) R.string.purchases_restored_with_pro else R.string.purchases_restored_without_pro)
+ content(if (Prefs.pro) R.string.purchases_restored_with_pro else R.string.purchases_restored_without_pro)
positiveText(R.string.reload)
dismissListener { adapter.notifyAdapterDataSetChanged() }
}
@@ -126,10 +126,10 @@ private fun SettingsActivity.finishRestore(snackbar: Snackbar?) {
* If user has pro, check if it's valid and destroy the helper
*/
fun Activity.validatePro() {
- getInventory(Prefs.previouslyPro, true, { if (Prefs.previouslyPro) playStoreNoLongerPro() }) {
+ getInventory(Prefs.pro, true, { if (Prefs.pro) playStoreNoLongerPro() }) {
val proSku = it.getSkuDetails(FROST_PRO)
- if (proSku == null && Prefs.previouslyPro) playStoreNoLongerPro()
- else if (proSku != null && !Prefs.previouslyPro) playStoreFoundPro()
+ if (proSku == null && Prefs.pro) playStoreNoLongerPro()
+ else if (proSku != null && !Prefs.pro) playStoreFoundPro()
}
}
@@ -153,7 +153,7 @@ fun Activity.openPlayProPurchase(code: Int) {
if (!IS_FROST_PRO)
playStoreProNotAvailable()
else openPlayPurchase(FROST_PRO, code) {
- Prefs.previouslyPro = true
+ Prefs.pro = true
}
}
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 54355d3e..58c21be4 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
@@ -30,7 +30,7 @@ private fun Activity.playRestart() {
fun Activity.playStoreNoLongerPro() {
- Prefs.previouslyPro = false
+ Prefs.pro = false
playStoreLog("No Longer Pro")
materialDialogThemed {
title(R.string.uh_oh)
@@ -43,7 +43,7 @@ fun Activity.playStoreNoLongerPro() {
}
fun Activity.playStoreFoundPro() {
- Prefs.previouslyPro = true
+ Prefs.pro = true
L.d("Found pro")
materialDialogThemed {
title(R.string.found_pro)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
index f12212ed..709ab7ac 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt
@@ -2,9 +2,7 @@ package com.pitchedapps.frost.web
import android.content.Context
import android.graphics.Bitmap
-import android.view.KeyEvent
import android.webkit.WebResourceRequest
-import android.webkit.WebResourceResponse
import android.webkit.WebView
import android.webkit.WebViewClient
import com.pitchedapps.frost.LoginActivity
@@ -52,8 +50,8 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : WebViewClient() {
}
view.jsInject(JsActions.LOGIN_CHECK,
CssAssets.ROUND_ICONS.maybe(Prefs.showRoundedIcons),
- CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends),
- CssHider.ADS.maybe(!Prefs.showFacebookAds),
+ CssHider.PEOPLE_YOU_MAY_KNOW.maybe(!Prefs.showSuggestedFriends && Prefs.pro),
+ CssHider.ADS.maybe(!Prefs.showFacebookAds && Prefs.pro),
JsAssets.HEADER_BADGES.maybe(webCore.baseEnum != null))
onPageFinishedActions(url)
}
@@ -67,9 +65,7 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : WebViewClient() {
webCore.jsInject(CssHider.HEADER,
Prefs.themeInjector,
JsAssets.CLICK_A.maybe(webCore.baseEnum != null),
- callback = {
- refreshObservable.onNext(false)
- })
+ callback = { refreshObservable.onNext(false) })
}
open fun handleHtml(html: String) {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt
index b953e092..c2a53837 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt
@@ -44,7 +44,7 @@ class FrostWebViewCore @JvmOverloads constructor(
var baseUrl: String? = null
- var baseEnum: FbTab? = null
+ var baseEnum: FbTab? = null //only viewpager items should pass the base enum
internal var frostWebClient: FrostWebViewClient? = null
init {
diff --git a/build.gradle b/build.gradle
index d2011ba6..f0daea0d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,11 +4,16 @@ buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
+ maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN}"
classpath 'io.fabric.tools:gradle:1.+'
+ classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
+ classpath "gradle.plugin.com.zoltu.gradle.plugin:git-versioning:3.0.3"
+//https://mvnrepository.com/artifact/org.eclipse.jgit/org.eclipse.jgit
+// classpath 'org.eclipse.jgit:org.eclipse.jgit:4.8.0.201706111038-r'
}
}
@@ -32,4 +37,22 @@ task generateChangelogMd() {
}
def changelogMd = new File("$project.rootDir/docs/Changelog.md")
changelogMd.write(sw.toString())
-} \ No newline at end of file
+}
+
+//ext.commitCount = { ->
+// def repo
+// def count = 0
+// try {
+// repo = new FileRepositoryBuilder()
+// .readEnvironment()
+// .findGitDir(project.projectDir)
+// .build()
+// } catch (IllegalArgumentException ignore) {
+// // No repo found
+// return count
+// }
+//
+// def git = Git.wrap(repo)
+// def commits = git.log().call()
+// return commits.size()
+//} \ No newline at end of file
diff --git a/gradle.properties b/gradle.properties
index f0fa5e38..bd2e9955 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,7 +17,7 @@ MIN_SDK=21
TARGET_SDK=26
BUILD_TOOLS=26.0.0
-KAU=f4090285eb
+KAU=b88a8834dc
KOTLIN=1.1.3
MATERIAL_DRAWER=5.9.3
MATERIAL_DRAWER_KT=1.0.4