Skip to content

Commit

Permalink
Merge branch 'master' into dev_games
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in authored Dec 18, 2024
2 parents 09c685a + 107083e commit 29c2b66
Show file tree
Hide file tree
Showing 318 changed files with 14,198 additions and 1,210 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ buildscript {
ext.slf4jVersion = '1.7.36'
ext.volleyVersion = '1.2.1'
ext.wireVersion = '4.8.0'
ext.tinkVersion = '1.13.0'

ext.androidBuildGradleVersion = '8.2.2'

Expand Down Expand Up @@ -68,7 +69,7 @@ def execResult(... args) {
}

def ignoreGit = providers.environmentVariable('GRADLE_MICROG_VERSION_WITHOUT_GIT').getOrElse('0') == '1'
def gmsVersion = "24.09.13"
def gmsVersion = "24.47.35"
def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', ''))
def vendingVersion = "40.2.26"
def vendingVersionCode = Integer.parseInt(vendingVersion.replaceAll('\\.', ''))
Expand Down
1 change: 1 addition & 0 deletions firebase-dynamic-links/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies {
// api project(':firebase-common-ktx')
// api project(':firebase-components')
api 'org.jetbrains.kotlin:kotlin-stdlib:1.7.10'
annotationProcessor project(':safe-parcel-processor')
}

apply from: '../gradle/publish-android.gradle'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import android.os.Parcel;
import androidx.annotation.NonNull;
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;

import android.os.Bundle;
import android.net.Uri;
import org.microg.gms.utils.ToStringHelper;

@SafeParcelable.Class
public class DynamicLinkData extends AbstractSafeParcelable {
@Field(1)
public final String dynamicLink;
Expand All @@ -35,6 +37,7 @@ public class DynamicLinkData extends AbstractSafeParcelable {
@Field(6)
public final Uri redirectUrl;

@Constructor
public DynamicLinkData(@Param(1) String dynamicLink, @Param(2) String deepLink, @Param(3) int minVersion, @Param(4) long clickTimestamp, @Param(5) Bundle extensionBundle, @Param(6) Uri redirectUrl) {
this.dynamicLink = dynamicLink;
this.deepLink = deepLink;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_notification_label">إشعار معرّف الإعلان</string>
<string name="perm_ad_id_label">إذن معرّف الإعلان</string>
<string name="perm_ad_id_notification_description">يتيح للتطبيق تلقي إشعار عند تحديث معرّف الإعلان أو تحديد تفضيلات تتبع الإعلانات للمستخدم.</string>
<string name="perm_ad_id_description">يتيح لتطبيق الناشر بالوصول إلى معرف إعلان صالح بشكل مباشر أو غير مباشر.</string>
<string name="perm_ad_id_notification_label">إشعار مُعَرِّف الإعلان</string>
<string name="perm_ad_id_label">إذن مُعَرِّف الإعلان</string>
<string name="perm_ad_id_notification_description">يتيح للتطبيق تلقي إشعار عند تحديث مُعَرِّف الإعلان أو تحديد تفضيلات تتبع الإعلانات للمستخدم.</string>
<string name="perm_ad_id_description">يتيح لتطبيق الناشر بالوصول إلى مُعَرِّف إعلان صالح بشكل مباشر أو غير مباشر.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="perm_ad_id_label">Permission de l\'identifiant publicitaire</string>
<string name="perm_ad_id_description">Autorise une application affichant de la publicité à accéder directement ou indirectement à un identifiant publicitaire valide.</string>
<string name="perm_ad_id_notification_label">Notification de l\'identifiant publicitaire</string>
<string name="perm_ad_id_notification_description">Autorise une application à être notifiée de la modification de l\'identifiant publicitaire ou de la limitation du suivi publicitaire de l\'utilisateur.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_label">อนุญาติรหัสประจำตัวของโฆษณา</string>
<string name="perm_ad_id_notification_label">การแจ้งเตือน รหัสประจำตัวของโฆษณา</string>
<string name="perm_ad_id_description">อนุญาตให้แอปผู้เผยแพร่เข้าถึง รหัสประจำตัวของโฆษณาที่ถูกต้องได้โดยตรงหรือโดยอ้อม</string>
<string name="perm_ad_id_notification_description">อนุญาตให้แอปรับการแจ้งเตือนเมื่อมีการอัปเดต รหัสประจำตัวของโฆษณา หรือ การตั้งค่าการติดตามโฆษณาของผู้ใช้</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="perm_ad_id_label">Reklam kimliği izni</string>
<string name="perm_ad_id_notification_label">Reklam kimliği bildirimi</string>
<string name="perm_ad_id_notification_description">Bir uygulamanın, kullanıcının reklam takibini kısıtlama ayarını veya reklam kimliğini değiştirdiğinde bildirim almasına izin verir.</string>
<string name="perm_ad_id_description">Bir uygulamanın geçerli bir reklam kimliğine doğrudan veya dolaylı olarak erişmesine izin verir.</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="perm_ad_id_notification_description">Cho phép một ứng dụng nhận được thông báo khi ID quảng cáo hoặc giới hạn tùy chọn theo dõi quảng cáo của người dùng được cập nhật.</string>
<string name="perm_ad_id_label">Quyền của Mã Quảng cáo</string>
<string name="perm_ad_id_notification_label">Thông báo của Mã Quảng cáo</string>
<string name="perm_ad_id_description">Cho phép ứng dụng của nhà xuất bản truy cập trực tiếp hoặc gián tiếp vào một mã quảng cáo hợp lệ.</string>
<string name="perm_ad_id_notification_description">Cho phép ứng dụng nhận thông báo khi ID quảng cáo hoặc tùy chọn giới hạn theo dõi quảng cáo của người dùng được cập nhật.</string>
<string name="perm_ad_id_label">Quyền ID quảng cáo</string>
<string name="perm_ad_id_notification_label">Thông báo ID quảng cáo</string>
<string name="perm_ad_id_description">Cho phép ứng dụng của nhà xuất bản truy cập trực tiếp hoặc gián tiếp vào ID quảng cáo hợp lệ.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,21 @@
*/
package com.google.android.gms.ads.measurement

import android.os.Parcel
import android.util.Log
import androidx.annotation.Keep
import com.google.android.gms.dynamic.IObjectWrapper
import org.microg.gms.utils.warnOnTransactionIssues

private const val TAG = "DynamiteMeasurement"

@Keep
class DynamiteMeasurementManager : IMeasurementManager.Stub()
class DynamiteMeasurementManager : IMeasurementManager.Stub() {

override fun initialize(context: IObjectWrapper?, proxy: IAppMeasurementProxy?) {
Log.d(TAG, "Not yet implemented: initialize")
}

override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean =
warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.google.android.gms.ads.measurement;

interface IAppMeasurementProxy {

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.google.android.gms.ads.measurement;

interface IMeasurementManager {
import com.google.android.gms.ads.measurement.IAppMeasurementProxy;
import com.google.android.gms.dynamic.IObjectWrapper;

interface IMeasurementManager {
void initialize(IObjectWrapper context, IAppMeasurementProxy proxy) = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,27 @@

package com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite;

import android.content.Context;
import android.content.ContextWrapper;
import android.webkit.WebSettings;
import androidx.annotation.Keep;

@Keep
public class ModuleDescriptor {
public static final String MODULE_ID = "com.google.android.gms.ads.dynamite";
public static final int MODULE_VERSION = 230500001;

/**
* The ads module might try to access the user agent, requiring initialization on the main thread,
* which may result in deadlocks when invoked from any other thread. This only happens with microG,
* because we don't use the highly privileged SELinux Sandbox that regular Play Services uses
* (which allows apps to read the user-agent from Play Services instead of the WebView). To prevent
* the issue we pre-emptively initialize the WebView.
*/
public static void init(Context context) {
if (context instanceof ContextWrapper) {
context = ((ContextWrapper) context).getBaseContext();
}
WebSettings.getDefaultUserAgent(context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ import androidx.core.view.setPadding
import androidx.lifecycle.lifecycleScope
import com.android.volley.*
import com.android.volley.toolbox.Volley
import com.google.android.gms.common.internal.safeparcel.SafeParcelableSerializer
import com.google.firebase.dynamiclinks.internal.DynamicLinkData
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import kotlinx.coroutines.CompletableDeferred
import okio.ByteString.Companion.decodeHex
import org.microg.gms.appinvite.*
import org.microg.gms.common.Constants
import org.microg.gms.utils.singleInstanceOf
import org.microg.gms.utils.toBase64
import java.util.*

private const val TAG = "AppInviteActivity"
Expand All @@ -37,6 +38,7 @@ private const val APPINVITE_DEEP_LINK = "com.google.android.gms.appinvite.DEEP_L
private const val APPINVITE_INVITATION_ID = "com.google.android.gms.appinvite.INVITATION_ID"
private const val APPINVITE_OPENED_FROM_PLAY_STORE = "com.google.android.gms.appinvite.OPENED_FROM_PLAY_STORE"
private const val APPINVITE_REFERRAL_BUNDLE = "com.google.android.gms.appinvite.REFERRAL_BUNDLE"
private const val DYNAMIC_LINK_DATA = "com.google.firebase.dynamiclinks.DYNAMIC_LINK_DATA"

class AppInviteActivity : AppCompatActivity() {
private val queue by lazy { singleInstanceOf { Volley.newRequestQueue(applicationContext) } }
Expand Down Expand Up @@ -71,6 +73,8 @@ class AppInviteActivity : AppCompatActivity() {
}

private fun open(appInviteLink: MutateAppInviteLinkResponse) {
val dynamicLinkData = DynamicLinkData(appInviteLink.metadata?.info?.url, appInviteLink.data_?.intentData,
(appInviteLink.data_?.app?.minAppVersion ?: 0).toInt(), System.currentTimeMillis(), null, null)
val intent = Intent(Intent.ACTION_VIEW).apply {
addCategory(Intent.CATEGORY_DEFAULT)
data = appInviteLink.data_?.intentData?.let { Uri.parse(it) }
Expand All @@ -83,17 +87,31 @@ class AppInviteActivity : AppCompatActivity() {
APPINVITE_OPENED_FROM_PLAY_STORE to false
)
)
putExtra(DYNAMIC_LINK_DATA, SafeParcelableSerializer.serializeToBytes(dynamicLinkData))
}
val fallbackIntent = Intent(Intent.ACTION_VIEW).apply {
addCategory(Intent.CATEGORY_DEFAULT)
data = appInviteLink.data_?.fallbackUrl?.let { Uri.parse(it) }
}
val installedVersionCode = runCatching {
intent.resolveActivity(packageManager)?.let {
PackageInfoCompat.getLongVersionCode(packageManager.getPackageInfo(it.packageName, 0))
if (appInviteLink.data_?.packageName != null) {
PackageInfoCompat.getLongVersionCode(packageManager.getPackageInfo(appInviteLink.data_.packageName, 0))
} else {
null
}
}.getOrNull()
if (installedVersionCode != null && (appInviteLink.data_?.app?.minAppVersion == null || installedVersionCode >= appInviteLink.data_.app.minAppVersion)) {
val componentName = intent.resolveActivity(packageManager)
if (componentName == null) {
Log.w(TAG, "open resolve activity is null")
if (appInviteLink.data_?.packageName != null) {
val intentLaunch =
packageManager.getLaunchIntentForPackage(appInviteLink.data_.packageName)
if (intentLaunch != null) {
intent.setComponent(intentLaunch.component)
}
}
}
startActivity(intent)
finish()
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="sms_user_consent_title">Autoriser <b>%s</b> à lire le message ci-dessous et saisir le code ?</string>
<string name="sms_user_consent_allow">Autoriser</string>
<string name="sms_user_consent_deny">Refuser</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="sms_user_consent_title"><b>%s</b> toestaan het onderstaande bericht te lezen en de code in te voeren?</string>
<string name="sms_user_consent_allow">Toestaan</string>
<string name="sms_user_consent_deny">Niet toestaan</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sms_user_consent_title">อนุญาตให้ <b>%s</b> อ่านข้อความด้านล่างและกรอกรหัส?</string>
<string name="sms_user_consent_allow">อนุญาต</string>
<string name="sms_user_consent_deny">ปฏิเสธ</string>
</resources>
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>
<resources>
<string name="sms_user_consent_allow">İzin ver</string>
<string name="sms_user_consent_title"><b>%s</b> uygulamasının aşağıdaki mesajı okumasına ve kodu girmesine izin veriyor musunuz?</string>
<string name="sms_user_consent_deny">Reddet</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
public class DeviceConfiguration {
public List<String> availableFeatures;
public int densityDpi;
public double diagonalInch;
public int glEsVersion;
public List<String> glExtensions;
public boolean hasFiveWayNavigation;
Expand Down Expand Up @@ -92,6 +93,10 @@ public DeviceConfiguration(Context context) {
this.nativePlatforms = getNativePlatforms();
widthPixels = displayMetrics.widthPixels;
heightPixels = displayMetrics.heightPixels;
diagonalInch = Math.sqrt(
Math.pow(widthPixels / displayMetrics.xdpi, 2) +
Math.pow(heightPixels / displayMetrics.ydpi, 2)
);
locales = getLocales(context);
Set<String> glExtensions = new HashSet<String>();
addEglExtensions(glExtensions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static <T> T request(String url, Request request, Class<T> tClass) throws
} catch (IOException e) {
// Ignore
}
throw new IOException(error);
throw new NotOkayException(error);
}

String result = new String(Utils.readStreamToEnd(connection.getInputStream()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.microg.gms.common;

import java.io.IOException;

public class NotOkayException extends IOException {
public NotOkayException() {
}

public NotOkayException(String message) {
super(message);
}

public NotOkayException(String message, Throwable cause) {
super(message, cause);
}

public NotOkayException(Throwable cause) {
super(cause);
}
}
Loading

0 comments on commit 29c2b66

Please sign in to comment.