diff --git a/app/build.gradle b/app/build.gradle
index 5596b933..2d1b3b12 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,7 +1,6 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
-apply plugin: 'io.fabric'
apply plugin: 'kotlin-kapt'
android {
@@ -49,12 +48,26 @@ android {
animationsDisabled true
}
}
+
+ flavorDimensions "version"
+ productFlavors {
+ google {
+ dimension "version"
+ }
+
+ foss {
+ dimension "version"
+ }
+ }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':common')
+ googleImplementation project(':proprietary')
+ fossImplementation project(':foss')
+
// AndroidX
implementation "androidx.appcompat:appcompat:$versions.appcompat"
implementation "androidx.preference:preference:$versions.preference"
@@ -65,7 +78,6 @@ dependencies {
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout"
// Google
- implementation "com.google.android.gms:play-services-instantapps:$versions.instantApp"
implementation "com.google.android.material:material:$versions.material"
// Dagger
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
index 72513685..33e109eb 100644
--- a/app/proguard-rules.pro
+++ b/app/proguard-rules.pro
@@ -1,8 +1,5 @@
# Project specific ProGuard rules
-# For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config:
--printmapping mapping.txt
-
# support design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
diff --git a/app/src/main/java/dev/lucasnlm/antimine/instant/InstantAppManager.kt b/app/src/main/java/dev/lucasnlm/antimine/instant/InstantAppManager.kt
index 79bcb344..af5cb4b6 100644
--- a/app/src/main/java/dev/lucasnlm/antimine/instant/InstantAppManager.kt
+++ b/app/src/main/java/dev/lucasnlm/antimine/instant/InstantAppManager.kt
@@ -3,15 +3,15 @@ package dev.lucasnlm.antimine.instant
import android.app.Activity
import android.content.Context
import android.content.Intent
-import com.google.android.gms.instantapps.InstantApps
+import dev.lucasnlm.external.InstantAppWrapper
class InstantAppManager(
private val context: Context
) {
- fun isEnabled(): Boolean = InstantApps.getPackageManagerCompat(context).isInstantApp
+ fun isEnabled(): Boolean = InstantAppWrapper().isEnabled(context)
fun isNotEnabled(): Boolean = isEnabled().not()
fun showInstallPrompt(activity: Activity, intent: Intent?, requestCode: Int, referrer: String?) =
- InstantApps.showInstallPrompt(activity, intent, requestCode, referrer)
+ InstantAppWrapper().showInstallPrompt(activity, intent, requestCode, referrer)
}
diff --git a/app/src/main/java/dev/lucasnlm/antimine/level/viewmodel/EngGameDialogViewModel.kt b/app/src/main/java/dev/lucasnlm/antimine/level/viewmodel/EngGameDialogViewModel.kt
index 95faba3f..c09e1515 100644
--- a/app/src/main/java/dev/lucasnlm/antimine/level/viewmodel/EngGameDialogViewModel.kt
+++ b/app/src/main/java/dev/lucasnlm/antimine/level/viewmodel/EngGameDialogViewModel.kt
@@ -24,16 +24,16 @@ class EngGameDialogViewModel : ViewModel() {
fun randomVictoryEmoji(except: String? = null) = listOf(
"\uD83D\uDE00", "\uD83D\uDE0E", "\uD83D\uDE1D", "\uD83E\uDD73", "\uD83D\uDE06"
- ).safeRandomEmoji()
+ ).safeRandomEmoji(except)
fun randomNeutralEmoji(except: String? = null) = listOf(
"\uD83D\uDE01", "\uD83E\uDD14", "\uD83D\uDE42", "\uD83D\uDE09"
- ).safeRandomEmoji()
+ ).safeRandomEmoji(except)
fun randomGameOverEmoji(except: String? = null) = listOf(
"\uD83D\uDE10", "\uD83D\uDE44", "\uD83D\uDE25", "\uD83D\uDE13", "\uD83D\uDE31",
"\uD83E\uDD2C", "\uD83E\uDD15", "\uD83D\uDE16", "\uD83D\uDCA3", "\uD83D\uDE05"
- ).safeRandomEmoji()
+ ).safeRandomEmoji(except)
fun messageTo(context: Context, rightMines: Int, totalMines: Int, time: Long, isVictory: Boolean): String =
if (totalMines != 0 && time != 0L) {
diff --git a/build.gradle b/build.gradle
index 53864856..0bb2bc97 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,18 +5,10 @@ buildscript {
mavenCentral()
jcenter()
google()
-
- maven {
- url 'https://maven.fabric.io/public'
- name 'Fabric'
- }
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.3'
-
- // noinspection GradleDynamicVersion
- classpath 'io.fabric.tools:gradle:1.+'
+ classpath "com.android.tools.build:gradle:$versions.android"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/common/proguard-rules.pro b/common/proguard-rules.pro
index 72513685..33e109eb 100644
--- a/common/proguard-rules.pro
+++ b/common/proguard-rules.pro
@@ -1,8 +1,5 @@
# Project specific ProGuard rules
-# For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config:
--printmapping mapping.txt
-
# support design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
diff --git a/common/src/main/java/dev/lucasnlm/antimine/core/di/CommonModule.kt b/common/src/main/java/dev/lucasnlm/antimine/core/di/CommonModule.kt
index 0e851055..5d71895a 100644
--- a/common/src/main/java/dev/lucasnlm/antimine/core/di/CommonModule.kt
+++ b/common/src/main/java/dev/lucasnlm/antimine/core/di/CommonModule.kt
@@ -26,7 +26,5 @@ class CommonModule {
@Singleton
@Provides
- fun provideAnalyticsManager(
- application: Application
- ): AnalyticsManager = DebugAnalyticsManager()
+ fun provideAnalyticsManager(): AnalyticsManager = DebugAnalyticsManager()
}
diff --git a/foss/.gitignore b/foss/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/foss/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/foss/build.gradle b/foss/build.gradle
new file mode 100644
index 00000000..608cbf02
--- /dev/null
+++ b/foss/build.gradle
@@ -0,0 +1,26 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion buildVersion.targetSdk
+
+ defaultConfig {
+ minSdkVersion buildVersion.minAppSdk
+ targetSdkVersion buildVersion.targetSdk
+ versionCode buildVersion.versionCode
+ versionName buildVersion.versionName
+ resConfigs 'en', 'cs', 'de', 'es', 'fr', 'pt', 'ru', 'tr', 'vi', 'uk', 'zh'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+}
diff --git a/foss/proguard-rules.pro b/foss/proguard-rules.pro
new file mode 100644
index 00000000..f1b42451
--- /dev/null
+++ b/foss/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/foss/src/main/AndroidManifest.xml b/foss/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..430136db
--- /dev/null
+++ b/foss/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/foss/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt b/foss/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
new file mode 100644
index 00000000..1068a1ee
--- /dev/null
+++ b/foss/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
@@ -0,0 +1,13 @@
+package dev.lucasnlm.external
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+
+@Suppress("UNUSED_PARAMETER")
+class InstantAppWrapper {
+ // FOSS build doesn't support Instant App
+ fun isEnabled(context: Context): Boolean = false
+
+ fun showInstallPrompt(activity: Activity, intent: Intent?, requestCode: Int, referrer: String?) { }
+}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 05ef575b..f3d88b1c 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index ff7698fb..1b16c34a 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,5 @@
-#Sun Dec 01 22:41:52 GMT-03:00 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
diff --git a/gradlew b/gradlew
index 9d82f789..2fe81a7d 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,20 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
+
+#
+# Copyright 2015 the original author or authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
##############################################################################
##
@@ -6,42 +22,6 @@
##
##############################################################################
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
@@ -60,6 +40,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
@@ -85,7 +105,7 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
@@ -105,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
@@ -134,27 +154,30 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
- i=$((i+1))
+ i=`expr $i + 1`
done
case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+APP_ARGS=`save "$@"`
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+exec "$JAVACMD" "$@"
diff --git a/gradlew.bat b/gradlew.bat
index 8a0b282a..24467a14 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -1,90 +1,100 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/proprietary/.gitignore b/proprietary/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/proprietary/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/proprietary/build.gradle b/proprietary/build.gradle
new file mode 100644
index 00000000..4780ee17
--- /dev/null
+++ b/proprietary/build.gradle
@@ -0,0 +1,29 @@
+apply plugin: 'com.android.library'
+apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-android-extensions'
+
+android {
+ compileSdkVersion buildVersion.targetSdk
+
+ defaultConfig {
+ minSdkVersion buildVersion.minAppSdk
+ targetSdkVersion buildVersion.targetSdk
+ versionCode buildVersion.versionCode
+ versionName buildVersion.versionName
+ resConfigs 'en', 'cs', 'de', 'es', 'fr', 'pt', 'ru', 'tr', 'vi', 'uk', 'zh'
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ // Google
+ implementation "com.google.android.gms:play-services-instantapps:$versions.instantApp"
+}
diff --git a/proprietary/proguard-rules.pro b/proprietary/proguard-rules.pro
new file mode 100644
index 00000000..f1b42451
--- /dev/null
+++ b/proprietary/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/proprietary/src/main/AndroidManifest.xml b/proprietary/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..84ebe750
--- /dev/null
+++ b/proprietary/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
+
diff --git a/proprietary/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt b/proprietary/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
new file mode 100644
index 00000000..c5116ca6
--- /dev/null
+++ b/proprietary/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
@@ -0,0 +1,13 @@
+package dev.lucasnlm.external
+
+import android.app.Activity
+import android.content.Context
+import android.content.Intent
+import com.google.android.gms.instantapps.InstantApps
+
+class InstantAppWrapper {
+ fun isEnabled(context: Context): Boolean = InstantApps.getPackageManagerCompat(context).isInstantApp
+
+ fun showInstallPrompt(activity: Activity, intent: Intent?, requestCode: Int, referrer: String?) =
+ InstantApps.showInstallPrompt(activity, intent, requestCode, referrer)
+}
diff --git a/settings.gradle b/settings.gradle
index 7efe4961..3a1b1497 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,3 @@
include ':app', ':wear', ':common'
+include ':proprietary'
+include ':foss'
diff --git a/wear/proguard-rules.pro b/wear/proguard-rules.pro
index 72513685..33e109eb 100644
--- a/wear/proguard-rules.pro
+++ b/wear/proguard-rules.pro
@@ -1,8 +1,5 @@
# Project specific ProGuard rules
-# For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config:
--printmapping mapping.txt
-
# support design
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }