GeezerVison is showing github.com — feat: Pro版本更新4.5.8,支持CVE2026_43499漏洞(支持:高通+天玑,品牌:一加\OPPO\小米\红魔\联想Y700… · bufish/SKRoot-linuxKernelRoot@598ee4f
File treeExpand file treeCollapse file tree Open diff view settings java/com/linux/permissionmanager
testModule/kernel_module_kit/include/skroot_env
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/PermissionManager/app/build.gradle +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ android { | 10 | 10 | minSdk 26 | 11 | 11 | targetSdk 31 | 12 | 12 | versionCode 1 | 13 | | - versionName "4.5.6" | | 13 | + versionName "4.5.8" | 14 | 14 |
| 15 | 15 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | 16 | 16 | externalNativeBuild { | |
Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/PermissionManager/app/src/main/cpp/native-lib.cpp +9-8Lines changed: 9 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -85,17 +85,18 @@ static cJSON * moduleRecordToJsonObj(module_record & record) { | 85 | 85 | } | 86 | 86 |
| 87 | 87 | extern "C" JNIEXPORT jstring JNICALL | 88 | | -Java_com_linux_permissionmanager_bridge_NativeBridge_installSkrootEnv(JNIEnv* env, jclass /* this */, jstring rootKey, jstring installMode) { | | 88 | +Java_com_linux_permissionmanager_bridge_NativeBridge_installSkrootEnv(JNIEnv* env, jclass /* this */, jstring rootKey, jstring insMode, jstring insExploitMethod) { | 89 | 89 | string strRootKey = jstringToStr(env, rootKey); | 90 | | - string strInstallMode = jstringToStr(env, installMode); | 91 | | - InstallMode mode = InstallMode::Boot; | 92 | | - if(strInstallMode == "Boot") mode = InstallMode::Boot; | 93 | | - if(strInstallMode == "HotLoadReboot") mode = InstallMode::HotLoadReboot; | 94 | | - if(strInstallMode == "HotLoadNoReboot") mode = InstallMode::HotLoadNoReboot; | 95 | | - KModErr err = install_skroot_environment(strRootKey.c_str(), mode); | | 90 | + string strInsMode = jstringToStr(env, insMode); | | 91 | + string strExploitMethod = jstringToStr(env, insExploitMethod); | | 92 | + InstallMode mode = strInsMode == "Boot" ? InstallMode::Boot : InstallMode::HotLoad; | | 93 | + InstallConfig insConfig{}; | | 94 | + if(strExploitMethod == "MAGICA") insConfig.exploit = ExploitMethod::Magica; | | 95 | + if(strExploitMethod == "CVE-2026-43499") insConfig.exploit = ExploitMethod::CVE2026_43499; | | 96 | + KModErr err = install_skroot_environment(strRootKey.c_str(), mode, insConfig); | 96 | 97 | stringstream sstr; | 97 | 98 | sstr << "install_skroot_environment: " << to_string(err).c_str(); | 98 | | - if(is_ok(err) && mode != InstallMode::HotLoadNoReboot) sstr << ",将在重启后生效"; | | 99 | + if(is_ok(err)) sstr << ",可能会自动重启"; | 99 | 100 | return env->NewStringUTF(sstr.str().c_str()); | 100 | 101 | } | 101 | 102 |
| |
Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/PermissionManager/app/src/main/java/com/linux/permissionmanager/MainActivity.java +15-15Lines changed: 15 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 34 | 34 | import com.linux.permissionmanager.fragment.HomeFragment; | 35 | 35 | import com.linux.permissionmanager.fragment.SettingsFragment; | 36 | 36 | import com.linux.permissionmanager.fragment.SkrModFragment; | | 37 | +import com.linux.permissionmanager.model.HotloadMethod; | 37 | 38 | import com.linux.permissionmanager.utils.DialogUtils; | 38 | 39 | import com.linux.permissionmanager.utils.FileUtils; | 39 | 40 | import com.linux.permissionmanager.utils.GetAppListPermissionHelper; | @@ -50,7 +51,7 @@ public class MainActivity extends AppCompatActivity { | 50 | 51 | private String mRootKey = ""; | 51 | 52 | private boolean mIsHotloadMode = false; | 52 | 53 | private String mHotloadCmd = ""; | 53 | | - private String mHotloadMethod = ""; | | 54 | + private HotloadMethod mHotloadMethod = null; | 54 | 55 | private String mOneplusBypassResult = ""; | 55 | 56 |
| 56 | 57 | private HomeFragment mHomeFragm; | @@ -70,7 +71,7 @@ protected void onCreate(Bundle savedInstanceState) { | 70 | 71 | mRootKey = AppSettings.getString("rootKey", mRootKey); | 71 | 72 | mIsHotloadMode = AppSettings.getBoolean("isHotloadMode", mIsHotloadMode); | 72 | 73 | mHotloadCmd = AppSettings.getString("hotloadCmd", mHotloadCmd); | 73 | | - mHotloadMethod = AppSettings.getString("hotloadMethod", mHotloadMethod); | | 74 | + mHotloadMethod = HotloadMethod.fromConfig(AppSettings.getString("hotloadMethod", "")); | 74 | 75 | checkGetAppListPermission(); | 75 | 76 | showInputRootKeyDlg(); | 76 | 77 | setupFragment(""); | @@ -213,35 +214,34 @@ private String getCVE2026_43499GuideScript() { | 213 | 214 | "fi\n"; | 214 | 215 | } | 215 | 216 |
| 216 | | - private void executeHotloadScript(String script, String method) { | | 217 | + private void executeHotloadScript(String script, HotloadMethod method) { | 217 | 218 | if(TextUtils.isEmpty(script)) return; | 218 | 219 | DialogUtils.LogDialog logDlg = new DialogUtils.LogDialog(this, "正在加载热启动补丁,预计需要 1 分钟"); | 219 | 220 | logDlg.appendLine("[开始执行热启动补丁]"); | 220 | | - if (TextUtils.equals(method, "MAGICA")) { | 221 | | - executeMagicaRootScript(this, script, () -> { | 222 | | - onHotloadCompletionResult(logDlg::appendLine); | 223 | | - }, logDlg::appendLine); | 224 | | - } else if (TextUtils.equals(method, "SHELL")) { | | 221 | + if (method == HotloadMethod.MAGICA) { | | 222 | + executeMagicaRootScript(this, script, () -> onHotloadCompletionResult(logDlg), logDlg::appendLine); | | 223 | + } else if (method == HotloadMethod.SHELL) { | 225 | 224 | new Thread(() -> { | 226 | 225 | ShellUtils.executeScript(this, script, logDlg::appendLine); | 227 | | - onHotloadCompletionResult(logDlg::appendLine); | | 226 | + onHotloadCompletionResult(logDlg); | 228 | 227 | }).start(); | 229 | | - } else if (TextUtils.equals(method, "CVE-2026-43499")) { | | 228 | + } else if (method == HotloadMethod.CVE_2026_43499) { | 230 | 229 | new Thread(() -> { | 231 | 230 | ShellUtils.executeScript(this, getCVE2026_43499GuideScript() + script, logDlg::appendLine); | 232 | | - onHotloadCompletionResult(logDlg::appendLine); | | 231 | + onHotloadCompletionResult(logDlg); | 233 | 232 | }).start(); | 234 | 233 | } | 235 | 234 | } | 236 | 235 |
| 237 | 236 | private boolean isSkrootChannelOK(String rootKey) { return NativeBridge.testSkrootBasics(rootKey, "Channel").contains("OK"); } | 238 | 237 |
| 239 | | - private void onHotloadCompletionResult(Consumer<String> log) { | | 238 | + private void onHotloadCompletionResult(DialogUtils.LogDialog logDlg) { | 240 | 239 | runOnUiThread(() -> { | 241 | 240 | oneplusBypassWriteStage1(); | 242 | | - if(!TextUtils.isEmpty(mOneplusBypassResult)) log.accept("一加Oppo内部接口拦截日志(仅用于异常排查):\n" + mOneplusBypassResult); | | 241 | + if(!TextUtils.isEmpty(mOneplusBypassResult)) logDlg.appendLine("一加Oppo内部接口拦截日志(仅用于异常排查):\n" + mOneplusBypassResult); | 243 | 242 | new Handler(Looper.getMainLooper()).postDelayed(() -> { | 244 | 243 | if(isSkrootChannelOK(mRootKey)) { | | 244 | + logDlg.dismiss(); | 245 | 245 | DialogUtils.showMsgDlg(this, "提示","加载完成", null); | 246 | 246 | setupFragment(mRootKey); | 247 | 247 | switchPage(0); | @@ -332,13 +332,13 @@ private void showHotloadModeInputDlg() { | 332 | 332 | String method = extractConfigValue(scriptText, "METHOD"); | 333 | 333 | if (TextUtils.isEmpty(rootKey)) return; | 334 | 334 | mRootKey = rootKey; | 335 | | - mHotloadMethod = method; | | 335 | + mHotloadMethod = HotloadMethod.fromConfig(method); | 336 | 336 | mHotloadCmd = scriptText; | 337 | 337 | inputTxt.setText(mRootKey); | 338 | 338 | inputTxt.setEnabled(false); | 339 | 339 | AppSettings.setString("rootKey", mRootKey); | 340 | 340 | AppSettings.setString("hotloadCmd", mHotloadCmd); | 341 | | - AppSettings.setString("hotloadMethod", mHotloadMethod); | | 341 | + AppSettings.setString("hotloadMethod", mHotloadMethod.getConfigValue()); | 342 | 342 | }); | 343 | 343 |
| 344 | 344 | exportBtn.setOnClickListener(v -> { | |
Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/PermissionManager/app/src/main/java/com/linux/permissionmanager/bridge/NativeBridge.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | public final class NativeBridge { | 4 | 4 | static { System.loadLibrary("permissionmanager"); } | 5 | 5 |
| 6 | | - public static native String installSkrootEnv(String rootKey, String installMode); | | 6 | + public static native String installSkrootEnv(String rootKey, String insMode, String insExploitMethod); | 7 | 7 | public static native String uninstallSkrootEnv(String rootKey); | 8 | 8 | public static native String getSkrootEnvState(String rootKey); | 9 | 9 | public static native String getSystemStatusJson(); | |
Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/PermissionManager/app/src/main/java/com/linux/permissionmanager/fragment/HomeFragment.java +18-33Lines changed: 18 additions & 33 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | import static com.linux.permissionmanager.AppSettings.HOTLOAD_SHELL_PATH; | 4 | 4 |
| 5 | 5 | import android.app.Activity; | 6 | | -import android.graphics.Color; | 7 | 6 | import android.os.Bundle; | 8 | 7 | import android.os.Handler; | | 8 | +import android.os.Looper; | 9 | 9 | import android.os.Message; | 10 | | -import android.text.TextUtils; | 11 | 10 | import android.view.LayoutInflater; | 12 | 11 | import android.view.View; | 13 | 12 | import android.view.ViewGroup; | | 24 | 23 | import com.linux.permissionmanager.AppSettings; | 25 | 24 | import com.linux.permissionmanager.R; | 26 | 25 | import com.linux.permissionmanager.bridge.NativeBridge; | | 26 | +import com.linux.permissionmanager.model.HotloadMethod; | 27 | 27 | import com.linux.permissionmanager.utils.ClipboardUtils; | 28 | 28 | import com.linux.permissionmanager.utils.DialogUtils; | 29 | 29 |
| @@ -33,7 +33,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener { | 33 | 33 | private Activity mActivity; | 34 | 34 | private String mRootKey = ""; | 35 | 35 | private boolean mIsHotload = false; | 36 | | - private String mHotloadMethod = ""; | | 36 | + private HotloadMethod mHotloadMethod = null; | 37 | 37 | private String lastInputCmd = "id"; | 38 | 38 | private String lastInputRootExecPath = ""; | 39 | 39 |
| @@ -42,7 +42,7 @@ public class HomeFragment extends Fragment implements View.OnClickListener { | 42 | 42 | private TextView tvAdbStatus; | 43 | 43 | private TextView tvOneplusBypassStatus; | 44 | 44 | private EditText mConsoleEdit; | 45 | | - public HomeFragment(Activity activity, String rootKey, boolean isHotload, String hotloadMethod) { | | 45 | + public HomeFragment(Activity activity, String rootKey, boolean isHotload, HotloadMethod hotloadMethod) { | 46 | 46 | mActivity = activity; | 47 | 47 | mRootKey = rootKey; | 48 | 48 | mIsHotload = isHotload; | @@ -187,37 +187,22 @@ public void handleMessage(@NonNull Message msg) { | 187 | 187 | DialogUtils.showInputDlg(mActivity, lastInputCmd, "请输入ROOT命令", null, inputCallback, null); | 188 | 188 | } | 189 | 189 |
| 190 | | - enum InstallMode { | 191 | | - BOOT("Boot"), | 192 | | - HOTLOAD_REBOOT("HotLoadReboot"), | 193 | | - HOTLOAD_NO_REBOOT("HotLoadNoReboot"); | 194 | | - private final String nativeValue; | 195 | | - InstallMode(String nativeValue) { this.nativeValue = nativeValue; } | 196 | | - public String getNativeValue() { return nativeValue; } | 197 | | - } | 198 | | - | 199 | 190 | private void onClickInstallSkrootEnvBtn() { | 200 | | - String insMode = InstallMode.BOOT.getNativeValue(); | 201 | | - boolean isCve2026_43499 = TextUtils.equals(mHotloadMethod, "CVE-2026-43499"); | 202 | | - if(mIsHotload) { | 203 | | - insMode = isCve2026_43499 ? InstallMode.HOTLOAD_NO_REBOOT.getNativeValue() : InstallMode.HOTLOAD_REBOOT.getNativeValue(); | 204 | | - } | 205 | | - String err = NativeBridge.installSkrootEnv(mRootKey, insMode); | | 191 | + String err = NativeBridge.installSkrootEnv(mRootKey, mIsHotload ? "HotLoad" : "Boot", | | 192 | + mHotloadMethod != null ? mHotloadMethod.getConfigValue() : ""); | 206 | 193 | appendConsoleMsg(err); | 207 | | - if(mIsHotload && err.indexOf("OK") != -1) { | 208 | | - NativeBridge.runRootCmd(mRootKey, "rm -f " + HOTLOAD_SHELL_PATH); | 209 | | - | 210 | | - if(isCve2026_43499) { | 211 | | - DialogUtils.showCustomDialog(mActivity, "确认", "请问要软重启吗?\n\n提示:当前环境已安装完成!模块也已激活。一般不需要软重启,当使用特殊模块(如改机型)才需要进行软重启。",null, | 212 | | - "不需要", (dialog, which) -> { | 213 | | - dialog.dismiss(); | 214 | | - showSkrootStatus(); | 215 | | - }, "软重启", (dialog, which) -> { | 216 | | - dialog.dismiss(); | 217 | | - NativeBridge.restartZygote64(mRootKey); | 218 | | - } | 219 | | - ); | 220 | | - } | | 194 | + if(mIsHotload && err.indexOf("OK") != -1) NativeBridge.runRootCmd(mRootKey, "rm -f " + HOTLOAD_SHELL_PATH); | | 195 | + if(mHotloadMethod == HotloadMethod.CVE_2026_43499) { | | 196 | + DialogUtils.showCustomDialog(mActivity, "确认", "请问要软重启吗?\n\n提示:当前环境已安装完成!模块也已激活。一般不需要软重启,当使用特殊模块(如改机型)才需要进行软重启。",null, | | 197 | + "不需要", (dialog, which) -> { | | 198 | + dialog.dismiss(); | | 199 | + appendConsoleMsg("启动中,请稍后"); | | 200 | + new Handler(Looper.getMainLooper()).postDelayed(() -> showSkrootStatus(), 2000); | | 201 | + }, "软重启", (dialog, which) -> { | | 202 | + dialog.dismiss(); | | 203 | + NativeBridge.restartZygote64(mRootKey); | | 204 | + } | | 205 | + ); | 221 | 206 | } | 222 | 207 | } | 223 | 208 |
| |
Collapse file Copy file name to clipboard +16Lines changed: 16 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +package com.linux.permissionmanager.model; | | 2 | +public enum HotloadMethod { | | 3 | + MAGICA("MAGICA"), | | 4 | + SHELL("SHELL"), | | 5 | + CVE_2026_43499("CVE-2026-43499"); | | 6 | + private final String configValue; | | 7 | + HotloadMethod(String configValue) { this.configValue = configValue; } | | 8 | + public String getConfigValue() { return configValue; } | | 9 | + public static HotloadMethod fromConfig(String value) { | | 10 | + if (value == null || value.isEmpty()) return null; | | 11 | + for (HotloadMethod m : values()) { | | 12 | + if (m.configValue.equalsIgnoreCase(value)) return m; | | 13 | + } | | 14 | + return null; | | 15 | + } | | 16 | +} |
Collapse file Copy file name to clipboardExpand all lines: Pro(众测开放中)/src/testModule/kernel_module_kit/include/skroot_env/skroot_installer.h +18-6Lines changed: 18 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,19 +7,31 @@ namespace skroot_env { | 7 | 7 |
| 8 | 8 | // SKRoot 环境安装策略 | 9 | 9 | enum class InstallMode : uint32_t { | 10 | | - Boot = 0, // 刷 Boot 模式(固化到内核,自动重启) | 11 | | - HotLoadReboot = 1, // 热启动模式(自动重启) | 12 | | - HotLoadNoReboot = 2, // 热启动模式(不自动重启) | | 10 | + Boot = 0, // 刷 Boot 模式(固化到内核,自动重启) | | 11 | + HotLoad = 1, // 热启动模式 | | 12 | +}; | | 13 | + | | 14 | +// 使用的漏洞策略 | | 15 | +enum class ExploitMethod : uint32_t { | | 16 | + None = 0, // 无(默认,不使用特定漏洞) | | 17 | + Magica = 1, // Magica 漏洞方式 | | 18 | + CVE2026_43499 = 2, // CVE-2026-43499 漏洞方式 | | 19 | +}; | | 20 | + | | 21 | +// SKRoot 环境安装配置 | | 22 | +struct InstallConfig { | | 23 | + ExploitMethod exploit = ExploitMethod::None; // 使用的漏洞策略 | 13 | 24 | }; | 14 | 25 |
| 15 | 26 | /*************************************************************************** | 16 | 27 | * 安装 SKRoot 环境 | 17 | 28 | * 说明: 首次使用前必须调用此函数,用于创建 SKRoot 所需的环境文件。 | 18 | | - * 参数: root_key ROOT权限密钥文本 | 19 | | - * mode 部署模式 (默认为刷 Boot 模式) | | 29 | + * 参数: root_key ROOT权限密钥文本 | | 30 | + * mode 部署模式 (默认为刷 Boot 模式) | | 31 | + * config 安装配置 (默认为无特定漏洞) | 20 | 32 | * 返回: OK 表示成功;其它值为错误码 | 21 | 33 | ***************************************************************************/ | 22 | | -KModErr install_skroot_environment(const char* root_key, InstallMode mode = InstallMode::Boot); | | 34 | +KModErr install_skroot_environment(const char* root_key, InstallMode mode = InstallMode::Boot, const InstallConfig& config = InstallConfig()); | 23 | 35 |
| 24 | 36 | /*************************************************************************** | 25 | 37 | * 卸载 SKRoot 环境 | |
|