Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d53896a3 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Merge remote-tracking branch 'upstream/master' into merge-upstream-1.5

parents eba122f2 4cd7c928
Loading
Loading
Loading
Loading
Loading
+34 −19
Original line number Diff line number Diff line
@@ -9,30 +9,30 @@ buildscript {
    ext.safeParcelVersion = '1.7.0'
    ext.wearableVersion = '0.1.1'

    ext.kotlinVersion = '1.6.10'
    ext.coroutineVersion = '1.5.2'
    ext.kotlinVersion = '1.7.10'
    ext.coroutineVersion = '1.6.4'

    ext.annotationVersion = '1.3.0'
    ext.appcompatVersion = '1.4.1'
    ext.appcompatVersion = '1.4.2'
    ext.biometricVersion = '1.1.0'
    ext.coreVersion = '1.7.0'
    ext.fragmentVersion = '1.4.0'
    ext.lifecycleVersion = '2.4.0'
    ext.coreVersion = '1.8.0'
    ext.fragmentVersion = '1.5.1'
    ext.lifecycleVersion = '2.5.1'
    ext.loaderVersion = '1.1.0'
    ext.mediarouterVersion = '1.2.5'
    ext.mediarouterVersion = '1.3.1'
    ext.multidexVersion = '2.0.1'
    ext.navigationVersion = '2.3.5'
    ext.preferenceVersion = '1.1.1'
    ext.navigationVersion = '2.5.1'
    ext.preferenceVersion = '1.2.0'
    ext.recyclerviewVersion = '1.2.0'
    ext.webkitVersion = '1.4.0'

    ext.slf4jVersion = '1.7.25'
    ext.slf4jVersion = '1.7.36'
    ext.volleyVersion = '1.2.1'
    ext.wireVersion = '3.2.2'
    ext.wireVersion = '4.4.1'

    ext.androidBuildGradleVersion = '7.0.4'
    ext.androidBuildGradleVersion = '7.2.1'

    ext.androidBuildVersionTools = '30.0.2'
    ext.androidBuildVersionTools = '33.0.0'

    ext.androidMinSdk = 14
    ext.androidTargetSdk = 29
@@ -56,15 +56,30 @@ def execResult(...args) {
        commandLine args
        standardOutput = stdout
    }
    return stdout.toString().trim()
    return stdout.toString()
}

