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

Verified Commit 91071bbe authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Move ReCAPTCHA Activity to UI package

parent 6e21b52b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ buildscript {
    ext.coroutineVersion = '1.5.2'

    ext.annotationVersion = '1.2.0'
    ext.appcompatVersion = '1.4.0'
    ext.appcompatVersion = '1.4.1'
    ext.coreVersion = '1.7.0'
    ext.fragmentVersion = '1.4.0'
    ext.lifecycleVersion = '2.4.0'
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ dependencies {
    withNearbyImplementation project(':play-services-nearby-core')
    withNearbyImplementation project(':play-services-nearby-core-ui')
    implementation project(':play-services-safetynet-core')
    implementation project(':play-services-safetynet-core-ui')
    implementation project(':play-services-tapandpay-core')
    implementation project(':play-services-vision-core')

+59 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2021 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'
apply plugin: 'signing'

dependencies {
    api project(':play-services-safetynet-api')

    implementation project(':play-services-base-core')
    implementation project(':play-services-base-core-ui')
    implementation project(':play-services-droidguard')
    implementation project(':play-services-droidguard-core')

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"

    implementation "androidx.appcompat:appcompat:$appcompatVersion"
    implementation "androidx.core:core-ktx:$coreVersion"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
    implementation "androidx.webkit:webkit:$webkitVersion"
}

android {
    compileSdkVersion androidCompileSdk
    buildToolsVersion "$androidBuildVersionTools"

    defaultConfig {
        versionName version
        minSdkVersion androidMinSdk
        targetSdkVersion androidTargetSdk
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'MissingTranslation'
    }

    compileOptions {
        sourceCompatibility = 1.8
        targetCompatibility = 1.8
    }

    kotlinOptions {
        jvmTarget = 1.8
    }
}

apply from: '../gradle/publish-android.gradle'

description = 'UI for microG service implementation for play-services-safetynet'
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ SPDX-FileCopyrightText: 2021 microG Project Team
  ~ SPDX-License-Identifier: Apache-2.0
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.microg.gms.safetynet.core.ui">

    <application>
        <activity
            android:name="org.microg.gms.safetynet.ReCaptchaActivity"
            android:autoRemoveFromRecents="true"
            android:icon="@drawable/ic_recaptcha"
            android:process=":ui"
            android:exported="false"
            android:theme="@style/Theme.AppCompat.Light.Dialog.NoActionBar">
            <intent-filter>
                <action android:name="org.microg.gms.safetynet.RECAPTCHA_ACTIVITY" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
    </application>
</manifest>
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ import androidx.lifecycle.lifecycleScope
import androidx.webkit.WebViewClientCompat
import com.google.android.gms.safetynet.SafetyNetStatusCodes.*
import org.microg.gms.droidguard.core.DroidGuardResultCreator
import org.microg.gms.safetynet.core.R
import org.microg.gms.safetynet.core.ui.R
import java.io.ByteArrayInputStream
import java.net.URLEncoder
import java.security.MessageDigest
@@ -30,7 +30,7 @@ import kotlin.math.min

private const val TAG = "GmsReCAPTCHA"

fun StringBuilder.appendUrlEncodedParam(key: String, value: String?) = append("&")
private fun StringBuilder.appendUrlEncodedParam(key: String, value: String?) = append("&")
        .append(URLEncoder.encode(key, "UTF-8"))
        .append("=")
        .append(value?.let { URLEncoder.encode(it, "UTF-8") } ?: "")
Loading