Skip to content

Commit

Permalink
Merge branch 'microg:master' into account
Browse files Browse the repository at this point in the history
  • Loading branch information
DaVinci9196 committed Apr 19, 2024
2 parents 5ea5331 + 827a8b9 commit e97ce0d
Show file tree
Hide file tree
Showing 333 changed files with 12,256 additions and 1,451 deletions.
2 changes: 1 addition & 1 deletion .github/matchers/gradle-build-matcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"owner": "gradle-build-matcher",
"pattern": [
{
"regexp": "^([^:]+):(\\d+):\\s(error|Error):\\s(.+)$",
"regexp": "^\\s*([^:]+):(\\d+):\\s(error|Error):\\s(.+)$",
"file": 1,
"line": 2,
"severity": 3,
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ jobs:
echo "Matcher configured: ${NAME:?}"
fi
done
- name: "Execute Gradle build"
run: "./gradlew --no-daemon build"
- name: "Execute Gradle assemble"
run: "./gradlew --no-daemon assemble"
- name: "Execute Gradle check"
run: "./gradlew --no-daemon check"
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ def execResult(...args) {
return stdout.toString()
}

def gmsVersion = "23.35.15"
def gmsVersion = "24.09.13"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def vendingVersion = "37.5.24"
def vendingVersion = "40.2.26"
def vendingVersionCode = Integer.parseInt(vendingVersion.replaceAll('\\.', ''))
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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class AppListDatabaseOpenHelper extends SQLiteOpenHelper {
public static final String TABLE_APPLIST = "applist";
public static final String COLUMN_NAME = "name";
public static final String COLUMN_FAKE = "fake";
private static final int DATABASE_VERSION = 2;
private static final int DATABASE_VERSION = 3;
private static final String DROP_APP_LIST_TABLE = "DROP TABLE IF EXISTS " + TABLE_APPLIST;
private static final String CREATE_APP_LIST_TABLE = "CREATE TABLE IF NOT EXISTS " + TABLE_APPLIST + "(" +
COLUMN_NAME + " VARCHAR(255) PRIMARY KEY, " +
Expand Down
4 changes: 4 additions & 0 deletions fake-signature/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<item>com.mobisoft.morhipo</item>
<item>com.zzkko</item>
<item>com.didilabs.kaavefali</item>
<item>com.airbnb.android</item>
<item>com.mobillium.papara</item>
<item>co.com.fincaraiz.app</item>
<item>com.frisby.frisby</item>
</string-array>
<string-array name="signature_never_fake">
<item>com.truecaller</item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,10 @@ class IdentityToolkitClient(context: Context, private val apiKey: String, privat

suspend fun getTokenByRefreshToken(refreshToken: String): JSONObject = suspendCoroutine { continuation ->
queue.add(object : JsonRequest<JSONObject>(POST, buildStsUrl("token"), "grant_type=refresh_token&refresh_token=$refreshToken", { continuation.resume(it) }, { continuation.resumeWithException(RuntimeException(it)) }) {
override fun parseNetworkResponse(response: NetworkResponse?): Response<JSONObject> {
override fun parseNetworkResponse(response: NetworkResponse): Response<JSONObject> {
return try {
val jsonString = String(response!!.data, Charset.forName(HttpHeaderParser.parseCharset(response!!.headers, PROTOCOL_CHARSET)))
Response.success(JSONObject(jsonString), HttpHeaderParser.parseCacheHeaders(response))
val jsonString = String(response.data, Charset.forName(HttpHeaderParser.parseCharset(response.headers, PROTOCOL_CHARSET)))
Response.success(JSONObject(jsonString), null)
} catch (e: UnsupportedEncodingException) {
Response.error(ParseError(e))
} catch (je: JSONException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<string name="perm_ad_id_label">Дазвол рэкламнага ідэнтыфікатара</string>
<string name="perm_ad_id_description">Дазваляе выдаўцу дадатку прама ці ўскосна атрымліваць доступ да рэкламнага ідэнтыфікатара.</string>
<string name="perm_ad_id_notification_label">Апавяшчэнне рэкламнага ідэнтыфікатара</string>
<string name="perm_ad_id_notification_description">Дазваляе з дадаткам атрымліваць апавяшчэнне калі рэкламны ідэнтыфікатар або перавага аб ліміце рэкламнай сачэння карыстальніка абноўленыя.</string>
<string name="perm_ad_id_notification_description">Дазваляе дадаткам атрымліваць апавяшчэнне калі рэкламны ідэнтыфікатар або перавага аб ліміце рэкламнай сачэння карыстальніка абноўленыя.</string>
</resources>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AppMetadata extends AutoSafeParcelable {
@Field(11)
public long versionCode = Integer.MIN_VALUE;
@Field(12)
private String firebaseInstanceId;
public String firebaseInstanceId;
@Field(13)
private long androidId;
@Field(14)
Expand All @@ -57,7 +57,7 @@ public class AppMetadata extends AutoSafeParcelable {
@Field(25)
private String consentSettings;
@Field(26)
private String ephemeralAppInstanceId;
public String ephemeralAppInstanceId;
@Field(27)
private String sessionStitchingToken;
@Field(28)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import android.telephony.SmsMessage
import android.text.TextUtils
import android.util.Base64
import android.util.Log
import androidx.core.app.PendingIntentCompat
import androidx.core.content.ContextCompat
import androidx.core.os.bundleOf
import androidx.lifecycle.DefaultLifecycleObserver
Expand Down Expand Up @@ -160,7 +161,7 @@ class SmsRetrieverCore(private val context: Context, override val lifecycle: Lif
private fun getTimeoutPendingIntent(context: Context, packageName: String): PendingIntent {
val intent = Intent(ACTION_SMS_RETRIEVE_TIMEOUT)
intent.setPackage(packageName)
return PendingIntent.getBroadcast(context, ++requestCode, intent, PendingIntent.FLAG_IMMUTABLE)
return PendingIntentCompat.getBroadcast(context, ++requestCode, intent, 0, false)!!
}

private fun tryHandleIncomingMessageAsRetrieverMessage(message: SmsMessage): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,16 @@
package org.microg.gms.auth.phone

import android.annotation.TargetApi
import android.app.Activity
import android.app.Dialog
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.*
import android.telephony.SmsMessage
import android.text.Html
import android.text.TextUtils
import android.util.Log
import android.view.Gravity
import android.view.ViewGroup.LayoutParams
import android.widget.Button
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import com.google.android.gms.auth.api.phone.SmsRetriever
import org.microg.gms.ui.buildAlertDialog
import org.microg.gms.utils.getApplicationLabel

private const val TAG = "UserConsentPrompt"
Expand Down Expand Up @@ -53,10 +45,10 @@ class UserConsentPromptActivity : AppCompatActivity() {
@TargetApi(16)
private fun showConsentDialog(callingPackage: String, message: String) {
val view = layoutInflater.inflate(R.layout.dialog_sms_user_consent, null)
val dialog = AlertDialog.Builder(this).apply {
setCancelable(false)
setView(view)
}.create()
val dialog = buildAlertDialog()
.setCancelable(false)
.setView(view)
.create()
val appName = packageManager.getApplicationLabel(callingPackage)

view.findViewById<TextView>(android.R.id.title).text = Html.fromHtml(getString(R.string.sms_user_consent_title, Html.escapeHtml(appName)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sms_user_consent_title">Permitir <b>%s</b> à ler a mensagem abaixo e inserir o código?</string>
<string name="sms_user_consent_title">Permitir que <b>%s</b> leia mensagem abaixo e insira o código?</string>
<string name="sms_user_consent_allow">Permitir</string>
<string name="sms_user_consent_deny">Negar</string>
</resources>
9 changes: 9 additions & 0 deletions play-services-base/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {

implementation "androidx.annotation:annotation:$annotationVersion"
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.core:core-ktx:$coreVersion"
implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
Expand All @@ -31,10 +32,18 @@ android {
versionName version
minSdkVersion androidMinSdk
targetSdkVersion androidTargetSdk
if (localProperties.get("ichnaea.endpoint", "") != "") {
buildConfigField "String", "ICHNAEA_ENDPOINT_DEFAULT", "\"${localProperties.get("ichnaea.endpoint")}\""
} else if (localProperties.get("ichnaea.key", "") != "") {
buildConfigField "String", "ICHNAEA_ENDPOINT_DEFAULT", "\"https://location.services.mozilla.com/?key=${localProperties.get("ichnaea.key")}\""
} else {
buildConfigField "String", "ICHNAEA_ENDPOINT_DEFAULT", "\"\""
}
}

buildFeatures {
dataBinding = true
buildConfig = true
}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ public static <T> T request(String url, Request request, Class<T> tClass) throws
}

Log.d(TAG, "-- Request --\n" + content);
String replace = content.toString().trim().replace("\n", "");
OutputStream os = connection.getOutputStream();
os.write(content.toString().getBytes());
os.write(replace.trim().getBytes());
os.close();

if (connection.getResponseCode() != 200) {
Expand Down Expand Up @@ -117,7 +118,11 @@ private static String valueFromBoolVal(String value, Boolean boolVal, boolean tr
private static void appendParam(StringBuilder content, String key, String value) {
if (content.length() > 0)
content.append("&");
content.append(Uri.encode(key)).append("=").append(Uri.encode(String.valueOf(value)));
if (key.equals("token_request_options")) {
content.append(Uri.encode(key)).append("=").append(value);
} else {
content.append(Uri.encode(key)).append("=").append(Uri.encode(String.valueOf(value)));
}
}

private static <T> T parseResponse(Class<T> tClass, HttpURLConnection connection, String result) throws IOException {
Expand All @@ -138,6 +143,7 @@ private static <T> T parseResponse(Class<T> tClass, HttpURLConnection connection
for (Field field : tClass.getDeclaredFields()) {
if (field.isAnnotationPresent(ResponseField.class) &&
key.equals(field.getAnnotation(ResponseField.class).value())) {
field.setAccessible(true);
matched = true;
if (field.getType().equals(String.class)) {
field.set(response, value);
Expand All @@ -163,6 +169,7 @@ private static <T> T parseResponse(Class<T> tClass, HttpURLConnection connection
if (strings == null || strings.size() != 1) continue;
String value = strings.get(0);
try {
field.setAccessible(true);
if (field.getType().equals(String.class)) {
field.set(response, value);
} else if (field.getType().equals(boolean.class)) {
Expand All @@ -178,13 +185,15 @@ private static <T> T parseResponse(Class<T> tClass, HttpURLConnection connection
}
if (field.isAnnotationPresent(ResponseStatusCode.class) && field.getType() == int.class) {
try {
field.setAccessible(true);
field.setInt(response, connection.getResponseCode());
} catch (IllegalAccessException e) {
Log.w(TAG, e);
}
}
if (field.isAnnotationPresent(ResponseStatusText.class) && field.getType() == String.class) {
try {
field.setAccessible(true);
field.set(response, connection.getResponseMessage());
} catch (IllegalAccessException e) {
Log.w(TAG, e);
Expand Down

0 comments on commit e97ce0d

Please sign in to comment.