Move proprietary code to proprietary lib
This commit is contained in:
parent
a374ba1ed6
commit
7c0c983681
23 changed files with 334 additions and 178 deletions
|
@ -1,7 +1,6 @@
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply plugin: 'kotlin-android-extensions'
|
apply plugin: 'kotlin-android-extensions'
|
||||||
apply plugin: 'io.fabric'
|
|
||||||
apply plugin: 'kotlin-kapt'
|
apply plugin: 'kotlin-kapt'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@ -49,12 +48,26 @@ android {
|
||||||
animationsDisabled true
|
animationsDisabled true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flavorDimensions "version"
|
||||||
|
productFlavors {
|
||||||
|
google {
|
||||||
|
dimension "version"
|
||||||
|
}
|
||||||
|
|
||||||
|
foss {
|
||||||
|
dimension "version"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
implementation project(':common')
|
implementation project(':common')
|
||||||
|
|
||||||
|
googleImplementation project(':proprietary')
|
||||||
|
fossImplementation project(':foss')
|
||||||
|
|
||||||
// AndroidX
|
// AndroidX
|
||||||
implementation "androidx.appcompat:appcompat:$versions.appcompat"
|
implementation "androidx.appcompat:appcompat:$versions.appcompat"
|
||||||
implementation "androidx.preference:preference:$versions.preference"
|
implementation "androidx.preference:preference:$versions.preference"
|
||||||
|
@ -65,7 +78,6 @@ dependencies {
|
||||||
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout"
|
implementation "androidx.constraintlayout:constraintlayout:$versions.constraintlayout"
|
||||||
|
|
||||||
// Google
|
// Google
|
||||||
implementation "com.google.android.gms:play-services-instantapps:$versions.instantApp"
|
|
||||||
implementation "com.google.android.material:material:$versions.material"
|
implementation "com.google.android.material:material:$versions.material"
|
||||||
|
|
||||||
// Dagger
|
// Dagger
|
||||||
|
|
3
app/proguard-rules.pro
vendored
3
app/proguard-rules.pro
vendored
|
@ -1,8 +1,5 @@
|
||||||
# Project specific ProGuard rules
|
# 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
|
# support design
|
||||||
-dontwarn android.support.design.**
|
-dontwarn android.support.design.**
|
||||||
-keep class android.support.design.** { *; }
|
-keep class android.support.design.** { *; }
|
||||||
|
|
|
@ -3,15 +3,15 @@ package dev.lucasnlm.antimine.instant
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import com.google.android.gms.instantapps.InstantApps
|
import dev.lucasnlm.external.InstantAppWrapper
|
||||||
|
|
||||||
class InstantAppManager(
|
class InstantAppManager(
|
||||||
private val context: Context
|
private val context: Context
|
||||||
) {
|
) {
|
||||||
fun isEnabled(): Boolean = InstantApps.getPackageManagerCompat(context).isInstantApp
|
fun isEnabled(): Boolean = InstantAppWrapper().isEnabled(context)
|
||||||
|
|
||||||
fun isNotEnabled(): Boolean = isEnabled().not()
|
fun isNotEnabled(): Boolean = isEnabled().not()
|
||||||
|
|
||||||
fun showInstallPrompt(activity: Activity, intent: Intent?, requestCode: Int, referrer: String?) =
|
fun showInstallPrompt(activity: Activity, intent: Intent?, requestCode: Int, referrer: String?) =
|
||||||
InstantApps.showInstallPrompt(activity, intent, requestCode, referrer)
|
InstantAppWrapper().showInstallPrompt(activity, intent, requestCode, referrer)
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,16 +24,16 @@ class EngGameDialogViewModel : ViewModel() {
|
||||||
|
|
||||||
fun randomVictoryEmoji(except: String? = null) = listOf(
|
fun randomVictoryEmoji(except: String? = null) = listOf(
|
||||||
"\uD83D\uDE00", "\uD83D\uDE0E", "\uD83D\uDE1D", "\uD83E\uDD73", "\uD83D\uDE06"
|
"\uD83D\uDE00", "\uD83D\uDE0E", "\uD83D\uDE1D", "\uD83E\uDD73", "\uD83D\uDE06"
|
||||||
).safeRandomEmoji()
|
).safeRandomEmoji(except)
|
||||||
|
|
||||||
fun randomNeutralEmoji(except: String? = null) = listOf(
|
fun randomNeutralEmoji(except: String? = null) = listOf(
|
||||||
"\uD83D\uDE01", "\uD83E\uDD14", "\uD83D\uDE42", "\uD83D\uDE09"
|
"\uD83D\uDE01", "\uD83E\uDD14", "\uD83D\uDE42", "\uD83D\uDE09"
|
||||||
).safeRandomEmoji()
|
).safeRandomEmoji(except)
|
||||||
|
|
||||||
fun randomGameOverEmoji(except: String? = null) = listOf(
|
fun randomGameOverEmoji(except: String? = null) = listOf(
|
||||||
"\uD83D\uDE10", "\uD83D\uDE44", "\uD83D\uDE25", "\uD83D\uDE13", "\uD83D\uDE31",
|
"\uD83D\uDE10", "\uD83D\uDE44", "\uD83D\uDE25", "\uD83D\uDE13", "\uD83D\uDE31",
|
||||||
"\uD83E\uDD2C", "\uD83E\uDD15", "\uD83D\uDE16", "\uD83D\uDCA3", "\uD83D\uDE05"
|
"\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 =
|
fun messageTo(context: Context, rightMines: Int, totalMines: Int, time: Long, isVictory: Boolean): String =
|
||||||
if (totalMines != 0 && time != 0L) {
|
if (totalMines != 0 && time != 0L) {
|
||||||
|
|
10
build.gradle
10
build.gradle
|
@ -5,18 +5,10 @@ buildscript {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
jcenter()
|
jcenter()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
maven {
|
|
||||||
url 'https://maven.fabric.io/public'
|
|
||||||
name 'Fabric'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
classpath "com.android.tools.build:gradle:$versions.android"
|
||||||
|
|
||||||
// noinspection GradleDynamicVersion
|
|
||||||
classpath 'io.fabric.tools:gradle:1.+'
|
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|
3
common/proguard-rules.pro
vendored
3
common/proguard-rules.pro
vendored
|
@ -1,8 +1,5 @@
|
||||||
# Project specific ProGuard rules
|
# 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
|
# support design
|
||||||
-dontwarn android.support.design.**
|
-dontwarn android.support.design.**
|
||||||
-keep class android.support.design.** { *; }
|
-keep class android.support.design.** { *; }
|
||||||
|
|
|
@ -26,7 +26,5 @@ class CommonModule {
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@Provides
|
@Provides
|
||||||
fun provideAnalyticsManager(
|
fun provideAnalyticsManager(): AnalyticsManager = DebugAnalyticsManager()
|
||||||
application: Application
|
|
||||||
): AnalyticsManager = DebugAnalyticsManager()
|
|
||||||
}
|
}
|
||||||
|
|
1
foss/.gitignore
vendored
Normal file
1
foss/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/build
|
26
foss/build.gradle
Normal file
26
foss/build.gradle
Normal file
|
@ -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'])
|
||||||
|
}
|
21
foss/proguard-rules.pro
vendored
Normal file
21
foss/proguard-rules.pro
vendored
Normal file
|
@ -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
|
2
foss/src/main/AndroidManifest.xml
Normal file
2
foss/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="dev.lucasnlm.foss" />
|
13
foss/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
vendored
Normal file
13
foss/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
vendored
Normal file
|
@ -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?) { }
|
||||||
|
}
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,5 @@
|
||||||
#Sun Dec 01 22:41:52 GMT-03:00 2019
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
|
||||||
|
|
137
gradlew
vendored
137
gradlew
vendored
|
@ -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
|
# Attempt to set APP_HOME
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
PRG="$0"
|
PRG="$0"
|
||||||
|
@ -60,6 +40,46 @@ cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
APP_HOME="`pwd -P`"
|
APP_HOME="`pwd -P`"
|
||||||
cd "$SAVED" >/dev/null
|
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
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
|
@ -85,7 +105,7 @@ location of your Java installation."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# 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`
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
if [ $? -eq 0 ] ; then
|
if [ $? -eq 0 ] ; then
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; 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\""
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For Cygwin, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if $cygwin ; then
|
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
@ -134,27 +154,30 @@ if $cygwin ; then
|
||||||
else
|
else
|
||||||
eval `echo args$i`="\"$arg\""
|
eval `echo args$i`="\"$arg\""
|
||||||
fi
|
fi
|
||||||
i=$((i+1))
|
i=`expr $i + 1`
|
||||||
done
|
done
|
||||||
case $i in
|
case $i in
|
||||||
(0) set -- ;;
|
0) set -- ;;
|
||||||
(1) set -- "$args0" ;;
|
1) set -- "$args0" ;;
|
||||||
(2) set -- "$args0" "$args1" ;;
|
2) set -- "$args0" "$args1" ;;
|
||||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
# Escape application args
|
||||||
function splitJvmOpts() {
|
save () {
|
||||||
JVM_OPTS=("$@")
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
}
|
}
|
||||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
APP_ARGS=`save "$@"`
|
||||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
|
||||||
|
|
||||||
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" "$@"
|
||||||
|
|
190
gradlew.bat
vendored
190
gradlew.bat
vendored
|
@ -1,90 +1,100 @@
|
||||||
@if "%DEBUG%" == "" @echo off
|
@rem
|
||||||
@rem ##########################################################################
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem ##########################################################################
|
@rem You may obtain a copy of the License at
|
||||||
|
@rem
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
@rem
|
||||||
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
set DEFAULT_JVM_OPTS=
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@rem See the License for the specific language governing permissions and
|
||||||
set DIRNAME=%~dp0
|
@rem limitations under the License.
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
@rem
|
||||||
set APP_BASE_NAME=%~n0
|
|
||||||
set APP_HOME=%DIRNAME%
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
@rem Find java.exe
|
@rem
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
set JAVA_EXE=java.exe
|
@rem ##########################################################################
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
echo.
|
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
set DIRNAME=%~dp0
|
||||||
echo.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
set APP_BASE_NAME=%~n0
|
||||||
echo location of your Java installation.
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
goto fail
|
@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"
|
||||||
:findJavaFromJavaHome
|
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
@rem Find java.exe
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
echo.
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo location of your Java installation.
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
goto fail
|
echo location of your Java installation.
|
||||||
|
|
||||||
:init
|
goto fail
|
||||||
@rem Get command-line arguments, handling Windowz variants
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
if "%@eval[2+2]" == "4" goto 4NT_args
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
:win9xME_args
|
if exist "%JAVA_EXE%" goto init
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
echo.
|
||||||
set _SKIP=2
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
:win9xME_args_slurp
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
if "x%~1" == "x" goto execute
|
echo location of your Java installation.
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
goto fail
|
||||||
goto execute
|
|
||||||
|
:init
|
||||||
:4NT_args
|
@rem Get command-line arguments, handling Windows variants
|
||||||
@rem Get arguments from the 4NT Shell from JP Software
|
|
||||||
set CMD_LINE_ARGS=%$
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
:execute
|
:win9xME_args
|
||||||
@rem Setup the command line
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set _SKIP=2
|
||||||
|
|
||||||
@rem Execute Gradle
|
:win9xME_args_slurp
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
:end
|
set CMD_LINE_ARGS=%*
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
@rem Execute Gradle
|
||||||
exit /b 1
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
:mainEnd
|
:end
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
:omega
|
|
||||||
|
: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
|
||||||
|
|
1
proprietary/.gitignore
vendored
Normal file
1
proprietary/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/build
|
29
proprietary/build.gradle
Normal file
29
proprietary/build.gradle
Normal file
|
@ -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"
|
||||||
|
}
|
21
proprietary/proguard-rules.pro
vendored
Normal file
21
proprietary/proguard-rules.pro
vendored
Normal file
|
@ -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
|
2
proprietary/src/main/AndroidManifest.xml
Normal file
2
proprietary/src/main/AndroidManifest.xml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="dev.lucasnlm.proprietary" />
|
13
proprietary/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
vendored
Normal file
13
proprietary/src/main/java/dev/lucasnlm/external/InstantAppWrapper.kt
vendored
Normal file
|
@ -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)
|
||||||
|
}
|
|
@ -1 +1,3 @@
|
||||||
include ':app', ':wear', ':common'
|
include ':app', ':wear', ':common'
|
||||||
|
include ':proprietary'
|
||||||
|
include ':foss'
|
||||||
|
|
3
wear/proguard-rules.pro
vendored
3
wear/proguard-rules.pro
vendored
|
@ -1,8 +1,5 @@
|
||||||
# Project specific ProGuard rules
|
# 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
|
# support design
|
||||||
-dontwarn android.support.design.**
|
-dontwarn android.support.design.**
|
||||||
-keep class android.support.design.** { *; }
|
-keep class android.support.design.** { *; }
|
||||||
|
|
Loading…
Reference in a new issue