def gmsVersion = "21.48.16"
def gmsVersion = "22.36.16"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD"))
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0]
def gitDirty = execResult('git', 'status', '--porcelain').size() > 0
def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').trim().substring(1)
def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD").trim())
def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').trim().split(' ')[0]
def gitDirty = false
execResult('git', 'status', '--porcelain').lines().each { stat ->
  def status = stat.substring(0,2)
  def file = stat.substring(3)
  if (status == '??') {
    if (subprojects.any { p -> file.startsWith(p.name + '/') }) {
      logger.lifecycle('Dirty file: {} (untracked)', file)
      gitDirty = true
    } else {
      logger.info('New file outside module: {} (ignored for dirty check)', file)
    }
  } else {
    logger.lifecycle('Dirty file: {} (changed)', file)
    gitDirty = true
  }
}
def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.'))
def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1))
def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2  + (gitCommitCount > 0 || gitDirty ? 1 : 0)
+10 −8
Original line number Diff line number Diff line
@@ -33,12 +33,12 @@ class ReCaptchaActivity : AppCompatActivity() {
        get() = intent.getStringExtra(EXTRA_HOSTNAME) ?: "localhost:5000"
    private var finished = false

    @SuppressLint("SetJavaScriptEnabled", "AddJavascriptInterface")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        openWebsite()
    }

    @SuppressLint("SetJavaScriptEnabled", "AddJavascriptInterface")
    private fun openWebsite() {
        val apiKey = intent.getStringExtra(EXTRA_API_KEY) ?: return finishResult(Activity.RESULT_CANCELED)
        setContentView(R.layout.activity_recaptcha)
@@ -51,13 +51,7 @@ class ReCaptchaActivity : AppCompatActivity() {
        settings.cacheMode = WebSettings.LOAD_NO_CACHE
        ProfileManager.ensureInitialized(this)
        settings.userAgentString = Build.generateWebViewUserAgentString(settings.userAgentString)
        view.addJavascriptInterface(object : Any() {
            @JavascriptInterface
            fun onReCaptchaToken(token: String) {
                Log.d(TAG, "onReCaptchaToken: $token")
                finishResult(Activity.RESULT_OK, token)
            }
        }, "MyCallback")
        view.addJavascriptInterface(ReCaptchaCallback(this), "MyCallback")
        val captcha = assets.open("recaptcha.html").bufferedReader().readText().replace("%apikey%", apiKey)
        view.loadDataWithBaseURL("https://$hostname/", captcha, null, null, "https://$hostname/")
    }
@@ -80,6 +74,14 @@ class ReCaptchaActivity : AppCompatActivity() {
        const val EXTRA_HOSTNAME = "hostname"
        const val EXTRA_RESULT_RECEIVER = "receiver"

        class ReCaptchaCallback(val activity: ReCaptchaActivity) {
            @JavascriptInterface
            fun onReCaptchaToken(token: String) {
                Log.d(TAG, "onReCaptchaToken: $token")
                activity.finishResult(Activity.RESULT_OK, token)
            }
        }

        fun isSupported(context: Context): Boolean = true

        suspend fun awaitToken(context: Context, apiKey: String, hostname: String? = null) = suspendCoroutine<String> { continuation ->
+16 −11
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@

package org.microg.gms.firebase.auth

import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.graphics.PixelFormat
import android.provider.Settings
@@ -32,6 +34,7 @@ class ReCaptchaOverlay(val context: Context, val apiKey: String, val hostname: S
    var finished = false
    var container: View? = null

    @SuppressLint("SetJavaScriptEnabled", "AddJavascriptInterface")
    private fun show() {
        val layoutParamsType = if (android.os.Build.VERSION.SDK_INT >= 26) {
            WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
@@ -83,17 +86,7 @@ class ReCaptchaOverlay(val context: Context, val apiKey: String, val hostname: S
            settings.cacheMode = WebSettings.LOAD_NO_CACHE
            ProfileManager.ensureInitialized(context)
            settings.userAgentString = Build.generateWebViewUserAgentString(settings.userAgentString)
            view.addJavascriptInterface(object : Any() {
                @JavascriptInterface
                fun onReCaptchaToken(token: String) {
                    Log.d(TAG, "onReCaptchaToken: $token")
                    if (!finished) {
                        finished = true
                        continuation.resume(token)
                    }
                    close()
                }
            }, "MyCallback")
            view.addJavascriptInterface(ReCaptchaCallback(this), "MyCallback")
            val captcha = context.assets.open("recaptcha.html").bufferedReader().readText().replace("%apikey%", apiKey)
            view.loadDataWithBaseURL("https://$hostname/", captcha, null, null, "https://$hostname/")
            windowManager.addView(container, params)
@@ -113,6 +106,18 @@ class ReCaptchaOverlay(val context: Context, val apiKey: String, val hostname: S
    }

    companion object {
        class ReCaptchaCallback(val overlay: ReCaptchaOverlay) {
            @JavascriptInterface
            fun onReCaptchaToken(token: String) {
                Log.d(TAG, "onReCaptchaToken: $token")
                if (!overlay.finished) {
                    overlay.finished = true
                    overlay.continuation.resume(token)
                }
                overlay.close()
            }
        }

        fun isSupported(context: Context): Boolean = android.os.Build.VERSION.SDK_INT < 23 || Settings.canDrawOverlays(context)

        suspend fun awaitToken(context: Context, apiKey: String, hostname: String? = null) = suspendCoroutine<String> { continuation ->
+0 −34
Original line number Diff line number Diff line
#
# Copyright 2019 e Foundation
#
# 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
#
#     http://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.
#

POM_NAME=Firebase Dynamic Links API
POM_DESCRIPTION=Interfaces and objects for IPC between Firebase Library and microG

POM_PACKAGING=aar

POM_URL=https://github.com/microg/android_external_GmsApi

POM_SCM_URL=https://github.com/microg/android_external_GmsApi
POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git

POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo

POM_DEVELOPER_ID=alexandruchircu
POM_DEVELOPER_NAME=Alexandru Chircu
+2 −1
Original line number Diff line number Diff line
android.useAndroidX=true
org.gradle.jvmargs=-Xmx4096m
android.disableAutomaticComponentCreation=true
Loading