diff --git a/build.gradle b/build.gradle index 31a8ede8b5..c60139939e 100644 --- a/build.gradle +++ b/build.gradle @@ -7,35 +7,34 @@ buildscript { ext.cronetVersion = '102.5005.125' ext.wearableVersion = '0.1.1' - ext.kotlinVersion = '1.9.22' - ext.coroutineVersion = '1.7.3' + ext.kotlinVersion = '1.7.22' + ext.coroutineVersion = '1.6.4' - ext.annotationVersion = '1.7.1' + ext.annotationVersion = '1.5.0' ext.appcompatVersion = '1.6.1' ext.biometricVersion = '1.1.0' - ext.coreVersion = '1.12.0' - ext.fragmentVersion = '1.6.2' - ext.lifecycleVersion = '2.7.0' + ext.coreVersion = '1.9.0' + ext.fragmentVersion = '1.5.5' + ext.lifecycleVersion = '2.5.1' ext.loaderVersion = '1.1.0' - ext.materialVersion = '1.11.0' - ext.mediarouterVersion = '1.6.0' + ext.mediarouterVersion = '1.3.1' ext.multidexVersion = '2.0.1' - ext.navigationVersion = '2.7.7' + ext.navigationVersion = '2.5.3' ext.preferenceVersion = '1.2.0' - ext.recyclerviewVersion = '1.3.2' - ext.webkitVersion = '1.10.0' + ext.recyclerviewVersion = '1.2.0' + ext.webkitVersion = '1.4.0' ext.slf4jVersion = '1.7.36' ext.volleyVersion = '1.2.1' ext.wireVersion = '4.8.0' - ext.androidBuildGradleVersion = '8.2.2' + ext.androidBuildGradleVersion = '8.0.2' - ext.androidBuildVersionTools = '34.0.0' + ext.androidBuildVersionTools = '33.0.1' - ext.androidMinSdk = 19 + ext.androidMinSdk = 14 ext.androidTargetSdk = 29 - ext.androidCompileSdk = 34 + ext.androidCompileSdk = 33 ext.localProperties = new Properties() diff --git a/firebase-auth/core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt b/firebase-auth/core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt index 3d7f68c40a..d5af19cada 100644 --- a/firebase-auth/core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt +++ b/firebase-auth/core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt @@ -82,7 +82,7 @@ class FirebaseAuthService : BaseService(TAG, GmsService.FIREBASE_AUTH) { } } -class FirebaseAuthServiceImpl(private val context: Context, override val lifecycle: Lifecycle, private val packageName: String, private val libraryVersion: String?, private val apiKey: String) : IFirebaseAuthService.Stub(), LifecycleOwner { +class FirebaseAuthServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String, private val libraryVersion: String?, private val apiKey: String) : IFirebaseAuthService.Stub(), LifecycleOwner { private val client by lazy { IdentityToolkitClient(context, apiKey, packageName, PackageUtils.firstSignatureDigestBytes(context, packageName)) } private var authorizedDomain: String? = null @@ -151,6 +151,8 @@ class FirebaseAuthServiceImpl(private val context: Context, override val lifecyc } } + override fun getLifecycle(): Lifecycle = lifecycle + override fun applyActionCode(request: ApplyActionCodeAidlRequest, callbacks: IFirebaseAuthCallbacks) { Log.d(TAG, "Not yet implemented: applyActionCode") callbacks.onFailure(Status(CommonStatusCodes.CANCELED, "Not supported")) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7710..7454180f2a 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 70728d8286..e59574a340 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,7 +3,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip -networkTimeout=10000 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 91a12af9d1..050e50b880 100755 --- a/gradlew +++ b/gradlew @@ -56,7 +56,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -81,11 +81,11 @@ do esac done -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +APP_NAME="Gradle" +APP_BASE_NAME=${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"' @@ -144,16 +144,12 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -210,12 +206,6 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index eba6659c01..8fc60882af 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -15,7 +15,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%"=="" @echo off +@if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -26,8 +26,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused +if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -42,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -77,15 +76,13 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd +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! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverCore.kt b/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverCore.kt index c0c70b4945..08b2255bd6 100644 --- a/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverCore.kt +++ b/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverCore.kt @@ -53,7 +53,7 @@ private const val EXTRA_REQUEST_ID = "requestId" private const val TIMEOUT = 1000 * 60 * 5 // 5 minutes private const val MESSAGE_MAX_LEN = 140 -class SmsRetrieverCore(private val context: Context, override val lifecycle: Lifecycle) : LifecycleOwner, DefaultLifecycleObserver { +class SmsRetrieverCore(private val context: Context, private val lifecycle: Lifecycle) : LifecycleOwner, DefaultLifecycleObserver { private val requests: HashMap = hashMapOf() private val requestIdCounter = AtomicInteger(0) private lateinit var timeoutBroadcastReceiver: BroadcastReceiver @@ -66,6 +66,8 @@ class SmsRetrieverCore(private val context: Context, override val lifecycle: Lif lifecycle.addObserver(this) } + override fun getLifecycle(): Lifecycle = lifecycle + @TargetApi(19) private fun configureBroadcastListenersIfNeeded() { synchronized(this) { diff --git a/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverService.kt b/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverService.kt index 76fe53593f..5b7d30cb32 100644 --- a/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverService.kt +++ b/play-services-auth-api-phone/core/src/main/kotlin/org/microg/gms/auth/phone/SmsRetrieverService.kt @@ -47,9 +47,11 @@ class SmsRetrieverService : BaseService(TAG, GmsService.SMS_RETRIEVER) { } -class SmsRetrieverServiceImpl(private val smsRetriever: SmsRetrieverCore, private val packageName: String, override val lifecycle: Lifecycle) : +class SmsRetrieverServiceImpl(private val smsRetriever: SmsRetrieverCore, private val packageName: String, private val lifecycle: Lifecycle) : ISmsRetrieverApiService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle + override fun startSmsRetriever(callback: ISmsRetrieverResultCallback) { Log.d(TAG, "startSmsRetriever()") lifecycleScope.launchWhenStarted { diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index a2bdcd4a8d..e4a8c6e84d 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -80,7 +80,7 @@ dependencies { implementation "androidx.webkit:webkit:$webkitVersion" // Material Components - implementation "com.google.android.material:material:$materialVersion" + implementation 'com.google.android.material:material:1.9.0' // Navigation implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" diff --git a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/LoaderActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/LoaderActivity.kt index 5d165f4efe..fd6f8c8165 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/LoaderActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/LoaderActivity.kt @@ -61,7 +61,6 @@ class LoaderActivity : AppCompatActivity() { Uri.parse(fallbackUrl) } Log.d(TAG, "Opening fallback $fallbackUrl") - // noinspection UnsafeImplicitIntentLaunch val intent = Intent(ACTION_VIEW, uri).apply { addCategory(CATEGORY_BROWSABLE) } startActivity(intent) finishResult(RESULT_OK) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/WebViewHelper.kt b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/WebViewHelper.kt index a65b7a0de1..201af5d172 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/WebViewHelper.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/accountsettings/ui/WebViewHelper.kt @@ -59,7 +59,6 @@ class WebViewHelper(private val activity: AppCompatActivity, private val webView } if (allowedPrefixes.isNotEmpty() && allowedPrefixes.none { url.startsWith(it) }) { try { - // noinspection UnsafeImplicitIntentLaunch activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).apply { addCategory(Intent.CATEGORY_BROWSABLE) }) } catch (e: Exception) { Log.w(TAG, "Error forwarding to browser", e) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt index 93fa86aa76..ede33d2694 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt @@ -40,7 +40,7 @@ class AuthProxyService : BaseService(TAG, GmsService.AUTH_PROXY) { } } -class AuthServiceImpl(private val context: Context, override val lifecycle: Lifecycle, private val packageName: String) : IAuthService.Stub(), LifecycleOwner { +class AuthServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String) : IAuthService.Stub(), LifecycleOwner { override fun performProxyRequest(callbacks: IAuthCallbacks, request: ProxyRequest) { Log.d(TAG, "performProxyRequest($packageName, $request)") lifecycleScope.launchWhenStarted { @@ -57,5 +57,7 @@ class AuthServiceImpl(private val context: Context, override val lifecycle: Life } } + override fun getLifecycle(): Lifecycle = lifecycle + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInService.kt index f852a7eaf6..88cac7e36a 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/signin/AuthSignInService.kt @@ -61,13 +61,14 @@ class AuthSignInService : BaseService(TAG, GmsService.AUTH_SIGN_IN) { class AuthSignInServiceImpl( private val context: Context, - override val lifecycle: Lifecycle, + private val lifecycle: Lifecycle, private val packageName: String, private val account: Account?, private val scopes: List, private val extras: Bundle ) : ISignInService.Stub(), LifecycleOwner { private val queue = singleInstanceOf { Volley.newRequestQueue(context.applicationContext) } + override fun getLifecycle(): Lifecycle = lifecycle override fun silentSignIn(callbacks: ISignInCallbacks, options: GoogleSignInOptions?) { Log.d(TAG, "$packageName:silentSignIn($options)") diff --git a/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt b/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt index e149a0263a..496c5f59f4 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt @@ -29,7 +29,7 @@ class ClearcutLoggerService : BaseService(TAG, GmsService.CLEARCUT_LOGGER) { } } -class ClearcutLoggerServiceImpl(override val lifecycle: Lifecycle) : IClearcutLoggerService.Stub(), LifecycleOwner { +class ClearcutLoggerServiceImpl(private val lifecycle: Lifecycle) : IClearcutLoggerService.Stub(), LifecycleOwner { private var collectForDebugExpiryTime: Long = 0 override fun log(callbacks: IClearcutLoggerCallbacks, event: LogEventParcelable) { @@ -73,5 +73,7 @@ class ClearcutLoggerServiceImpl(override val lifecycle: Lifecycle) : IClearcutLo } } + override fun getLifecycle(): Lifecycle = lifecycle + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/credential/CredentialManagerService.kt b/play-services-core/src/main/kotlin/org/microg/gms/credential/CredentialManagerService.kt index f2b7d6926e..447d5c2172 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/credential/CredentialManagerService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/credential/CredentialManagerService.kt @@ -50,7 +50,8 @@ class CredentialManagerService : BaseService(TAG, GmsService.CREDENTIAL_MANAGER) } -private class CredentialManagerServiceImpl(private val context: Context, override val lifecycle: Lifecycle) : ICredentialManagerService.Stub(), LifecycleOwner { +private class CredentialManagerServiceImpl(private val context: Context, private val lifecycle: Lifecycle) : ICredentialManagerService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle override fun getCredentialManagerIntent(callback: IPendingIntentCallback?, params: CredentialManagerInvocationParams?) { Log.d(TAG, "Not yet implemented: getCredentialManagerIntent $params") diff --git a/play-services-core/src/main/kotlin/org/microg/gms/games/GamesConnectService.kt b/play-services-core/src/main/kotlin/org/microg/gms/games/GamesConnectService.kt index e5f7486a63..55fc78ef51 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/games/GamesConnectService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/games/GamesConnectService.kt @@ -46,7 +46,9 @@ class GamesConnectService : BaseService(TAG, GmsService.GAMES) { } } -class GamesConnectServiceImpl(val context: Context, override val lifecycle: Lifecycle, val packageName: String) : IGamesConnectService.Stub(), LifecycleOwner { +class GamesConnectServiceImpl(val context: Context, private val lifecycle: Lifecycle, val packageName: String) : IGamesConnectService.Stub(), LifecycleOwner { + + override fun getLifecycle(): Lifecycle = lifecycle override fun signIn(callback: IGamesConnectCallbacks?, request: GamesSignInRequest?) { Log.d(TAG, "signIn($request)") diff --git a/play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt b/play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt index 41ee931c01..7a59b8f1a6 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/games/GamesService.kt @@ -101,9 +101,11 @@ class GamesService : BaseService(TAG, GmsService.GAMES) { } } -class GamesServiceImpl(val context: Context, override val lifecycle: Lifecycle, val packageName: String, val account: Account, val player: Player) : +class GamesServiceImpl(val context: Context, private val lifecycle: Lifecycle, val packageName: String, val account: Account, val player: Player) : IGamesService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle + override fun clientDisconnecting(clientId: Long) { Log.d(TAG, "Not yet implemented: clientDisconnecting($clientId)") } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt index fa705635fa..6f1237259b 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt @@ -205,7 +205,8 @@ class PushRegisterService : LifecycleService() { } } -internal class PushRegisterHandler(private val context: Context, private val database: GcmDatabase, override val lifecycle: Lifecycle) : Handler(), LifecycleOwner { +internal class PushRegisterHandler(private val context: Context, private val database: GcmDatabase, private val lifecycle: Lifecycle) : Handler(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle private var callingUid = 0 override fun sendMessageAtTime(msg: Message, uptimeMillis: Long): Boolean { @@ -351,7 +352,7 @@ internal class PushRegisterHandler(private val context: Context, private val dat class PushRegisterReceiver : WakefulBroadcastReceiver() { override fun onReceive(context: Context, intent: Intent) { val intent2 = Intent(context, PushRegisterService::class.java) - if (intent.extras!!.get("delete") != null) { + if (intent.extras!!["delete"] != null) { intent2.action = ACTION_C2DM_UNREGISTER } else { intent2.action = ACTION_C2DM_REGISTER diff --git a/play-services-core/src/main/kotlin/org/microg/gms/googlehelp/ui/GoogleHelpRedirectActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/googlehelp/ui/GoogleHelpRedirectActivity.kt index 27f5667e35..1c2d5a970a 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/googlehelp/ui/GoogleHelpRedirectActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/googlehelp/ui/GoogleHelpRedirectActivity.kt @@ -27,7 +27,6 @@ class GoogleHelpRedirectActivity : AppCompatActivity() { // Long-term best is to not redirect to web but instead implement the thing properly, allowing us also to show // option items, do proper theming for better integration, etc. Log.d(TAG, "Open $uri for $callingPackage/${googleHelp.appContext} in Browser") - // noinspection UnsafeImplicitIntentLaunch startActivity(Intent(Intent.ACTION_VIEW, uri)) finish() } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/signin/SignInService.kt b/play-services-core/src/main/kotlin/org/microg/gms/signin/SignInService.kt index 14bad51a23..0880213bba 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/signin/SignInService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/signin/SignInService.kt @@ -35,8 +35,9 @@ class SignInService : BaseService(TAG, GmsService.SIGN_IN) { } } -class SignInServiceImpl(val context: Context, override val lifecycle: Lifecycle, val packageName: String, val scopes: Array) : ISignInService.Stub(), +class SignInServiceImpl(val context: Context, private val lifecycle: Lifecycle, val packageName: String, val scopes: Array) : ISignInService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle override fun clearAccountFromSessionStore(sessionId: Int) { Log.d(TAG, "Not yet implemented: clearAccountFromSessionStore $sessionId") diff --git a/play-services-core/src/main/res/values-night-v31/themes.xml b/play-services-core/src/main/res/values-night-v31/themes.xml deleted file mode 100644 index 96ab184f33..0000000000 --- a/play-services-core/src/main/res/values-night-v31/themes.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/play-services-core/src/main/res/values-v31/themes.xml b/play-services-core/src/main/res/values-v31/themes.xml index 96ab184f33..09291073ad 100644 --- a/play-services-core/src/main/res/values-v31/themes.xml +++ b/play-services-core/src/main/res/values-v31/themes.xml @@ -1,4 +1,6 @@ - diff --git a/play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/privileged/Fido2PrivilegedService.kt b/play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/privileged/Fido2PrivilegedService.kt index 007450891e..9b9c7321be 100644 --- a/play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/privileged/Fido2PrivilegedService.kt +++ b/play-services-fido/core/src/main/kotlin/org/microg/gms/fido/core/privileged/Fido2PrivilegedService.kt @@ -59,7 +59,7 @@ class Fido2PrivilegedService : BaseService(TAG, FIDO2_PRIVILEGED) { } } -class Fido2PrivilegedServiceImpl(private val context: Context, override val lifecycle: Lifecycle) : +class Fido2PrivilegedServiceImpl(private val context: Context, private val lifecycle: Lifecycle) : IFido2PrivilegedService.Stub(), LifecycleOwner { override fun getRegisterPendingIntent(callbacks: IFido2PrivilegedCallbacks, options: BrowserPublicKeyCredentialCreationOptions) { lifecycleScope.launchWhenStarted { @@ -106,6 +106,8 @@ class Fido2PrivilegedServiceImpl(private val context: Context, override val life } } + override fun getLifecycle(): Lifecycle = lifecycle + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) } } diff --git a/play-services-gmscompliance/core/src/main/kotlin/org/microg/gms/gmscompliance/GmsDeviceComplianceService.kt b/play-services-gmscompliance/core/src/main/kotlin/org/microg/gms/gmscompliance/GmsDeviceComplianceService.kt index b44196b34a..ac48b68677 100644 --- a/play-services-gmscompliance/core/src/main/kotlin/org/microg/gms/gmscompliance/GmsDeviceComplianceService.kt +++ b/play-services-gmscompliance/core/src/main/kotlin/org/microg/gms/gmscompliance/GmsDeviceComplianceService.kt @@ -33,7 +33,7 @@ class GmsDeviceComplianceService : BaseService(TAG, GmsService.GMS_COMPLIANCE) { } } -class GmsDeviceComplianceServiceImpl(override val lifecycle: Lifecycle) : IGmsDeviceComplianceService.Stub(), LifecycleOwner { +class GmsDeviceComplianceServiceImpl(private val lifecycle: Lifecycle) : IGmsDeviceComplianceService.Stub(), LifecycleOwner { override fun getDeviceCompliance(callback: IGmsDeviceComplianceServiceCallback?) { Log.d(TAG, "getDeviceCompliance()") lifecycleScope.launchWhenStarted { @@ -44,4 +44,6 @@ class GmsDeviceComplianceServiceImpl(override val lifecycle: Lifecycle) : IGmsDe } } } + + override fun getLifecycle(): Lifecycle = lifecycle } diff --git a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/DeviceOrientationManager.kt b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/DeviceOrientationManager.kt index f03a700b16..0785b24f08 100644 --- a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/DeviceOrientationManager.kt +++ b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/DeviceOrientationManager.kt @@ -40,7 +40,8 @@ import org.microg.gms.utils.WorkSourceUtil import java.io.PrintWriter import kotlin.math.* -class DeviceOrientationManager(private val context: Context, override val lifecycle: Lifecycle) : LifecycleOwner, SensorEventListener, IBinder.DeathRecipient { +class DeviceOrientationManager(private val context: Context, private val lifecycle: Lifecycle) : LifecycleOwner, SensorEventListener, IBinder.DeathRecipient { + override fun getLifecycle(): Lifecycle = lifecycle private var lock = Mutex(false) private var started: Boolean = false private var sensors: Set? = null diff --git a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManager.kt b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManager.kt index 835adf9bee..604abbb1ee 100644 --- a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManager.kt +++ b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManager.kt @@ -42,7 +42,7 @@ import kotlin.math.max import kotlin.math.min import android.location.LocationManager as SystemLocationManager -class LocationManager(private val context: Context, override val lifecycle: Lifecycle) : LifecycleOwner { +class LocationManager(private val context: Context, private val lifecycle: Lifecycle) : LifecycleOwner { private var coarsePendingIntent: PendingIntent? = null private val postProcessor by lazy { LocationPostProcessor() } private val lastLocationCapsule by lazy { LastLocationCapsule(context) } @@ -56,6 +56,8 @@ class LocationManager(private val context: Context, override val lifecycle: Life val deviceOrientationManager = DeviceOrientationManager(context, lifecycle) + override fun getLifecycle(): Lifecycle = lifecycle + var started: Boolean = false private set diff --git a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManagerInstance.kt b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManagerInstance.kt index 689d780af8..b8579a7a9a 100644 --- a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManagerInstance.kt +++ b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationManagerInstance.kt @@ -38,7 +38,7 @@ class LocationManagerInstance( private val context: Context, private val locationManager: LocationManager, private val packageName: String, - override val lifecycle: Lifecycle + private val lifecycle: Lifecycle ) : AbstractLocationManagerInstance(), LifecycleOwner { @@ -379,6 +379,8 @@ class LocationManagerInstance( throw SecurityException("$packageName does not have any of $permissions") } + override fun getLifecycle(): Lifecycle = lifecycle + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) } } \ No newline at end of file diff --git a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationRequestManager.kt b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationRequestManager.kt index f1f5905780..a56e96a4d0 100644 --- a/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationRequestManager.kt +++ b/play-services-location/core/src/main/kotlin/org/microg/gms/location/manager/LocationRequestManager.kt @@ -30,7 +30,7 @@ import org.microg.gms.utils.WorkSourceUtil import java.io.PrintWriter import kotlin.math.max -class LocationRequestManager(private val context: Context, override val lifecycle: Lifecycle, private val postProcessor: LocationPostProcessor, private val database: LocationAppsDatabase = LocationAppsDatabase(context), private val requestDetailsUpdatedCallback: () -> Unit) : +class LocationRequestManager(private val context: Context, private val lifecycle: Lifecycle, private val postProcessor: LocationPostProcessor, private val database: LocationAppsDatabase = LocationAppsDatabase(context), private val requestDetailsUpdatedCallback: () -> Unit) : IBinder.DeathRecipient, LifecycleOwner { private val lock = Mutex() private val binderRequests = mutableMapOf() @@ -46,6 +46,8 @@ class LocationRequestManager(private val context: Context, override val lifecycl private var requestDetailsUpdated = false private var checkingWhileHighAccuracy = false + override fun getLifecycle(): Lifecycle = lifecycle + override fun binderDied() { lifecycleScope.launchWhenStarted { lock.withLock { diff --git a/play-services-nearby/core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt b/play-services-nearby/core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt index 122414935b..60a5ce1c8a 100644 --- a/play-services-nearby/core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt +++ b/play-services-nearby/core/src/main/kotlin/org/microg/gms/nearby/exposurenotification/ExposureNotificationServiceImpl.kt @@ -52,7 +52,7 @@ import kotlin.math.roundToInt import kotlin.random.Random @TargetApi(21) -class ExposureNotificationServiceImpl(private val context: Context, override val lifecycle: Lifecycle, private val packageName: String) : INearbyExposureNotificationService.Stub(), LifecycleOwner { +class ExposureNotificationServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String) : INearbyExposureNotificationService.Stub(), LifecycleOwner { // Table of back-end public keys, used to verify the signature of the diagnosed TEKs. // The table is indexed by package names. @@ -95,6 +95,8 @@ class ExposureNotificationServiceImpl(private val context: Context, override val private fun LifecycleCoroutineScope.launchSafely(block: suspend CoroutineScope.() -> Unit): Job = launchWhenStarted { try { block() } catch (e: Exception) { Log.w(TAG, "Error in coroutine", e) } } + override fun getLifecycle(): Lifecycle = lifecycle + private fun pendingConfirm(permission: String): PendingIntent { val intent = Intent(ACTION_CONFIRM) intent.`package` = context.packageName diff --git a/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt b/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt index c67e40e3f3..c4fbf12163 100644 --- a/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt +++ b/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaService.kt @@ -58,10 +58,14 @@ class RecaptchaService : BaseService(TAG, GmsService.RECAPTCHA) { class RecaptchaServiceImpl( private val context: Context, private val packageName: String, - override val lifecycle: Lifecycle, + private val lifecycle: Lifecycle, private val impl: RecaptchaImpl ) : IRecaptchaService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle { + return lifecycle + } + override fun verifyWithRecaptcha(callback: IExecuteCallback, siteKey: String, packageName: String) { Log.d(TAG, "Not yet implemented: verifyWithRecaptcha($siteKey, $packageName)") } diff --git a/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaWebImpl.kt b/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaWebImpl.kt index aab27bc901..222b9fbc95 100644 --- a/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaWebImpl.kt +++ b/play-services-recaptcha/core/src/main/kotlin/org/microg/gms/recaptcha/RecaptchaWebImpl.kt @@ -61,7 +61,7 @@ import kotlin.coroutines.suspendCoroutine private const val TAG = "RecaptchaWeb" @RequiresApi(19) -class RecaptchaWebImpl(private val context: Context, private val packageName: String, override val lifecycle: Lifecycle) : RecaptchaImpl, LifecycleOwner { +class RecaptchaWebImpl(private val context: Context, private val packageName: String, private val lifecycle: Lifecycle) : RecaptchaImpl, LifecycleOwner { private var webView: WebView? = null private var lastRequestToken: String? = null private var initFinished = AtomicBoolean(true) @@ -69,6 +69,8 @@ class RecaptchaWebImpl(private val context: Context, private val packageName: St private var executeFinished = AtomicBoolean(true) private var executeContinuation: Continuation? = null + override fun getLifecycle(): Lifecycle = lifecycle + override suspend fun init(params: InitParams): RecaptchaHandle { lastRequestToken = UUID.randomUUID().toString() ProfileManager.ensureInitialized(context) diff --git a/play-services-safetynet/core/src/main/kotlin/org/microg/gms/safetynet/SafetyNetClientService.kt b/play-services-safetynet/core/src/main/kotlin/org/microg/gms/safetynet/SafetyNetClientService.kt index 6d38ff61af..160afa276a 100644 --- a/play-services-safetynet/core/src/main/kotlin/org/microg/gms/safetynet/SafetyNetClientService.kt +++ b/play-services-safetynet/core/src/main/kotlin/org/microg/gms/safetynet/SafetyNetClientService.kt @@ -58,8 +58,9 @@ private fun StringBuilder.appendUrlEncodedParam(key: String, value: String?) = a class SafetyNetClientServiceImpl( private val context: Context, private val packageName: String, - override val lifecycle: Lifecycle + private val lifecycle: Lifecycle ) : ISafetyNetService.Stub(), LifecycleOwner { + override fun getLifecycle(): Lifecycle = lifecycle override fun attest(callbacks: ISafetyNetCallbacks, nonce: ByteArray) { attestWithApiKey(callbacks, nonce, DEFAULT_API_KEY)