mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-06-24 21:25:23 +00:00
Separate PlayStore version and normal version.
This commit is contained in:
parent
e5c3b28a35
commit
9e9add1d96
7 changed files with 94 additions and 51 deletions
|
@ -1,5 +1,6 @@
|
||||||
stages:
|
stages:
|
||||||
- buildAndDeployApk
|
- buildAndDeployApk
|
||||||
|
- buildAndDeployPlayStoreAab
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
ANDROID_VERSION_NAME:
|
ANDROID_VERSION_NAME:
|
||||||
|
@ -18,4 +19,19 @@ buildAndDeployApk:
|
||||||
- ./gradlew --stacktrace assembleRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
- ./gradlew --stacktrace assembleRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
||||||
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
|
||||||
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
|
||||||
|
- echo $ANDROID_VERSION_CODE > /var/www/html/fastcast-version.txt
|
||||||
|
- echo $ANDROID_VERSION_CODE > /var/www/html/fcast-version.txt
|
||||||
|
when: manual
|
||||||
|
|
||||||
|
buildAndDeployPlayStoreAab:
|
||||||
|
stage: buildAndDeployPlayStoreAab
|
||||||
|
before_script:
|
||||||
|
- cd receivers/android
|
||||||
|
script:
|
||||||
|
- if [ -z "$ANDROID_VERSION_NAME" ] || [ -z "$ANDROID_VERSION_CODE" ]; then echo "Version name or code not specified. Skipping build."; exit 0; fi
|
||||||
|
- ./gradlew --stacktrace assemblePlaystoreRelease -PversionName=$ANDROID_VERSION_NAME -PversionCode=$ANDROID_VERSION_CODE
|
||||||
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fcast-release.apk
|
||||||
|
- cp ./app/build/outputs/apk/release/app-release.apk /var/www/html/fastcast-release.apk
|
||||||
|
- echo $ANDROID_VERSION_CODE > /var/www/html/fastcast-version.txt
|
||||||
|
- echo $ANDROID_VERSION_CODE > /var/www/html/fcast-version.txt
|
||||||
when: manual
|
when: manual
|
||||||
|
|
3
receivers/android/.idea/misc.xml
generated
3
receivers/android/.idea/misc.xml
generated
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="19" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" project-jdk-name="19" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -32,6 +32,20 @@ android {
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flavorDimensions "type"
|
||||||
|
productFlavors {
|
||||||
|
playstore {
|
||||||
|
dimension "type"
|
||||||
|
applicationIdSuffix ".playstore"
|
||||||
|
versionNameSuffix "-playstore"
|
||||||
|
buildConfigField "boolean", "IS_PLAYSTORE_VERSION", "true"
|
||||||
|
}
|
||||||
|
defaultFlavor {
|
||||||
|
dimension "type"
|
||||||
|
buildConfigField "boolean", "IS_PLAYSTORE_VERSION", "false"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
keyAlias keystoreProperties['keyAlias']
|
keyAlias keystoreProperties['keyAlias']
|
||||||
|
@ -41,6 +55,12 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
playstore {
|
||||||
|
manifest.srcFile 'src/playstore/AndroidManifest.xml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
|
|
|
@ -31,6 +31,7 @@ class MainActivity : AppCompatActivity() {
|
||||||
private lateinit var _textIPs: TextView
|
private lateinit var _textIPs: TextView
|
||||||
private lateinit var _textProgress: TextView
|
private lateinit var _textProgress: TextView
|
||||||
private lateinit var _updateSpinner: ImageView
|
private lateinit var _updateSpinner: ImageView
|
||||||
|
private lateinit var _layoutUpdate: LinearLayout;
|
||||||
private var _updating: Boolean = false
|
private var _updating: Boolean = false
|
||||||
|
|
||||||
private val _scope: CoroutineScope = CoroutineScope(Dispatchers.Main)
|
private val _scope: CoroutineScope = CoroutineScope(Dispatchers.Main)
|
||||||
|
@ -44,10 +45,10 @@ class MainActivity : AppCompatActivity() {
|
||||||
_textIPs = findViewById(R.id.text_ips)
|
_textIPs = findViewById(R.id.text_ips)
|
||||||
_textProgress = findViewById(R.id.text_progress)
|
_textProgress = findViewById(R.id.text_progress)
|
||||||
_updateSpinner = findViewById(R.id.update_spinner)
|
_updateSpinner = findViewById(R.id.update_spinner)
|
||||||
|
_layoutUpdate = findViewById(R.id.layout_update)
|
||||||
|
|
||||||
_text.text = getString(R.string.checking_for_updates)
|
_text.text = getString(R.string.checking_for_updates)
|
||||||
_buttonUpdate.visibility = View.INVISIBLE
|
_buttonUpdate.visibility = View.INVISIBLE
|
||||||
(_updateSpinner.drawable as Animatable?)?.start()
|
|
||||||
|
|
||||||
_buttonUpdate.setOnClickListener {
|
_buttonUpdate.setOnClickListener {
|
||||||
if (_updating) {
|
if (_updating) {
|
||||||
|
@ -58,9 +59,19 @@ class MainActivity : AppCompatActivity() {
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BuildConfig.IS_PLAYSTORE_VERSION) {
|
||||||
|
_layoutUpdate.visibility = View.GONE
|
||||||
|
_updateSpinner.visibility = View.GONE
|
||||||
|
(_updateSpinner.drawable as Animatable?)?.stop()
|
||||||
|
} else {
|
||||||
|
_layoutUpdate.visibility = View.VISIBLE
|
||||||
|
_updateSpinner.visibility = View.VISIBLE
|
||||||
|
(_updateSpinner.drawable as Animatable?)?.start()
|
||||||
|
|
||||||
_scope.launch(Dispatchers.IO) {
|
_scope.launch(Dispatchers.IO) {
|
||||||
checkForUpdates()
|
checkForUpdates()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_textIPs.text = "IPs\n" + getIPs().joinToString("\n") + "\n\nPort\n46899"
|
_textIPs.text = "IPs\n" + getIPs().joinToString("\n") + "\n\nPort\n46899"
|
||||||
TcpListenerService.activityCount++
|
TcpListenerService.activityCount++
|
||||||
|
@ -177,6 +188,8 @@ class MainActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun checkForUpdates() {
|
private suspend fun checkForUpdates() {
|
||||||
|
Log.i(TAG, "Checking for updates...");
|
||||||
|
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
try {
|
try {
|
||||||
val latestVersion = downloadVersionCode()
|
val latestVersion = downloadVersionCode()
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.futo.fcast.receiver
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.util.Log
|
|
||||||
import android.widget.Toast
|
|
||||||
import kotlinx.coroutines.*
|
|
||||||
import okhttp3.OkHttpClient
|
|
||||||
|
|
||||||
class Updater {
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -66,6 +66,13 @@
|
||||||
android:textSize="12dp"
|
android:textSize="12dp"
|
||||||
tools:text="123" />
|
tools:text="123" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layout_update"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text_dialog"
|
android:id="@+id/text_dialog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -110,3 +117,5 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
Loading…
Add table
Add a link
Reference in a new issue