Loading app/build.gradle +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,19 @@ def versionMajor = 2 def versionMinor = 4 def versionPatch = 0 def getGitHash = { -> def stdOut = new ByteArrayOutputStream() exec { commandLine 'git', 'log', '--pretty=format:%h', '-n', '1' standardOutput = stdOut } return stdOut.toString().trim() } def getDate = { -> return new Date().format('yyyyMMddHHmmss') } android { compileSdk 31 Loading @@ -22,6 +35,8 @@ android { versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch versionName "${versionMajor}.${versionMinor}.${versionPatch}" buildConfigField "String", "BUILD_ID", "\"${getGitHash() + "." + getDate()}\"" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } Loading app/src/main/java/foundation/e/apps/MainActivity.kt +3 −10 Original line number Diff line number Diff line Loading @@ -54,11 +54,11 @@ import foundation.e.apps.utils.enums.Status import foundation.e.apps.utils.eventBus.AppEvent import foundation.e.apps.utils.eventBus.EventBus import foundation.e.apps.utils.exceptions.GPlayValidationException import foundation.e.apps.utils.modules.CommonUtilsFunctions import foundation.e.apps.utils.modules.CommonUtilsModule import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.filter import kotlinx.coroutines.launch import org.json.JSONObject import timber.log.Timber import java.io.File import java.util.UUID Loading Loading @@ -129,14 +129,7 @@ class MainActivity : AppCompatActivity() { viewModel.gPlayAuthData = data as AuthData } else if (exception is GPlayValidationException) { val email = otherPayload.toString() val descriptionJson = JSONObject().apply { put("versionName", BuildConfig.VERSION_NAME) put("versionCode", BuildConfig.VERSION_CODE) put("debuggable", BuildConfig.DEBUG) put("device", Build.DEVICE) put("api", Build.VERSION.SDK_INT) } viewModel.uploadFaultyTokenToEcloud(email, descriptionJson.toString()) viewModel.uploadFaultyTokenToEcloud(email, CommonUtilsFunctions.getAppBuildInfo()) } } } Loading app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +10 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ import foundation.e.apps.utils.modules.PWAManagerModule import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import ru.beryukhov.reactivenetwork.ReactiveNetwork import ru.beryukhov.reactivenetwork.internet.observing.InternetObservingSettings import ru.beryukhov.reactivenetwork.internet.observing.strategy.SocketInternetObservingStrategy import java.io.ByteArrayOutputStream import javax.inject.Inject Loading Loading @@ -331,7 +333,14 @@ class MainActivityViewModel @Inject constructor( } val internetConnection = liveData { emitSource(ReactiveNetwork().observeInternetConnectivity().asLiveData(Dispatchers.Default)) emitSource( ReactiveNetwork().observeInternetConnectivity( InternetObservingSettings.builder() .host("http://204.ecloud.global") .strategy(SocketInternetObservingStrategy()) .build() ).asLiveData(Dispatchers.Default) ) } fun updateStatusOfFusedApps( Loading app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ package foundation.e.apps.api.gplay.utils import com.aurora.gplayapi.data.models.PlayResponse import com.aurora.gplayapi.network.IHttpClient import foundation.e.apps.utils.modules.CommonUtilsFunctions import okhttp3.Cache import okhttp3.Headers.Companion.toHeaders import okhttp3.HttpUrl Loading Loading @@ -81,7 +82,11 @@ class GPlayHttpClient @Inject constructor( override fun postAuth(url: String, body: ByteArray): PlayResponse { val requestBody = body.toRequestBody("application/json".toMediaType(), 0, body.size) val headers = mapOf( "User-Agent" to CommonUtilsFunctions.getAppBuildInfo() ) val request = Request.Builder() .headers(headers.toHeaders()) .url(url) .method(POST, requestBody) .build() Loading app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt +6 −2 Original line number Diff line number Diff line Loading @@ -227,9 +227,13 @@ class LoginSourceGPlay @Inject constructor( ResultSupreme.Success(formattedAuthData) } else { val message = "Validating AuthData failed.\n\n" + "Validating AuthData failed.\n" + "Network code: ${playResponse?.code}\n" + "Success: ${playResponse?.isSuccessful}" + (validityResponse.exception?.let { "\n${it.message}" } ?: "") playResponse?.errorString?.run { if (isNotBlank()) "\nError message: $this" else "" } ResultSupreme.Error( message, Loading Loading
app/build.gradle +15 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,19 @@ def versionMajor = 2 def versionMinor = 4 def versionPatch = 0 def getGitHash = { -> def stdOut = new ByteArrayOutputStream() exec { commandLine 'git', 'log', '--pretty=format:%h', '-n', '1' standardOutput = stdOut } return stdOut.toString().trim() } def getDate = { -> return new Date().format('yyyyMMddHHmmss') } android { compileSdk 31 Loading @@ -22,6 +35,8 @@ android { versionCode versionMajor * 1000000 + versionMinor * 1000 + versionPatch versionName "${versionMajor}.${versionMinor}.${versionPatch}" buildConfigField "String", "BUILD_ID", "\"${getGitHash() + "." + getDate()}\"" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } Loading
app/src/main/java/foundation/e/apps/MainActivity.kt +3 −10 Original line number Diff line number Diff line Loading @@ -54,11 +54,11 @@ import foundation.e.apps.utils.enums.Status import foundation.e.apps.utils.eventBus.AppEvent import foundation.e.apps.utils.eventBus.EventBus import foundation.e.apps.utils.exceptions.GPlayValidationException import foundation.e.apps.utils.modules.CommonUtilsFunctions import foundation.e.apps.utils.modules.CommonUtilsModule import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.filter import kotlinx.coroutines.launch import org.json.JSONObject import timber.log.Timber import java.io.File import java.util.UUID Loading Loading @@ -129,14 +129,7 @@ class MainActivity : AppCompatActivity() { viewModel.gPlayAuthData = data as AuthData } else if (exception is GPlayValidationException) { val email = otherPayload.toString() val descriptionJson = JSONObject().apply { put("versionName", BuildConfig.VERSION_NAME) put("versionCode", BuildConfig.VERSION_CODE) put("debuggable", BuildConfig.DEBUG) put("device", Build.DEVICE) put("api", Build.VERSION.SDK_INT) } viewModel.uploadFaultyTokenToEcloud(email, descriptionJson.toString()) viewModel.uploadFaultyTokenToEcloud(email, CommonUtilsFunctions.getAppBuildInfo()) } } } Loading
app/src/main/java/foundation/e/apps/MainActivityViewModel.kt +10 −1 Original line number Diff line number Diff line Loading @@ -54,6 +54,8 @@ import foundation.e.apps.utils.modules.PWAManagerModule import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import ru.beryukhov.reactivenetwork.ReactiveNetwork import ru.beryukhov.reactivenetwork.internet.observing.InternetObservingSettings import ru.beryukhov.reactivenetwork.internet.observing.strategy.SocketInternetObservingStrategy import java.io.ByteArrayOutputStream import javax.inject.Inject Loading Loading @@ -331,7 +333,14 @@ class MainActivityViewModel @Inject constructor( } val internetConnection = liveData { emitSource(ReactiveNetwork().observeInternetConnectivity().asLiveData(Dispatchers.Default)) emitSource( ReactiveNetwork().observeInternetConnectivity( InternetObservingSettings.builder() .host("http://204.ecloud.global") .strategy(SocketInternetObservingStrategy()) .build() ).asLiveData(Dispatchers.Default) ) } fun updateStatusOfFusedApps( Loading
app/src/main/java/foundation/e/apps/api/gplay/utils/GPlayHttpClient.kt +5 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ package foundation.e.apps.api.gplay.utils import com.aurora.gplayapi.data.models.PlayResponse import com.aurora.gplayapi.network.IHttpClient import foundation.e.apps.utils.modules.CommonUtilsFunctions import okhttp3.Cache import okhttp3.Headers.Companion.toHeaders import okhttp3.HttpUrl Loading Loading @@ -81,7 +82,11 @@ class GPlayHttpClient @Inject constructor( override fun postAuth(url: String, body: ByteArray): PlayResponse { val requestBody = body.toRequestBody("application/json".toMediaType(), 0, body.size) val headers = mapOf( "User-Agent" to CommonUtilsFunctions.getAppBuildInfo() ) val request = Request.Builder() .headers(headers.toHeaders()) .url(url) .method(POST, requestBody) .build() Loading
app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt +6 −2 Original line number Diff line number Diff line Loading @@ -227,9 +227,13 @@ class LoginSourceGPlay @Inject constructor( ResultSupreme.Success(formattedAuthData) } else { val message = "Validating AuthData failed.\n\n" + "Validating AuthData failed.\n" + "Network code: ${playResponse?.code}\n" + "Success: ${playResponse?.isSuccessful}" + (validityResponse.exception?.let { "\n${it.message}" } ?: "") playResponse?.errorString?.run { if (isNotBlank()) "\nError message: $this" else "" } ResultSupreme.Error( message, Loading