xiongzhu 1 سال پیش
والد
کامیت
3e0dd814e7

+ 1 - 1
app/build.gradle

@@ -24,7 +24,7 @@ android {
         applicationId "com.example.modifier"
         minSdk 29
         targetSdk 34
-        versionCode 125
+        versionCode 126
         versionName "1.0.1"
         archivesBaseName = "modifier-${versionCode}"
 

+ 12 - 0
app/src/main/java/com/example/modifier/ui/utils/UtilsFragment.kt

@@ -260,6 +260,18 @@ class UtilsFragment : Fragment() {
             }
         }
 
+        binding.btnUpdateGms.setOnClickListener {
+            lifecycleScope.launch {
+                try {
+                    val config = KtorClient.get(SysConfigApi.Id(SysConfigApi(), "gms_apk"))
+                        .body<SysConfigResponse>()
+                    installApk(config.value)
+                } catch (e: Exception) {
+                    Log.e("Modifier", "Failed to get gms apk", e)
+                }
+            }
+        }
+
         return binding.root
     }
 

+ 7 - 0
app/src/main/res/layout/fragment_utils.xml

@@ -288,6 +288,13 @@
                                 android:layout_height="wrap_content"
                                 android:layout_marginLeft="8dp"
                                 android:text="Message" />
+
+                            <com.google.android.material.button.MaterialButton
+                                android:id="@+id/btn_update_gms"
+                                android:layout_width="wrap_content"
+                                android:layout_height="wrap_content"
+                                android:layout_marginLeft="8dp"
+                                android:text="GMS" />
                         </LinearLayout>
 
                         <com.google.android.material.textfield.TextInputLayout