Skip to content

Commit

Permalink
Support Andorid 15 beta 4.2
Browse files Browse the repository at this point in the history
In Android 15, class ParsedPackage is in the package `com.android.internal.pm.parsing.pkg`.
See https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/core/java/com/android/internal/pm/parsing/pkg/ParsedPackage.java;

The module is tested with [JingMatrix/LSPosed](https://github.com/JingMatrix/LSPosed) on Android 15 beta 4.2
  • Loading branch information
JingMatrix committed Aug 18, 2024
1 parent 50ea8e0 commit 38764de
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Disable signature verification For Android
branch master -> support android 4.4-7.x
Android8.x -> maybe you need find the commit what change version name to 2.1,then compile by you self
branch Q -> support android 9.0-10.0
branch main -> support android 10-14
branch main -> support android 10-15
```

## Features
Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ val releaseKeyAlias: String? by rootProject
val releaseKeyPassword: String? by rootProject

android {
compileSdk = 34
buildToolsVersion = "34.0.0"
compileSdk = 35
buildToolsVersion = "35.0.0"
defaultConfig {
applicationId = "com.coderstory.toolkit"
minSdk = 28
targetSdk = 34
targetSdk = 35
versionCode = 2019
versionName = "4.5"
}
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/toolkit/coderstory/CorePatchForT.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ protected void beforeHookedMethod(MethodHookParam param) {
}
});

Class<?> ParsedPackage = getParsedPackage(loadPackageParam.classLoader);
findAndHookMethod("com.android.server.pm.InstallPackageHelper", loadPackageParam.classLoader,
"doesSignatureMatchForPermissions", String.class,
"com.android.server.pm.parsing.pkg.ParsedPackage", int.class, new XC_MethodHook() {
ParsedPackage, int.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) {
if (prefs.getBoolean("digestCreak", true) && prefs.getBoolean("UsePreSig", false)) {
Expand Down Expand Up @@ -90,6 +91,10 @@ protected void afterHookedMethod(MethodHookParam param) {
}
}

Class<?> getParsedPackage(ClassLoader classLoader) {
return XposedHelpers.findClassIfExists("com.android.server.pm.parsing.pkg.ParsedPackage", classLoader);
}

Class<?> getSigningDetails(ClassLoader classLoader) {
return XposedHelpers.findClassIfExists("android.content.pm.SigningDetails", classLoader);
}
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/java/toolkit/coderstory/CorePatchForV.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package toolkit.coderstory;

import java.lang.reflect.InvocationTargetException;

import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.callbacks.XC_LoadPackage;

public class CorePatchForV extends CorePatchForU {
@Override
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws IllegalAccessException, InvocationTargetException, InstantiationException {
super.handleLoadPackage(loadPackageParam);
}

@Override
Class<?> getParsedPackage(ClassLoader classLoader) {
return XposedHelpers.findClassIfExists("com.android.internal.pm.parsing.pkg.ParsedPackage", classLoader);
}
}
3 changes: 3 additions & 0 deletions app/src/main/java/toolkit/coderstory/MainHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Th
if (BuildConfig.DEBUG)
XposedBridge.log("D/" + TAG + " handleLoadPackage");
switch (Build.VERSION.SDK_INT) {
case Build.VERSION_CODES.VANILLA_ICE_CREAM: // 35
new CorePatchForV().handleLoadPackage(lpparam);
break;
case Build.VERSION_CODES.UPSIDE_DOWN_CAKE: // 34
new CorePatchForU().handleLoadPackage(lpparam);
break;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Patch pour Android 9–14</string>
<string name="module_description">Patch pour Android 9-15</string>
<string name="corepatch">Cette version est pour 10–14 uniquement.\nMerci d\’utiliser la dernière version de LSPosed.</string>
<string name="downgr">Permettre la rétrogradation</string>
<string name="downgr_summary">Permettre la rétrogradation d\’applications.</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-in/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="corepatch">Versi ini adalah untuk Android 9-14 saja.\nHarap gunakan versi LSPosed terbaru.</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="corepatch">Versi ini adalah untuk Android 9-15 saja.\nHarap gunakan versi LSPosed terbaru.</string>
<string name="downgr">Izinkan turun versi</string>
<string name="downgr_summary">Izinkan turun versi aplikasi.</string>
<string name="authcreak">Matikan verifikasi digest</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="corepatch">Questa versione è solo per Android 9–14.\nPer favore utilizza la versione più recente di LSPosed.</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="corepatch">Questa versione è solo per Android 9-15.\nPer favore utilizza la versione più recente di LSPosed.</string>
<string name="downgr">Consenti ​​Downgrade</string>
<string name="downgr_summary">Consenti il ​​downgrade delle applicazioni.</string>
<string name="authcreak">Disabilita verifica digest</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 コアパッチ</string>
<string name="corepatch">このバージョンは、 Android 9–14 のみで動作します。\n最新版の LSPosed を使用してください。</string>
<string name="module_description">Android 9-15 コアパッチ</string>
<string name="corepatch">このバージョンは、 Android 9-15 のみで動作します。\n最新版の LSPosed を使用してください。</string>
<string name="downgr">ダウングレードを許可する</string>
<string name="downgr_summary">アプリのダウングレードを許可します。</string>
<string name="authcreak">ダイジェストの検証を無効化する</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="corepatch">이 버전은 Android 9–14 전용입니다.\nLSPosed의 최신 버전을 사용하십시오.</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="corepatch">이 버전은 Android 9-15 전용입니다.\nLSPosed의 최신 버전을 사용하십시오.</string>
<string name="downgr">다운그레이드 허용</string>
<string name="downgr_summary">애플리케이션 다운그레이드를 허용합니다.</string>
<string name="authcreak">다이제스트 확인 비활성화</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-pt-rBR/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="corepatch">Esta versão é apenas para Android 9–14.\nPor favor, use a versão mais recente do LSPosed.</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="corepatch">Esta versão é apenas para Android 9-15.\nPor favor, use a versão mais recente do LSPosed.</string>
<string name="downgr">Permitir downgrade</string>
<string name="downgr_summary">Permite downgrade de apps</string>
<string name="authcreak">Desativar verificação de integridade</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<string name="app_name">Core Patch</string>
<string name="authcreak">Отключить проверку дайджеста</string>
<string name="authcreak_summary">Позволяет устанавливать приложения после изменения файла в apk (игнорировать недопустимую ошибку дайджеста).</string>
<string name="corepatch">«Эта версия предназначена только для Android 9–14.
<string name="corepatch">«Эта версия предназначена только для Android 9-15.
Пожалуйста, используйте последнюю версию LSPposed. "</string>
<string name="digestCreak">Отключить сравнение подписей</string>
<string name="digestCreak_summary">Разрешить переустановку приложения с другими подписями.</string>
Expand All @@ -16,7 +16,7 @@
<string name="enhancedMode">Расширенный режим</string>
<string name="enhancedMode_summary">Пройдите некоторую проверку в приложении</string>
<string name="ignore">Игнорировать</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="not_supported">Похоже, вы используете устаревшую версию LSPposed или LSPposed не активирован, пожалуйста, обновите LSPposed или повторите попытку после активации.</string>
<string name="settings">Настройки</string>
</resources>
4 changes: 2 additions & 2 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">核心破解</string>
<string name="module_description">Android 9–14 核心破解</string>
<string name="corepatch">此版本只支持 Android 9–14\n请安装最新版本的 LSPosed 框架,否则功能可能无法正确启用。</string>
<string name="module_description">Android 9-15 核心破解</string>
<string name="corepatch">此版本只支持 Android 9-15\n请安装最新版本的 LSPosed 框架,否则功能可能无法正确启用。</string>
<string name="downgr">允许降级安装应用</string>
<string name="downgr_summary">允许应用在安装新版本的情况下直接覆盖安装旧版本</string>
<string name="authcreak">禁用软件包管理器签名验证</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">核心修補</string>
<string name="module_description">Android 9–14 核心修補</string>
<string name="corepatch">此版本只支援 Android 9–14\n請安裝最新版本的 LSPosed 框架,否則功能可能無法正確啟用。</string>
<string name="module_description">Android 9-15 核心修補</string>
<string name="corepatch">此版本只支援 Android 9-15\n請安裝最新版本的 LSPosed 框架,否則功能可能無法正確啟用。</string>
<string name="downgr">允許降版安裝應用程式</string>
<string name="downgr_summary">允許應用程式在安裝新版本的情況下直接覆蓋安裝舊版本</string>
<string name="authcreak">停用套裝安裝程式簽名驗證</string>
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Core Patch</string>
<string name="module_description">Android 9–14 core patch</string>
<string name="corepatch">This version is for Android 9–14 only.\nPlease use the latest version of the LSPosed.</string>
<string name="module_description">Android 9-15 core patch</string>
<string name="corepatch">This version is for Android 9-15 only.\nPlease use the latest version of the LSPosed.</string>
<string name="downgr">Allow downgrade</string>
<string name="downgr_summary">Allow downgrade applications.</string>
<string name="authcreak">Disable digest verify</string>
Expand Down

0 comments on commit 38764de

Please sign in to comment.