mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 16:50:04 +02:00
Fix push notifications for Google release
This commit is contained in:
parent
882c1bf6cd
commit
399be26280
3 changed files with 100 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
import java.util.regex.Matcher
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.android.application'
|
id 'com.android.application'
|
||||||
id 'kotlin-android'
|
id 'kotlin-android'
|
||||||
|
@ -135,4 +138,31 @@ dependencies {
|
||||||
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
|
||||||
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
|
||||||
|
}
|
||||||
|
def getCurrentFlavor() {
|
||||||
|
Gradle gradle = getGradle()
|
||||||
|
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
|
||||||
|
println("tskReqStr:" +tskReqStr)
|
||||||
|
Pattern pattern
|
||||||
|
|
||||||
|
if( tskReqStr.contains( "assemble" ) ) // to run ./gradlew assembleRelease to build APK
|
||||||
|
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
|
||||||
|
else if( tskReqStr.contains( "bundle" ) ) // to run ./gradlew bundleRelease to build .aab
|
||||||
|
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
|
||||||
|
else
|
||||||
|
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
|
||||||
|
|
||||||
|
Matcher matcher = pattern.matcher( tskReqStr )
|
||||||
|
println(tskReqStr)
|
||||||
|
if( matcher.find() )
|
||||||
|
return matcher.group(1).toLowerCase()
|
||||||
|
else
|
||||||
|
{
|
||||||
|
println "NO MATCH FOUND"
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println("Flavor: ${getCurrentFlavor()}")
|
||||||
|
if ( getCurrentFlavor() == "playstore" ){
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
}
|
}
|
68
app/src/debug/playstore/google-services.json
Normal file
68
app/src/debug/playstore/google-services.json
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "479837431022",
|
||||||
|
"project_id": "pc-api-4835782490875392372-140",
|
||||||
|
"storage_bucket": "pc-api-4835782490875392372-140.appspot.com"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:479837431022:android:1102a97a55202beb547fff",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "app.fedilab.android"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "479837431022-mettpakdcso72c35djvikfc57l4i7n53.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCklTEEgLUxy__0Vzcr5_H179kYPXGjmGo"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "479837431022-mettpakdcso72c35djvikfc57l4i7n53.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:479837431022:android:529536f519b8f4ce547fff",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "app.fedilab.android.debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "479837431022-mettpakdcso72c35djvikfc57l4i7n53.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyCklTEEgLUxy__0Vzcr5_H179kYPXGjmGo"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": [
|
||||||
|
{
|
||||||
|
"client_id": "479837431022-mettpakdcso72c35djvikfc57l4i7n53.apps.googleusercontent.com",
|
||||||
|
"client_type": 3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
|
@ -3,12 +3,13 @@ buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
google()
|
google()
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
|
||||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.1"
|
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.5.1"
|
||||||
|
classpath 'com.google.gms:google-services:4.3.8'
|
||||||
// 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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue