Dataset Viewer
Auto-converted to Parquet
code
stringlengths
1.51k
10.6k
apis
sequencelengths
1
33
extract_api
stringlengths
74
24.3k
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler; import com.github.kyuubiran.ezxhelper.EzXHelper; import com.sevtinge.hyperceiler.module.app.SystemFrameworkForCorePatch; import com.sevtinge.hyperceiler.module.base.BaseXposedInit; import com.sevtinge.hyperceiler.module.hook.home.other.AllowShareApk; import com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor; import com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom; import com.sevtinge.hyperceiler.module.hook.systemframework.AllowManageAllNotifications; import com.sevtinge.hyperceiler.module.hook.systemframework.AllowUninstall; import com.sevtinge.hyperceiler.module.hook.systemframework.BackgroundBlurDrawable; import com.sevtinge.hyperceiler.module.hook.systemframework.CleanOpenMenu; import com.sevtinge.hyperceiler.module.hook.systemframework.CleanShareMenu; import com.sevtinge.hyperceiler.module.hook.systemframework.ScreenRotation; import com.sevtinge.hyperceiler.module.hook.systemsettings.VolumeSeparateControlForSettings; import com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom; import com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc; import de.robv.android.xposed.IXposedHookInitPackageResources; import de.robv.android.xposed.IXposedHookLoadPackage; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.callbacks.XC_InitPackageResources; import de.robv.android.xposed.callbacks.XC_LoadPackage; public class XposedInit extends BaseXposedInit implements IXposedHookInitPackageResources, IXposedHookZygoteInit, IXposedHookLoadPackage { private final String TAG = "HyperCeiler"; @Override public void initZygote(IXposedHookZygoteInit.StartupParam startupParam) throws Throwable { super.initZygote(startupParam); EzXHelper.initZygote(startupParam); EzXHelper.setLogTag(TAG); EzXHelper.setToastTag(TAG); if (mPrefsMap.getBoolean("system_framework_allow_uninstall")) new AllowUninstall().initZygote(startupParam); if (mPrefsMap.getBoolean("system_framework_screen_all_rotations")) ScreenRotation.initRes(); if (mPrefsMap.getBoolean("system_framework_clean_share_menu")) CleanShareMenu.initRes(); if (mPrefsMap.getBoolean("system_framework_clean_open_menu")) CleanOpenMenu.initRes(); if (mPrefsMap.getBoolean("system_framework_volume_separate_control")) VolumeSeparateControlForSettings.initRes(); if (mPrefsMap.getBoolean("system_framework_allow_manage_all_notifications")) new AllowManageAllNotifications().initZygote(startupParam); if (startupParam != null) { new BackgroundBlurDrawable().initZygote(startupParam); new SystemFrameworkForCorePatch().initZygote(startupParam); } } @Override public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { if ("com.miui.contentcatcher".equals(lpparam.packageName) || "com.miui.catcherpatch".equals(lpparam.packageName)) { return; } init(lpparam); new SystemFrameworkForCorePatch().handleLoadPackage(lpparam); } @Override public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable { switch (resparam.packageName) { case "com.miui.tsmclient": if (mPrefsMap.getBoolean("tsmclient_auto_nfc")) { AutoNfc.INSTANCE.initResource(resparam); } break; case "com.miui.home": if (mPrefsMap.getBoolean("home_other_icon_monet_color")) { EnableIconMonetColor.INSTANCE.initResource(resparam); } if (mPrefsMap.getBoolean("home_other_allow_share_apk")) { new AllowShareApk().initResource(resparam); } break; case "com.miui.securitycenter": if (mPrefsMap.getBoolean("security_center_sidebar_line_color")) { SidebarLineCustom.INSTANCE.initResource(resparam); } break; case "com.android.systemui": if (mPrefsMap.getBoolean("system_ui_navigation_handle_custom")) { HandleLineCustom.INSTANCE.initResource(resparam); } break; } } }
[ "com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom.INSTANCE.initResource", "com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc.INSTANCE.initResource" ]
[((4200, 4239), 'com.sevtinge.hyperceiler.module.hook.tsmclient.AutoNfc.INSTANCE.initResource'), ((4412, 4464), 'com.sevtinge.hyperceiler.module.hook.home.title.EnableIconMonetColor.INSTANCE.initResource'), ((4810, 4859), 'com.sevtinge.hyperceiler.module.hook.securitycenter.SidebarLineCustom.INSTANCE.initResource'), ((5046, 5094), 'com.sevtinge.hyperceiler.module.hook.systemui.navigation.HandleLineCustom.INSTANCE.initResource')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import com.sevtinge.hyperceiler.callback.ITAG; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import java.util.ArrayList; /** * @noinspection UnusedReturnValue */ public class KillApp { public static boolean killApps(String pkg) { return killApps(new String[]{pkg}); } public static boolean killApps(String... pkgs) { if (pkgs == null) { AndroidLogUtils.logE(ITAG.TAG, "The list of package names cannot be null!"); return false; } boolean result = false; if (pkgs.length == 0) { AndroidLogUtils.logE(ITAG.TAG, "The length of the packet name array cannot be 0!"); return false; } for (String pkg : pkgs) { if (pkg == null) continue; if (pkg.isEmpty()) continue; result = ShellInit.getShell().add("pid=$(pgrep -f \"" + pkg + "\" | grep -v $$)") .add("if [[ $pid == \"\" ]]; then") .add(" pids=\"\"") .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \"" + pkg + "\" | grep -v \"grep\")") .add(" for i in $pid; do") .add(" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \"\" ]]; then") .add(" if [[ $pids == \"\" ]]; then") .add(" pids=$i") .add(" else") .add(" pids=\"$pids $i\"") .add(" fi") .add(" fi") .add(" done") .add("fi") .add("if [[ $pids != \"\" ]]; then") .add(" pid=$pids") .add("fi") .add("if [[ $pid != \"\" ]]; then") .add(" for i in $pid; do") .add(" kill -s 15 $i &>/dev/null") .add(" done") .add("else") .add(" echo \"No Find Pid!\"") .add("fi").over().sync().isResult(); ArrayList<String> outPut = ShellInit.getShell().getOutPut(); ArrayList<String> error = ShellInit.getShell().getError(); if (!outPut.isEmpty()) { if (outPut.get(0).equals("No Find Pid!")) { AndroidLogUtils.logW(ITAG.TAG, "Didn't find a pid that can kill: " + pkg); result = false; } } if (!error.isEmpty()) { AndroidLogUtils.logE(ITAG.TAG, "An error message was returned:" + error); result = false; } } return result; } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over().sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\")\n .add(\"if [[ $pid != \\\"\\\" ]]; then\")\n .add(\" for i in $pid; do\")\n .add(\" kill -s 15 $i &>/dev/null\")\n .add(\" done\")\n .add(\"else\")\n .add(\" echo \\\"No Find Pid!\\\"\")\n .add(\"fi\").over", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\")\n .add(\" if [[ $(echo $i | grep '[0-9]' 2>/dev/null) != \\\"\\\" ]]; then\")\n .add(\" if [[ $pids == \\\"\\\" ]]; then\")\n .add(\" pids=$i\")\n .add(\" else\")\n .add(\" pids=\\\"$pids $i\\\"\")\n .add(\" fi\")\n .add(\" fi\")\n .add(\" done\")\n .add(\"fi\")\n .add(\"if [[ $pids != \\\"\\\" ]]; then\")\n .add(\" pid=$pids\")\n .add(\"fi\").add", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add(\"pid=$(pgrep -f \\\"\" + pkg + \"\\\" | grep -v $$)\")\n .add(\"if [[ $pid == \\\"\\\" ]]; then\")\n .add(\" pids=\\\"\\\"\")\n .add(\" pid=$(ps -A -o PID,ARGS=CMD | grep \\\"\" + pkg + \"\\\" | grep -v \\\"grep\\\")\")\n .add(\" for i in $pid; do\").add" ]
[((1674, 2868), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync().isResult'), ((1674, 2857), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over().sync'), ((1674, 2850), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"")\n .add("fi").over'), ((1674, 2843), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else")\n .add(" echo \\"No Find Pid!\\"").add'), ((1674, 2812), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done")\n .add("else").add'), ((1674, 2761), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null")\n .add(" done").add'), ((1674, 2728), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do")\n .add(" kill -s 15 $i &>/dev/null").add'), ((1674, 2694), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then")\n .add(" for i in $pid; do").add'), ((1674, 2638), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi")\n .add("if [[ $pid != \\"\\" ]]; then").add'), ((1674, 2591), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids")\n .add("fi").add'), ((1674, 2535), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then")\n .add(" pid=$pids").add'), ((1674, 2504), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi")\n .add("if [[ $pids != \\"\\" ]]; then").add'), ((1674, 2465), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done")\n .add("fi").add'), ((1674, 2408), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi")\n .add(" done").add'), ((1674, 2377), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi")\n .add(" fi").add'), ((1674, 2342), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"")\n .add(" fi").add'), ((1674, 2308), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else")\n .add(" pids=\\"$pids $i\\"").add'), ((1674, 2273), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i")\n .add(" else").add'), ((1674, 2221), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then")\n .add(" pids=$i").add'), ((1674, 2184), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then")\n .add(" if [[ $pids == \\"\\" ]]; then").add'), ((1674, 2142), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do")\n .add(" if [[ $(echo $i | grep \'[0-9]\' 2>/dev/null) != \\"\\" ]]; then").add'), ((1674, 2081), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")")\n .add(" for i in $pid; do").add'), ((1674, 1989), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"")\n .add(" pid=$(ps -A -o PID,ARGS=CMD | grep \\"" + pkg + "\\" | grep -v \\"grep\\")").add'), ((1674, 1941), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then")\n .add(" pids=\\"\\"").add'), ((1674, 1841), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)")\n .add("if [[ $pid == \\"\\" ]]; then").add'), ((1674, 1802), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add("pid=$(pgrep -f \\"" + pkg + "\\" | grep -v $$)").add'), ((1674, 1746), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().add'), ((2909, 2941), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getOutPut'), ((2981, 3012), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().getError')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.mms; import android.content.Context; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; import java.lang.reflect.Modifier; public class DisableAd extends BaseHook { @Override public void init() throws NoSuchMethodException { findAndHookMethod("com.miui.smsextra.ui.BottomMenu", "allowMenuMode", Context.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); try { MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("Unknown type of the message: ")) .usingNumbers(3, 4) .returnType(boolean.class) .paramCount(0) ) ).singleOrThrow(() -> new IllegalStateException("DisableAd: Cannot found Method addAdButton()")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "addAdButton() method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } catch (Exception e) { logE(TAG, lpparam.packageName, "find addAdButton() error", e); } try { MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .name("setHideButton") ) ); if (methodDataList == null) throw new IllegalStateException("DisableAd: Cannot found Method setHideButton()"); for (MethodData methodData : methodDataList) { Method method2 = methodData.getMethodInstance(lpparam.classLoader); if (!Modifier.isAbstract(method2.getModifiers())) { logD(TAG, lpparam.packageName, "Current hooking setHideButton() method is " + method2); hookMethod(method2, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.args[0] = true; } }); } } } catch (Exception e) { logE(TAG, lpparam.packageName, "find setHideButton() error", e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"Unknown type of the message: \"))\n .usingNumbers(3, 4)\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1732, 2222), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4)\n .returnType(boolean.class)\n .paramCount(0)\n )\n ).singleOrThrow'), ((1732, 2127), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1732, 1765), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1777, 2113), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1822, 2095), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4)\n .returnType(boolean.class).paramCount'), ((1822, 2060), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: "))\n .usingNumbers(3, 4).returnType'), ((1822, 2013), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Unknown type of the message: ")).usingNumbers'), ((1822, 1973), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1880, 1972), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((2799, 2986), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2799, 2832), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2844, 2972), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2889, 2954), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().name')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import android.annotation.SuppressLint; import android.content.Context; import android.util.Log; import com.sevtinge.hyperceiler.callback.ITAG; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import com.sevtinge.hyperceiler.utils.shell.ShellUtils; @SuppressLint("PrivateApi") public class PropUtils { private static final String TAG = ITAG.TAG; public static String getProp(Context context, String name) { try { return classLoaderMethod(context, name); } catch (Throwable e) { Log.e(TAG, "PropUtils classLoader getProp String", e); return ""; } } public static boolean getProp(String name, boolean def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return Boolean.TRUE.equals(invokeMethod(cls, "getBoolean", new Class[]{String.class, boolean.class}, name, def)); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp int", e); return false; } } public static int getProp(String name, int def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return invokeMethod(cls, "getInt", new Class[]{String.class, int.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp int", e); return 0; } } public static long getProp(String name, long def) { try { Class<?> cls = Class.forName("android.os.SystemProperties"); return invokeMethod(cls, "getLong", new Class[]{String.class, long.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp long", e); return 0L; } } public static String getProp(String name, String def) { try { return invokeMethod(Class.forName("android.os.SystemProperties"), "get", new Class[]{String.class, String.class}, name, def); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp String", e); return ""; } } public static String getProp(String name) { try { return invokeMethod(Class.forName("android.os.SystemProperties"), "get", new Class[]{String.class}, name); } catch (Throwable e) { Log.e(TAG, "PropUtils getProp String no def", e); return ""; } } /** * 系统限制只能使用Root。 * 返回 true 表示成功。 * * @return boolean */ public static boolean setProp(String name, Object vale) { if (ShellInit.getShell() != null) { return ShellInit.getShell().run("setprop " + name + " " + vale).sync().isResult(); } return ShellUtils.getResultBoolean("setprop " + name + " " + vale, true); } private static String classLoaderMethod(Context context, String name) throws Throwable { ClassLoader classLoader = context.getClassLoader(); return InvokeUtils.invokeStaticMethod("android.os.SystemProperties", classLoader, "get", new Class[]{String.class}, name); } /** * @noinspection unchecked */ private static <T> T invokeMethod(Class<?> cls, String str, Class<?>[] clsArr, Object... objArr) throws Throwable { return InvokeUtils.invokeStaticMethod(cls, str, clsArr, objArr); } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"setprop \" + name + \" \" + vale).sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"setprop \" + name + \" \" + vale).sync().isResult", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run" ]
[((3463, 3537), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("setprop " + name + " " + vale).sync().isResult'), ((3463, 3526), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("setprop " + name + " " + vale).sync'), ((3463, 3519), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class InstallIntercept extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("permcenter_install_intercept_enabled") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("Find permcenter_install_intercept_enabled E")); // logE(TAG, "find: " + methodData.getMethodInstance(lpparam.classLoader)); Method method = methodData.getMethodInstance(lpparam.classLoader); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) { param.setResult(false); } } ); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"permcenter_install_intercept_enabled\")\n .returnType(boolean.class)\n )\n ).singleOrThrow" ]
[((1245, 1613), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("permcenter_install_intercept_enabled")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((1245, 1519), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1245, 1278), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1303, 1509), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1348, 1491), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("permcenter_install_intercept_enabled").returnType'), ((1348, 1444), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.sub; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.os.Handler; import android.os.Parcelable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.CheckBox; import android.widget.EditText; import android.widget.ListView; import android.widget.ProgressBar; import androidx.fragment.app.Fragment; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.callback.IAppSelectCallback; import com.sevtinge.hyperceiler.callback.IEditCallback; import com.sevtinge.hyperceiler.data.AppData; import com.sevtinge.hyperceiler.data.adapter.AppDataAdapter; import com.sevtinge.hyperceiler.utils.BitmapUtils; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import moralnorm.appcompat.app.AlertDialog; public class AppPicker extends Fragment { private final String TAG = "AppPicker"; private String key = null; private int modeSelection; private View mRootView; private ProgressBar mAmProgress; private ListView mAppListRv; private AppDataAdapter mAppListAdapter; public Handler mHandler; private Set<String> selectedApps; private List<AppData> appDataList = new ArrayList<>(); private final HashMap<String, Integer> hashMap = new HashMap<>(); private IAppSelectCallback mAppSelectCallback; public static IEditCallback iEditCallback; public static final int APP_OPEN_MODE = 0; public static final int LAUNCHER_MODE = 1; public static final int CALLBACK_MODE = 2; public static final int INPUT_MODE = 3; public void setAppSelectCallback(IAppSelectCallback callback) { mAppSelectCallback = callback; } public interface EditDialogCallback { void onInputReceived(String userInput); } public static void setEditCallback(IEditCallback editCallback) { iEditCallback = editCallback; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mRootView = inflater.inflate(R.layout.fragment_app_picker, container, false); initView(); return mRootView; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requireActivity().setTitle(R.string.array_global_actions_launch_choose); Bundle args = requireActivity().getIntent().getExtras(); assert args != null; modeSelection = args.getInt("mode"); switch (modeSelection) { case APP_OPEN_MODE, LAUNCHER_MODE, INPUT_MODE -> key = args.getString("key"); default -> { } } mHandler = new Handler(); initData(); } private void initView() { mAmProgress = mRootView.findViewById(R.id.am_progressBar); mAppListRv = mRootView.findViewById(R.id.app_list_rv); mAppListRv.setVisibility(View.GONE); mAppListRv.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { AppData appData = appDataList.get((int) id); // Log.e(TAG, "onItemClick: " + appData.packageName, null); switch (modeSelection) { case CALLBACK_MODE -> { mAppSelectCallback.sendMsgToActivity(BitmapUtils.Bitmap2Bytes(appData.icon), appData.label, appData.packageName, appData.versionName + "(" + appData.versionCode + ")", appData.activityName); requireActivity().finish(); } case LAUNCHER_MODE, APP_OPEN_MODE -> { CheckBox checkBox = view.findViewById(android.R.id.checkbox); selectedApps = new LinkedHashSet<>(PrefsUtils.mSharedPreferences.getStringSet(key, new LinkedHashSet<>())); if (checkBox.isChecked()) { checkBox.setChecked(false); selectedApps.remove(appData.packageName); } else { checkBox.setChecked(true); selectedApps.add(appData.packageName); } PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply(); } case INPUT_MODE -> { showEditDialog(appData.label, new EditDialogCallback() { @Override public void onInputReceived(String userInput) { iEditCallback.editCallback(appData.label, appData.packageName, userInput); } } ); } } } }); } private void showEditDialog(String defaultText, EditDialogCallback callback) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.edit_dialog, null); EditText input = view.findViewById(R.id.title); input.setText(defaultText); new AlertDialog.Builder(requireActivity()) .setTitle(R.string.edit) .setView(view) .setPositiveButton(android.R.string.ok, (dialog, which) -> { String userInput = input.getText().toString(); callback.onInputReceived(userInput); dialog.dismiss(); }) .setNegativeButton(android.R.string.cancel, (dialog, which) -> { dialog.dismiss(); }) .show(); } private void initData() { new Thread(new Runnable() { @Override public void run() { mHandler.postDelayed(new Runnable() { @Override public void run() { appDataList = getAppInfo(); mAppListAdapter = new AppDataAdapter(requireActivity(), R.layout.item_app_list, appDataList, key, modeSelection); mAppListRv.setAdapter(mAppListAdapter); mAmProgress.setVisibility(View.GONE); mAppListRv.setVisibility(View.VISIBLE); } }, 120); } }).start(); } public List<AppData> getAppInfo() { return switch (modeSelection) { case LAUNCHER_MODE, CALLBACK_MODE, INPUT_MODE -> PackagesUtils.getPackagesByCode(new PackagesUtils.IPackageCode() { @Override public List<Parcelable> getPackageCodeList(PackageManager pm) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.addCategory(Intent.CATEGORY_LAUNCHER); List<ResolveInfo> resolveInfoList = new ArrayList<>(); List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, PackageManager.GET_ACTIVITIES); hashMap.clear(); for (ResolveInfo resolveInfo : resolveInfos) { Integer added = hashMap.get(resolveInfo.activityInfo.applicationInfo.packageName); if (added == null || added != 1) { hashMap.put(resolveInfo.activityInfo.applicationInfo.packageName, 1); } else { continue; } resolveInfoList.add(resolveInfo); } return new ArrayList<>(resolveInfoList); } }); case APP_OPEN_MODE -> PackagesUtils.getOpenWithApps(); default -> new ArrayList<>(); }; } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet" ]
[((5019, 5089), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet'), ((5475, 5551), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet(key, selectedApps).apply'), ((5475, 5543), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().putStringSet'), ((5475, 5511), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((6197, 6267), 'android.view.LayoutInflater.from(getActivity()).inflate')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.Preference; import moralnorm.preference.SwitchPreference; public class SystemFrameworkFragment extends SettingsPreferenceFragment { SwitchPreference mDisableCreak; SwitchPreference mShareUser; SwitchPreference mDisableIntegrity; SwitchPreference mDisableLowApiCheck; Preference mNetwork; @Override public int getContentResId() { return R.xml.framework; } @Override public void initPrefs() { boolean mCreak = PrefsUtils.getSharedBoolPrefs(getContext(), "prefs_key_system_framework_core_patch_auth_creak", false); mDisableCreak = findPreference("prefs_key_system_framework_core_patch_auth_creak"); mShareUser = findPreference("prefs_key_system_framework_core_patch_shared_user"); mDisableIntegrity = findPreference("prefs_key_system_framework_core_patch_disable_integrity"); mDisableLowApiCheck = findPreference("prefs_key_system_framework_disable_low_api_check"); mNetwork = findPreference("prefs_key_system_framework_network"); mDisableIntegrity.setVisible(isMoreAndroidVersion(33) && !mCreak); mShareUser.setVisible(isMoreAndroidVersion(33)); // 暂时仅开放给 Android 13 及以上使用 mNetwork.setVisible(TelephonyManager.getDefault().isFiveGCapable()); mDisableLowApiCheck.setVisible(isMoreAndroidVersion(34)); mDisableCreak.setOnPreferenceChangeListener((preference, o) -> { if ((boolean) o) { mDisableIntegrity.setChecked(false); mDisableIntegrity.setVisible(false); } else { mDisableIntegrity.setVisible(isMoreAndroidVersion(33)); } return true; }); } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable" ]
[((2371, 2417), 'com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.huanji; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class AllowMoveAllApps extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings(" skip file path ") ) ).singleOrThrow(() -> new IllegalStateException("Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "isSkipDataApp() method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\" skip file path \")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1237, 1493), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(" skip file path ")\n )\n ).singleOrThrow'), ((1237, 1419), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1237, 1270), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1282, 1409), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1323, 1395), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.settings.development; import android.view.LayoutInflater; import android.view.View; import android.widget.EditText; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.Arrays; import java.util.HashSet; import java.util.Map; import moralnorm.appcompat.app.AlertDialog; import moralnorm.preference.Preference; public class DevelopmentPrefsFragment extends SettingsPreferenceFragment { Preference mType; Preference mClean; public interface EditDialogCallback { void onInputReceived(String userInput); } @Override public int getContentResId() { return R.xml.prefs_development_prefs; } @Override public void initPrefs() { mType = findPreference("prefs_key_development_prefs_check"); mClean = findPreference("prefs_key_development_prefs_clean"); assert mType != null; assert mClean != null; mClean.setOnPreferenceClickListener( preference -> { showInDialog( userInput -> { if (cleanPrefs(userInput)) { showOutDialog(getResources().getString(R.string.prefs_2) + userInput); } else { showOutDialog(getResources().getString(R.string.prefs_3) + userInput); } } ); return true; }); mType.setOnPreferenceClickListener( preference -> { showInDialog( userInput -> { if (havePrefs(userInput)) { Object prefs = getPrefs(userInput, false, getType("prefs_key_development_prefs_type")); if (prefs == null) return; if (prefs instanceof String) { showOutDialog((String) prefs); } else if (prefs instanceof Integer) { showOutDialog(Integer.toString((int) prefs)); } else if (prefs instanceof Boolean) { showOutDialog(Boolean.toString((Boolean) prefs)); } else if (prefs instanceof HashSet<?>) { showOutDialog(Arrays.toString(((HashSet<?>) prefs).toArray())); } } else { showOutDialog(getResources().getString(R.string.prefs_1) + userInput); } } ); return true; } ); } private int getType(String key) { return Integer.parseInt((String) getPrefs(key, true, 0)); } private boolean havePrefs(String key) { Map<String, ?> prefs = PrefsUtils.mSharedPreferences.getAll(); return !(prefs.get(key) == null); } private boolean cleanPrefs(String key) { if (havePrefs(key)) { PrefsUtils.mSharedPreferences.edit().remove(key).apply(); return true; } return havePrefs(key); } private Object getPrefs(String key, boolean type, int needType) { if (type) return PrefsUtils.mSharedPreferences.getString(key, "null"); try { switch (needType) { case 0 -> { return PrefsUtils.mSharedPreferences.getInt(key, -1); } case 1 -> { return PrefsUtils.mSharedPreferences.getString(key, "null"); } case 2 -> { return Integer.parseInt(PrefsUtils.mSharedPreferences.getString(key, "-1")); } case 3 -> { return PrefsUtils.mSharedPreferences.getStringSet(key, new HashSet<>()); } case 4 -> { return PrefsUtils.mSharedPreferences.getBoolean(key, false); } default -> { return null; } } } catch (Throwable throwable) { showOutDialog(getResources().getString(R.string.prefs_4) + "\n E: " + throwable.getMessage()); return null; } } private void showInDialog(EditDialogCallback callback) { View view = LayoutInflater.from(getActivity()).inflate(R.layout.edit_dialog, null); EditText input = view.findViewById(R.id.title); new AlertDialog.Builder(getActivity()) .setTitle(R.string.edit_key) .setView(view) .setCancelable(false) .setPositiveButton(android.R.string.ok, (dialog, which) -> { String userInput = input.getText().toString(); if (userInput.equals("")) { dialog.dismiss(); showInDialog(callback); return; } callback.onInputReceived(userInput); dialog.dismiss(); }) .setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.dismiss()) .show(); } private void showOutDialog(String show) { new AlertDialog.Builder(getActivity()) .setCancelable(false) .setTitle(R.string.edit_out) .setMessage(show) .setPositiveButton(android.R.string.ok, null) .show(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove(key).apply", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getBoolean", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet" ]
[((3773, 3811), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll'), ((3949, 4005), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove(key).apply'), ((3949, 3997), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit().remove'), ((3949, 3985), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit'), ((4175, 4227), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4330, 4375), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getInt'), ((4450, 4502), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4594, 4644), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString'), ((4720, 4784), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getStringSet'), ((4859, 4911), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getBoolean'), ((5295, 5365), 'android.view.LayoutInflater.from(getActivity()).inflate')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment.helper; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import moralnorm.preference.Preference; public class CantSeeAppsFragment extends SettingsPreferenceFragment { Preference mHelpCantSeeApps; @Override public int getContentResId() { return R.xml.prefs_help_cant_see_apps; } @Override public void initPrefs() { setTitle(R.string.help); mHelpCantSeeApps = findPreference("prefs_key_textview_help_cant_see_apps"); if (mHelpCantSeeApps != null) { if (!PreferenceHeader.mUninstallApp.isEmpty() && !PreferenceHeader.mDisableOrHiddenApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_uninstall) + String.join("\n", PreferenceHeader.mUninstallApp) + "\n" + getString(R.string.help_cant_see_apps_disable) + String.join("\n", PreferenceHeader.mDisableOrHiddenApp)); } else if (!PreferenceHeader.mUninstallApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_uninstall) + String.join("\n", PreferenceHeader.mUninstallApp)); } else if (!PreferenceHeader.mDisableOrHiddenApp.isEmpty()) { mHelpCantSeeApps.setSummary(getString(R.string.help_cant_see_apps_desc) + getString(R.string.help_cant_see_apps_disable) + String.join("\n", PreferenceHeader.mDisableOrHiddenApp)); } } } }
[ "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty", "com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty" ]
[((1413, 1453), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty'), ((1458, 1504), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty'), ((1887, 1927), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mUninstallApp.isEmpty'), ((2172, 2218), 'com.sevtinge.hyperceiler.prefs.PreferenceHeader.mDisableOrHiddenApp.isEmpty')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.base; import android.app.backup.BackupManager; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.FileObserver; import android.util.Log; import android.view.View; import android.widget.ImageView; import androidx.annotation.DrawableRes; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.provider.SharedPrefsProvider; import com.sevtinge.hyperceiler.utils.Helpers; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import java.util.Set; import moralnorm.appcompat.app.AppCompatActivity; public abstract class BaseActivity extends AppCompatActivity { protected BaseSettingsProxy mProxy; @Override public void onCreate(@Nullable Bundle savedInstanceState) { mProxy = new SettingsProxy(this); super.onCreate(savedInstanceState); initActionBar(); registerObserver(); } protected void initActionBar() { setDisplayHomeAsUpEnabled(!(this instanceof NavigationActivity)); } public void setDisplayHomeAsUpEnabled(boolean isEnable) { getAppCompatActionBar().setDisplayHomeAsUpEnabled(isEnable); } public void setActionBarEndView(View view) { getAppCompatActionBar().setEndView(view); } public void setActionBarEndIcon(@DrawableRes int resId, View.OnClickListener listener) { ImageView mRestartView = new ImageView(this); mRestartView.setImageResource(resId); mRestartView.setOnClickListener(listener); setActionBarEndView(mRestartView); } public void setRestartView(View.OnClickListener listener) { if (listener != null) setActionBarEndIcon(R.drawable.ic_reboot_small, listener); } private void registerObserver() { PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener(mSharedPreferenceChangeListener); Helpers.fixPermissionsAsync(getApplicationContext()); registerFileObserver(); } SharedPreferences.OnSharedPreferenceChangeListener mSharedPreferenceChangeListener = (sharedPreferences, s) -> { Log.i("prefs", "Changed: " + s); requestBackup(); Object val = sharedPreferences.getAll().get(s); String path = ""; if (val instanceof String) path = "string/"; else if (val instanceof Set<?>) path = "stringset/"; else if (val instanceof Integer) path = "integer/"; else if (val instanceof Boolean) path = "boolean/"; getContentResolver().notifyChange(Uri.parse("content://" + SharedPrefsProvider.AUTHORITY + "/" + path + s), null); if (!path.isEmpty()) getContentResolver().notifyChange(Uri.parse("content://" + SharedPrefsProvider.AUTHORITY + "/pref/" + path + s), null); }; private void registerFileObserver() { try { FileObserver mFileObserver = new FileObserver(PrefsUtils.getSharedPrefsPath(), FileObserver.CLOSE_WRITE) { @Override public void onEvent(int event, String path) { Helpers.fixPermissionsAsync(getApplicationContext()); } }; mFileObserver.startWatching(); } catch (Throwable t) { Log.e("prefs", "Failed to start FileObserver!"); } } public void requestBackup() { new BackupManager(getApplicationContext()).dataChanged(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener" ]
[((2571, 2674), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.registerOnSharedPreferenceChangeListener')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.weather; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindField; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.FieldMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.FieldData; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Field; import java.lang.reflect.Method; import de.robv.android.xposed.XposedHelpers; public class SetCardLightDarkMode extends BaseHook { private static final String METHOD_NAME = "judgeCurrentColor() mLightDarkMode : "; private static final MethodMatcher METHOD_MATCHER = MethodMatcher.create().usingStrings(METHOD_NAME); @Override public void init() { try { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(METHOD_MATCHER) ).singleOrThrow(() -> new NoSuchMethodException("SetCardLightDarkMode: Cannot find method judgeCurrentColor()")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "judgeCurrentColor() method is " + method); FieldData fieldData = DexKit.INSTANCE.getDexKitBridge().findField(FindField.create() .matcher(FieldMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings(METHOD_NAME)) .addWriteMethod(METHOD_MATCHER) .addReadMethod(METHOD_MATCHER) .type(int.class) ) ).singleOrThrow(() -> new NoSuchFieldException("SetCardLightDarkMode: Cannot find field mLightDarkMode")); Field field = fieldData.getFieldInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "mLightDarkMode field is " + field); hookMethod(method, new MethodHook() { @Override protected void after(MethodHookParam param) { XposedHelpers.setIntField(param.thisObject, field.getName(), mPrefsMap.getStringAsInt("weather_card_display_type", 0)); } }); } catch (Exception e) { logE(TAG, lpparam.packageName, e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(METHOD_MATCHER)\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(FindField.create()\n .matcher(FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER)\n .type(int.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField" ]
[((1557, 1605), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((1697, 1931), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(METHOD_MATCHER)\n ).singleOrThrow'), ((1697, 1820), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1697, 1730), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1742, 1806), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2133, 2679), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField(FindField.create()\n .matcher(FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER)\n .type(int.class)\n )\n ).singleOrThrow'), ((2133, 2575), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findField'), ((2133, 2166), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2177, 2561), 'org.luckypray.dexkit.query.FindField.create().matcher'), ((2225, 2539), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER)\n .addReadMethod(METHOD_MATCHER).type'), ((2225, 2494), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME))\n .addWriteMethod(METHOD_MATCHER).addReadMethod'), ((2225, 2435), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(METHOD_NAME)).addWriteMethod'), ((2225, 2375), 'org.luckypray.dexkit.query.matchers.FieldMatcher.create().declaredClass'), ((2290, 2374), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home; import android.content.Context; import android.os.Handler; import android.os.Message; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import de.robv.android.xposed.XposedHelpers; public class SeekPoints extends BaseHook { public int points = XposedInit.mPrefsMap.getStringAsInt("home_other_seek_points", 0); @Override public void init() { findAndHookMethod("com.miui.home.launcher.ScreenView", "setSeekBarPosition", "android.widget.FrameLayout$LayoutParams", new MethodHook() { @Override protected void after(MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "refreshScrollBound", new MethodHook() { @Override protected void after(MethodHookParam param) { if (points == 2) showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "updateSeekPoints", int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "addView", View.class, int.class, ViewGroup.LayoutParams.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "removeScreen", int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); findAndHookMethod("com.miui.home.launcher.ScreenView", "removeScreensInLayout", int.class, int.class, new MethodHook() { @Override protected void before(final MethodHookParam param) { showSeekBar((View) param.thisObject); } } ); } private void showSeekBar(View workspace) { if (!"Workspace".equals(workspace.getClass().getSimpleName())) return; boolean isInEditingMode = (boolean) XposedHelpers.callMethod(workspace, "isInNormalEditingMode"); View mScreenSeekBar = (View) XposedHelpers.getObjectField(workspace, "mScreenSeekBar"); if (mScreenSeekBar == null) { logI(TAG, this.lpparam.packageName, "showSeekBar HideSeekPointsHook Cannot find seekbar"); return; } Context mContext = workspace.getContext(); Handler mHandler = (Handler) XposedHelpers.getAdditionalInstanceField(workspace, "mHandlerEx"); if (mHandler == null) { mHandler = new Handler(mContext.getMainLooper()) { @Override public void handleMessage(@NonNull Message msg) { View seekBar = (View) msg.obj; if (seekBar != null) seekBar.animate().alpha(0.0f).setDuration(600).withEndAction(() -> seekBar.setVisibility(View.GONE)); } }; XposedHelpers.setAdditionalInstanceField(workspace, "mHandlerEx", mHandler); } if (mHandler == null) { logI(TAG, this.lpparam.packageName, "showSeekBar HideSeekPointsHook Cannot create handler"); return; } if (mHandler.hasMessages(666)) mHandler.removeMessages(666); mScreenSeekBar.animate().cancel(); if (!isInEditingMode && points == 2) { mScreenSeekBar.setAlpha(0.0f); mScreenSeekBar.setVisibility(View.GONE); return; } mScreenSeekBar.setVisibility(View.VISIBLE); mScreenSeekBar.animate().alpha(1.0f).setDuration(300); if (!isInEditingMode) { Message msg = Message.obtain(mHandler, 666); msg.obj = mScreenSeekBar; mHandler.sendMessageDelayed(msg, 1500); } } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt" ]
[((1180, 1244), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getStringAsInt')]
package com.sevtinge.hyperceiler.module.hook.calendar; import static de.robv.android.xposed.XposedHelpers.callStaticMethod; import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class UnlockSubscription extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("Cal:D:CalendarApplicationDelegate")) .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse") .paramCount(0) ) ).singleOrThrow(() -> new IllegalStateException("UnlockSubscription: Cannot found MethodData")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { try { findAndHookMethod(findClass("android.app.SharedPreferencesImpl$EditorImpl"), "putBoolean", String.class, boolean.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (param.args[0] == "key_subscription_display" || param.args[0] == "key_import_todo" || param.args[0] == "key_chinese_almanac_pref" || param.args[0] == "key_weather_display" || param.args[0] == "key_ai_time_parse") param.args[1] = true; } }); } catch (Exception e) { logE(TAG, lpparam.packageName, "Cannot hook android.app.SharedPreferencesImpl$EditorImpl.putBoolean(String, boolean)", e); } } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"Cal:D:CalendarApplicationDelegate\"))\n .usingStrings(\"key_subscription_display\", \"key_import_todo\", \"key_chinese_almanac_pref\", \"key_weather_display\", \"key_ai_time_parse\")\n .paramCount(0)\n )\n ).singleOrThrow" ]
[((755, 1330), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate"))\n .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse")\n .paramCount(0)\n )\n ).singleOrThrow'), ((755, 1236), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((755, 788), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((800, 1226), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((845, 1208), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate"))\n .usingStrings("key_subscription_display", "key_import_todo", "key_chinese_almanac_pref", "key_weather_display", "key_ai_time_parse").paramCount'), ((845, 1169), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("Cal:D:CalendarApplicationDelegate")).usingStrings'), ((845, 1012), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((907, 1011), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.powerkeeper; import androidx.annotation.NonNull; import com.github.kyuubiran.ezxhelper.HookFactory; import com.github.kyuubiran.ezxhelper.interfaces.IMethodHookCallback; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.util.function.Consumer; import de.robv.android.xposed.XC_MethodHook; public class PreventBatteryWitelist extends BaseHook { @Override public void init() { // hookAllMethods("com.miui.powerkeeper.utils.CommonAdapter", lpparam.classLoader, "addPowerSaveWhitelistApps", new MethodHook(20000) { // @Override // protected void before(MethodHookParam param) throws Throwable { // param.setResult(null); // } // }); MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("addPowerSaveWhitelistApps: ")) .usingStrings("addPowerSaveWhitelistApps: ") ) ).singleOrThrow(() -> new IllegalStateException("PreventBatteryWitelist: No class found MethodData")); try { HookFactory.createMethodHook(methodData.getMethodInstance(lpparam.classLoader), new Consumer<HookFactory>() { @Override public void accept(HookFactory hookFactory) { hookFactory.before(new IMethodHookCallback() { @Override public void onMethodHooked(@NonNull XC_MethodHook.MethodHookParam methodHookParam) { String[] strArr = (String[]) methodHookParam.args[0]; if (strArr.length > 1) { methodHookParam.setResult(null); } } }); } }); } catch (NoSuchMethodException e) { logE(TAG, this.lpparam.packageName, "NoSuchMethodException: " + e); } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings(\"addPowerSaveWhitelistApps: \"))\n .usingStrings(\"addPowerSaveWhitelistApps: \")\n )\n ).singleOrThrow" ]
[((1806, 2251), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(\n FindMethod.create()\n .matcher(MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("addPowerSaveWhitelistApps: "))\n .usingStrings("addPowerSaveWhitelistApps: ")\n )\n ).singleOrThrow'), ((1806, 2151), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1806, 1839), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1864, 2141), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1909, 2123), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("addPowerSaveWhitelistApps: ")).usingStrings'), ((1909, 2058), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1967, 2057), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import static com.sevtinge.hyperceiler.utils.DisplayUtils.dip2px; import static com.sevtinge.hyperceiler.utils.DisplayUtils.sp2px; import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getBaseOs; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getRomAuthor; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.content.Intent; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.text.SpannableString; import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.graphics.Insets; import androidx.core.view.OnApplyWindowInsetsListener; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.recyclerview.widget.RecyclerView; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.prefs.PreferenceHeader; import com.sevtinge.hyperceiler.prefs.RecommendPreference; import com.sevtinge.hyperceiler.prefs.TipsPreference; import com.sevtinge.hyperceiler.ui.MainActivityContextHelper; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.ui.fragment.helper.CantSeeAppsFragment; import com.sevtinge.hyperceiler.ui.fragment.helper.HomepageEntrance; import com.sevtinge.hyperceiler.utils.PackagesUtils; import com.sevtinge.hyperceiler.utils.ThreadPoolManager; import com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt; import com.sevtinge.hyperceiler.utils.log.AndroidLogUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; import java.util.Objects; import moralnorm.preference.Preference; public class MainFragment extends SettingsPreferenceFragment implements HomepageEntrance.EntranceState { Preference mCamera; Preference mCameraNew; Preference mPowerSetting; Preference mMTB; Preference mSecurityCenter; Preference mMiLink; Preference mAod; Preference mGuardProvider; Preference mMirror; Preference mHeadtipWarn; TipsPreference mTips; MainActivityContextHelper mainActivityContextHelper; Handler mHandler = new Handler() { @Override public void handleMessage(@NonNull Message msg) { super.handleMessage(msg); if (msg.what == 0x11) { mTips.updateTips(); removeMessages(0x11); sendEmptyMessageDelayed(0x11, 6000); } } }; private final String TAG = "MainFragment"; public static final String ANDROID_NS = "http://schemas.android.com/apk/res/android"; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Message message = mHandler.obtainMessage(0x11); mHandler.sendMessageDelayed(message, 6000); } @Override public int getContentResId() { return R.xml.prefs_main; } @Override public void initPrefs() { HomepageEntrance.setEntranceStateListen(this); Resources resources = getResources(); ThreadPoolManager.getInstance().submit(() -> { try (XmlResourceParser xml = resources.getXml(R.xml.prefs_set_homepage_entrance)) { try { int event = xml.getEventType(); while (event != XmlPullParser.END_DOCUMENT) { if (event == XmlPullParser.START_TAG) { if (xml.getName().equals("SwitchPreference")) { String key = xml.getAttributeValue(ANDROID_NS, "key"); if (key != null) { String checkKey = key.replace("_state", ""); boolean state = getSharedPreferences().getBoolean(key, true); if (!state) { PreferenceHeader preferenceHeader = findPreference(checkKey); if (preferenceHeader != null) { boolean visible = preferenceHeader.isVisible(); if (visible) { preferenceHeader.setVisible(false); } } } } } } event = xml.next(); } } catch (XmlPullParserException | IOException e) { AndroidLogUtils.logE(TAG, "An error occurred when reading the XML:", e); } } }); mCamera = findPreference("prefs_key_camera"); mCameraNew = findPreference("prefs_key_camera_new"); mPowerSetting = findPreference("prefs_key_powerkeeper"); mMTB = findPreference("prefs_key_mtb"); mSecurityCenter = findPreference("prefs_key_security_center"); mMiLink = findPreference("prefs_key_milink"); mAod = findPreference("prefs_key_aod"); mGuardProvider = findPreference("prefs_key_guardprovider"); mMirror = findPreference("prefs_key_mirror"); mTips = findPreference("prefs_key_tips"); mHeadtipWarn = findPreference("prefs_key_headtip_warn"); mCamera.setVisible(!isMoreHyperOSVersion(1f) && !PackagesUtils.checkAppStatus(getContext(), "com.android.camera")); mCameraNew.setVisible(isMoreHyperOSVersion(1f) && !PackagesUtils.checkAppStatus(getContext(), "com.android.camera")); mPowerSetting.setVisible(!isAndroidVersion(30) && !PackagesUtils.checkAppStatus(getContext(), "com.miui.powerkeeper")); mMTB.setVisible(!isAndroidVersion(30) && !PackagesUtils.checkAppStatus(getContext(), "com.xiaomi.mtb")); if (isMoreHyperOSVersion(1f)) { mAod.setTitle(R.string.aod_hyperos); mMiLink.setTitle(R.string.milink_hyperos); mGuardProvider.setTitle(R.string.guard_provider_hyperos); mMirror.setTitle(R.string.mirror_hyperos); mSecurityCenter.setTitle(R.string.security_center_hyperos); } else { mAod.setTitle(R.string.aod); mMiLink.setTitle(R.string.milink); mGuardProvider.setTitle(R.string.guard_provider); mMirror.setTitle(R.string.mirror); if (isPad()) { mSecurityCenter.setTitle(R.string.security_center_pad); } else { mSecurityCenter.setTitle(R.string.security_center); } } mainActivityContextHelper = new MainActivityContextHelper(requireContext()); isOfficialRom(); if (!getIsOfficialRom()) isSignPass(); mTips = findPreference("prefs_key_tips"); } public void isOfficialRom() { mHeadtipWarn.setTitle(R.string.headtip_warn_not_offical_rom); mHeadtipWarn.setVisible(getIsOfficialRom()); } public boolean getIsOfficialRom() { return ( !getBaseOs().startsWith("V") && !getBaseOs().startsWith("Xiaomi") && !getBaseOs().startsWith("Redmi") && !getBaseOs().startsWith("POCO") && !getBaseOs().isEmpty() ) || !getRomAuthor().isEmpty() || Objects.equals(SystemSDKKt.getHost(), "xiaomi.eu") || ( !SystemSDKKt.getHost().startsWith("pangu-build-component-system") && !SystemSDKKt.getHost().startsWith("non-pangu-pod-g0sww") ); } public void isSignPass() { mHeadtipWarn.setTitle(R.string.headtip_warn_sign_verification_failed); mHeadtipWarn.setVisible(!mainActivityContextHelper.isSignCheckPass()); } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); RecyclerView recyclerView = view.findViewById(moralnorm.preference.R.id.recycler_view); ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new OnApplyWindowInsetsListener() { @NonNull @Override public WindowInsetsCompat onApplyWindowInsets(@NonNull View v, @NonNull WindowInsetsCompat insets) { Insets inset = Insets.max(insets.getInsets(WindowInsetsCompat.Type.systemBars()), insets.getInsets(WindowInsetsCompat.Type.displayCutout())); // 22dp + 2dp + 12sp + 10dp + 18dp + 0.5dp + inset.bottom + 4dp(?) v.setPadding(inset.left, 0, inset.right, inset.bottom + dip2px(requireContext(), 56.5F) + sp2px(requireContext(), 12)); return insets; } }); } @Override public void onEntranceStateChange(String key, boolean state) { String mainKey = key.replace("_state", ""); PreferenceHeader preferenceHeader = findPreference(mainKey); if (preferenceHeader != null) { boolean last = preferenceHeader.isVisible(); if (!last || state) return; preferenceHeader.setVisible(false); } } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith", "com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit" ]
[((4166, 5849), 'com.sevtinge.hyperceiler.utils.ThreadPoolManager.getInstance().submit'), ((8633, 8697), 'com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith'), ((8734, 8789), 'com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.getHost().startsWith'), ((9583, 9619), 'androidx.core.view.WindowInsetsCompat.Type.systemBars'), ((9663, 9702), 'androidx.core.view.WindowInsetsCompat.Type.displayCutout')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils.log; import static com.sevtinge.hyperceiler.utils.log.XposedLogUtils.mPrefsMap; import com.sevtinge.hyperceiler.BuildConfig; public class LogManager { public static final int logLevel = getLogLevel(); public static int getLogLevel() { int level = mPrefsMap.getStringAsInt("log_level", 2); if (BuildConfig.BUILD_TYPE.equals("canary")) { return level == 0 ? 3 : 4; } return level; } public static String logLevelDesc() { return switch (logLevel) { case 0 -> ("Disable"); case 1 -> ("Error"); case 2 -> ("Warn"); case 3 -> ("Info"); case 4 -> ("Debug"); default -> ("Unknown"); }; } }
[ "com.sevtinge.hyperceiler.BuildConfig.BUILD_TYPE.equals" ]
[((1094, 1133), 'com.sevtinge.hyperceiler.BuildConfig.BUILD_TYPE.equals')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home.folder; import android.content.Context; import android.graphics.LinearGradient; import android.graphics.Shader; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.PaintDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RectShape; import android.os.Handler; import android.view.View; import androidx.annotation.NonNull; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import de.robv.android.xposed.XposedHelpers; public class FolderShade extends BaseHook { private Class<?> mWallpaperUtilsCls = null; private boolean isLight = false; @Override public void init() { mWallpaperUtilsCls = XposedHelpers.findClassIfExists("com.miui.home.launcher.WallpaperUtils", lpparam.classLoader); MethodHook hook = new MethodHook() { @Override protected void after(MethodHookParam param) { View folder = (View) param.thisObject; new Thread(() -> { try { Context context = folder.getContext(); int opt = Integer.parseInt(PrefsUtils.getSharedStringPrefs(context, "prefs_key_home_folder_shade", "0")); int level = PrefsUtils.getSharedIntPrefs(context, "prefs_key_home_folder_shade_level", 40); if (mWallpaperUtilsCls != null) { try { isLight = (boolean) XposedHelpers.callStaticMethod(mWallpaperUtilsCls, "hasAppliedLightWallpaper"); } catch (Throwable tr) { logW(TAG, "isLight is abnormal", tr); } } Drawable bkg; if (opt == 1) { int bgColor = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 * level / 100f) * 0x1000000); bkg = new ColorDrawable(bgColor); } else if (opt == 2) { bkg = getPaintDrawable(level); } else { bkg = null; } new Handler(context.getMainLooper()).post(() -> { XposedInit.mPrefsMap.put("prefs_key_home_folder_shade", String.valueOf(opt)); XposedInit.mPrefsMap.put("prefs_key_home_folder_shade_level", level); folder.setBackground(bkg); }); } catch (Throwable t) { logW(TAG, "", t); } }).start(); } }; hookAllConstructors("com.miui.home.launcher.FolderCling", hook); findAndHookMethod("com.miui.home.launcher.FolderCling", "onWallpaperColorChanged", hook); findAndHookMethod("com.miui.home.launcher.FolderCling", "updateLayout", boolean.class, hook); findAndHookMethod("com.miui.home.launcher.Folder", "setBackgroundAlpha", float.class, new MethodHook() { @Override protected void after(MethodHookParam param) { int opt = mPrefsMap.getStringAsInt("home_folder_shade", 0); Object mLauncher = XposedHelpers.getObjectField(param.thisObject, "mLauncher"); View folderCling = (View) XposedHelpers.callMethod(mLauncher, "getFolderCling"); if (opt == 1 || mLauncher == null || folderCling == null) return; Drawable bkg = folderCling.getBackground(); if (bkg != null) bkg.setAlpha(Math.round((float) param.args[0] * 255)); } }); } @NonNull private PaintDrawable getPaintDrawable(int level) { PaintDrawable pd = new PaintDrawable(); pd.setShape(new RectShape()); pd.setShaderFactory(new ShapeDrawable.ShaderFactory() { @Override public Shader resize(int width, int height) { int bgColor1 = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 / 6f * level / 100f) * 0x1000000); int bgColor2 = (isLight ? 0x00ffffff : 0x00000000) | (Math.round(255 * level / 100f) * 0x1000000); return new LinearGradient( 0, 0, 0, height, new int[]{bgColor1, bgColor2, bgColor2, bgColor1}, new float[]{0.0f, 0.25f, 0.65f, 1.0f}, Shader.TileMode.CLAMP ); } }); return pd; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put" ]
[((3250, 3326), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put'), ((3356, 3424), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.put')]
package com.sevtinge.hyperceiler.ui.fragment.systemui.statusbar; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreHyperOSVersion; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import moralnorm.preference.DropDownPreference; import moralnorm.preference.SeekBarPreferenceEx; import moralnorm.preference.SwitchPreference; public class IconManageNewSettings extends SettingsPreferenceFragment { DropDownPreference mAlarmClockIcon; SeekBarPreferenceEx mAlarmClockIconN; SeekBarPreferenceEx mNotificationIconMaximum; SeekBarPreferenceEx mNotificationIconColumns; SwitchPreference mBatteryNumber; SwitchPreference mBatteryPercentage; @Override public int getContentResId() { return R.xml.system_ui_status_bar_icon_manage_new; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.system_ui), "com.android.systemui" ); } @Override public void initPrefs() { mAlarmClockIcon = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock"); mAlarmClockIconN = findPreference("prefs_key_system_ui_status_bar_icon_alarm_clock_n"); mNotificationIconMaximum = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); mBatteryNumber = findPreference("prefs_key_system_ui_status_bar_battery_percent"); mBatteryPercentage = findPreference("prefs_key_system_ui_status_bar_battery_percent_mark"); mNotificationIconColumns = findPreference("prefs_key_system_ui_status_bar_notification_icon_maximum"); mNotificationIconColumns.setDefaultValue(isMoreHyperOSVersion(1f) ? 1 : 3); mAlarmClockIconN.setVisible(Integer.parseInt(PrefsUtils.mSharedPreferences.getString("prefs_key_system_ui_status_bar_icon_alarm_clock", "0")) == 3); mAlarmClockIcon.setOnPreferenceChangeListener((preference, o) -> { mAlarmClockIconN.setVisible(Integer.parseInt((String) o) == 3); return true; }); mNotificationIconMaximum.setOnPreferenceChangeListener((preference, o) -> { if ((int) o == 16) { mNotificationIconMaximum.setValue(R.string.unlimited); } return true; }); mBatteryNumber.setOnPreferenceChangeListener((preference, o) -> { if (!(boolean) o) { mBatteryPercentage.setChecked(false); } return true; }); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString" ]
[((2054, 2149), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getString')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.utils; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import androidx.annotation.Nullable; import com.sevtinge.hyperceiler.utils.prefs.PrefsUtils; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; public class BackupUtils { public static final int CREATE_DOCUMENT_CODE = 255774; public static final int OPEN_DOCUMENT_CODE = 277451; public static final String BACKUP_FILE_NAME = "HyperCeiler_settings_backup"; public static void backup(Activity activity) { @SuppressLint("SimpleDateFormat") String backupFileName = BACKUP_FILE_NAME + new SimpleDateFormat("_yyyy-MM-dd-HH:mm:ss").format(new java.util.Date()); Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("application/json"); intent.putExtra(Intent.EXTRA_TITLE, backupFileName); activity.startActivityForResult(intent, CREATE_DOCUMENT_CODE); } public static void restore(Activity activity) { Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.addCategory(Intent.CATEGORY_OPENABLE); intent.setType("application/json"); intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false); activity.startActivityForResult(intent, OPEN_DOCUMENT_CODE); } public static void handleCreateDocument(Activity activity, @Nullable Uri data) throws IOException, JSONException { if (data == null) return; OutputStream outputStream = activity.getContentResolver().openOutputStream(data); BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(outputStream)); JSONObject jsonObject = new JSONObject(); for (Map.Entry<String, ?> entry : PrefsUtils.mSharedPreferences.getAll().entrySet()) { jsonObject.put(entry.getKey(), entry.getValue()); } bufferedWriter.write(jsonObject.toString()); bufferedWriter.close(); } public static void handleReadDocument(Activity activity, @Nullable Uri data) throws IOException, JSONException { if (data == null) return; SharedPreferences.Editor edit = PrefsUtils.mSharedPreferences.edit(); InputStream inputStream = activity.getContentResolver().openInputStream(data); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); StringBuilder stringBuilder = new StringBuilder(); String line = bufferedReader.readLine(); while (line != null) { stringBuilder.append(line); line = bufferedReader.readLine(); } String read = stringBuilder.toString(); JSONObject jsonObject = new JSONObject(read); Iterator<String> keys = jsonObject.keys(); while (keys.hasNext()) { String key = keys.next(); Object value = jsonObject.get(key); if (value instanceof String) { if (((String) value).contains("[") && ((String) value).contains("]")) { value = ((String) value).replace("[", "").replace("]", "").replace(" ", ""); String[] array = ((String) value).split(","); List<String> list = Arrays.asList(array); Set<String> stringSet = new HashSet<>(list); edit.putStringSet(key, stringSet); } else { edit.putString(key, (String) value); } } else if (value instanceof Boolean) { edit.putBoolean(key, (Boolean) value); } else if (value instanceof Integer) { edit.putInt(key, (Integer) value); } } bufferedReader.close(); edit.apply(); } }
[ "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit", "com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll().entrySet" ]
[((3019, 3068), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll().entrySet'), ((3019, 3057), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.getAll'), ((3427, 3463), 'com.sevtinge.hyperceiler.utils.prefs.PrefsUtils.mSharedPreferences.edit')]
package com.sevtinge.hyperceiler.module.hook.securitycenter.battery; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindClass; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.ClassMatcher; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.ClassData; import org.luckypray.dexkit.result.ClassDataList; import org.luckypray.dexkit.result.MethodData; import org.luckypray.dexkit.result.MethodDataList; import java.lang.reflect.Method; public class PowerConsumptionRanking extends BaseHook { @Override public void init() throws NoSuchMethodException { ClassDataList data = DexKit.INSTANCE.getDexKitBridge().findClass( FindClass.create() .matcher(ClassMatcher.create() .usingStrings("%d %s %d %s") ) ); MethodDataList methodDataList = DexKit.INSTANCE.getDexKitBridge().findMethod( FindMethod.create() .matcher(MethodMatcher.create() .declaredClass(ClassMatcher.create() .usingStrings("ro.miui.ui.version.code")) .usingNumbers(9) .returnType(boolean.class) ) ); for (ClassData clazzData : data) { try { logI(TAG, lpparam.packageName, "Current hooking clazz is " + clazzData.getInstance(lpparam.classLoader)); try { hookAllConstructors(clazzData.getInstance(lpparam.classLoader), new MethodHook() { @Override protected void before(MethodHookParam param) throws NoSuchMethodException { for (MethodData methodData : methodDataList) { Method method = methodData.getMethodInstance(lpparam.classLoader); logI(TAG, lpparam.packageName, "Current hooking method is " + method); try { hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(false); } }); } catch (Exception ignore) { } } } }); } catch (Exception ignored) { } } catch (ClassNotFoundException e) { logE(TAG, lpparam.packageName, "Cannot found any clazz" + e); } } } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((772, 971), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findClass'), ((772, 805), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((829, 961), 'org.luckypray.dexkit.query.FindClass.create().matcher'), ((873, 943), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings'), ((1013, 1373), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1013, 1046), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1071, 1363), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1116, 1345), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("ro.miui.ui.version.code"))\n .usingNumbers(9).returnType'), ((1116, 1298), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .declaredClass(ClassMatcher.create()\n .usingStrings("ro.miui.ui.version.code")).usingNumbers'), ((1116, 1261), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().declaredClass'), ((1174, 1260), 'org.luckypray.dexkit.query.matchers.ClassMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter.sidebar; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class DockSuggest extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("supportFreeform") ) ).singleOrThrow(() -> new RuntimeException("Method not found")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Current hooking method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (mPrefsMap.getStringAsInt("security_center_sidebar_show_suggest", 0) == 1) { param.setResult(false); } else if (mPrefsMap.getStringAsInt("security_center_sidebar_show_suggest", 0) == 2) { param.setResult(true); } } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"supportFreeform\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod" ]
[((1248, 1491), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("supportFreeform")\n )\n ).singleOrThrow'), ((1248, 1429), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1248, 1281), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1293, 1419), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1334, 1405), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.securitycenter; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; public class EnableGameSpeed extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData getPropVoidData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:") .returnType(void.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found getPropVoid method")); Method getPropVoid = getPropVoidData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "getPropVoid method is " + getPropVoid); hookMethod(getPropVoid, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (param.args[0] == "debug.game.video.speed") param.args[1] = "true"; } }); MethodData getPropBooleanData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found getPropBoolean method")); Method getBooleanVoid = getPropBooleanData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "getPropBoolean method is " + getBooleanVoid); hookMethod(getBooleanVoid, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { if (param.args[0] == "debug.game.video.support") param.setResult(true); } }); MethodData methodData1 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("debug.game.video.support") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"debug.game.video.support\"")); Method method1 = methodData1.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"debug.game.video.support\" method is " + method1); hookMethod(method1, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(true); } }); MethodData methodData2 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("pref_open_game_booster") .returnType(boolean.class) ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"pref_open_game_booster\"")); Method method2 = methodData2.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"pref_open_game_booster\" method is " + method2); hookMethod(method2, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { param.setResult(true); } }); MethodData methodData3 = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("debug.game.video.boot") ) ).singleOrThrow(() -> new IllegalStateException("EnableGameSpeed: Cannot found MethodData usingString \"debug.game.video.boot\"")); Method method3 = methodData3.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "UsingString \"debug.game.video.boot\" method is " + method3); hookMethod(method3, new MethodHook() { @Override protected void before(MethodHookParam param) { mSetProp(); param.setResult(null); } }); findAndHookMethod("com.miui.gamebooster.service.GameBoosterService", "onCreate", new MethodHook() { @Override protected void after(MethodHookParam param) { mSetProp(); } } ); } public void mSetProp() { setProp("debug.game.video.boot", "true"); setProp("debug.game.video.speed", "true"); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"android.os.SystemProperties\", \"set\", \"SystemPropertiesUtils\", \"SystemPropertiesUtils getInt:\")\n .returnType(void.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"android.os.SystemProperties\", \"getBoolean\", \"SystemPropertiesUtils\", \"SystemPropertiesUtils getInt:\")\n .returnType(boolean.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"debug.game.video.boot\")\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"pref_open_game_booster\")\n .returnType(boolean.class)\n )\n ).singleOrThrow", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"debug.game.video.support\")\n .returnType(boolean.class)\n )\n ).singleOrThrow" ]
[((1250, 1647), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:")\n .returnType(void.class)\n )\n ).singleOrThrow'), ((1250, 1548), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1250, 1283), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1295, 1538), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1336, 1524), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "set", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:").returnType'), ((1336, 1484), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((2117, 2527), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((2117, 2425), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((2117, 2150), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((2162, 2415), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((2203, 2401), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("android.os.SystemProperties", "getBoolean", "SystemPropertiesUtils", "SystemPropertiesUtils getInt:").returnType'), ((2203, 2358), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((3006, 3371), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("debug.game.video.support")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((3006, 3239), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((3006, 3039), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((3051, 3229), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((3092, 3215), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("debug.game.video.support").returnType'), ((3092, 3172), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((3799, 4160), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("pref_open_game_booster")\n .returnType(boolean.class)\n )\n ).singleOrThrow'), ((3799, 4030), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((3799, 3832), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((3844, 4020), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((3885, 4006), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create()\n .usingStrings("pref_open_game_booster").returnType'), ((3885, 3963), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings'), ((4586, 4902), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("debug.game.video.boot")\n )\n ).singleOrThrow'), ((4586, 4773), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((4586, 4619), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((4631, 4763), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((4672, 4749), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.ui.fragment; import android.view.View; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.ui.base.BaseSettingsActivity; import com.sevtinge.hyperceiler.ui.fragment.base.SettingsPreferenceFragment; import com.sevtinge.hyperceiler.utils.shell.ShellInit; import moralnorm.preference.Preference; public class PhoneFragment extends SettingsPreferenceFragment { Preference mPhone; @Override public int getContentResId() { return R.xml.phone; } @Override public View.OnClickListener addRestartListener() { return view -> ((BaseSettingsActivity) getActivity()).showRestartDialog( getResources().getString(R.string.phone), "com.android.phone" ); } @Override public void initPrefs() { mPhone = findPreference("prefs_key_phone_additional_network_settings"); mPhone.setOnPreferenceClickListener( preference -> { ShellInit.getShell().run("am start -n com.android.phone/.SwitchDebugActivity").sync(); return true; } ); } }
[ "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run(\"am start -n com.android.phone/.SwitchDebugActivity\").sync", "com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run" ]
[((1707, 1792), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run("am start -n com.android.phone/.SwitchDebugActivity").sync'), ((1707, 1785), 'com.sevtinge.hyperceiler.utils.shell.ShellInit.getShell().run')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.base; import com.github.kyuubiran.ezxhelper.EzXHelper; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.dexkit.InitDexKit; import com.sevtinge.hyperceiler.utils.ContextUtils; import com.sevtinge.hyperceiler.utils.api.ProjectApi; import com.sevtinge.hyperceiler.utils.log.XposedLogUtils; import com.sevtinge.hyperceiler.utils.prefs.PrefsMap; import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; public abstract class BaseModule implements IXposedHook { public LoadPackageParam mLoadPackageParam = null; public String TAG = getClass().getSimpleName(); public static ILoadDexKit loadDexKit; public final PrefsMap<String, Object> mPrefsMap = XposedInit.mPrefsMap; public interface ILoadDexKit { void createDexKit(LoadPackageParam lpparam, String TAG); } public static void setLoadDexKit(ILoadDexKit iLoadDexKit) { loadDexKit = iLoadDexKit; } public void init(LoadPackageParam lpparam) { EzXHelper.initHandleLoadPackage(lpparam); EzXHelper.setLogTag(TAG); EzXHelper.setToastTag(TAG); // 把模块资源加载到目标应用 try { if (!ProjectApi.mAppModulePkg.equals(lpparam.packageName)) { ContextUtils.getWaitContext( context -> { if (context != null) { BaseXposedInit.mResHook.loadModuleRes(context); // mResHook.loadModuleRes(context); } }, "android".equals(lpparam.packageName)); } } catch (Throwable e) { XposedLogUtils.logE(TAG, "get context failed!" + e); } mLoadPackageParam = lpparam; initZygote(); DexKitHelper helper = new DexKitHelper(); InitDexKit kit = new InitDexKit(); loadDexKit.createDexKit(mLoadPackageParam, TAG); handleLoadPackage(); if (helper.useDexKit) { try { kit.closeHostDir(); // XposedLogUtils.logE(TAG, "close dexkit s: " + lpparam.packageName); } catch (Exception e) { XposedLogUtils.logE(TAG, "close dexkit failed!" + e); } } } @Override public void initZygote() { } public void initHook(BaseHook baseHook) { initHook(baseHook, true); } public void initHook(BaseHook baseHook, boolean isInit) { if (isInit) { baseHook.onCreate(mLoadPackageParam); } } private static class DexKitHelper implements InitDexKit.IUseDexKit { public boolean useDexKit = false; public DexKitHelper() { InitDexKit.setUseDexKit(this); } @Override public void useDexKit(boolean use) { useDexKit = use; } } }
[ "com.sevtinge.hyperceiler.utils.api.ProjectApi.mAppModulePkg.equals" ]
[((1963, 2015), 'com.sevtinge.hyperceiler.utils.api.ProjectApi.mAppModulePkg.equals')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.systemui.controlcenter; import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.database.ContentObserver; import android.os.Build; import android.os.Handler; import android.provider.Settings; import android.util.ArrayMap; import com.sevtinge.hyperceiler.R; import com.sevtinge.hyperceiler.utils.TileUtils; import com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager; import de.robv.android.xposed.XC_MethodHook.MethodHookParam; import de.robv.android.xposed.XposedHelpers; public class FiveGTile extends TileUtils { String mNfcTileClsName = isMoreAndroidVersion(Build.VERSION_CODES.TIRAMISU) ? "com.android.systemui.qs.tiles.MiuiNfcTile" : "com.android.systemui.qs.tiles.NfcTile"; boolean Style = mPrefsMap.getStringAsInt("system_control_center_5g_new_tile", 0) == 1; @Override public void init() { super.init(); } @Override public Class<?> customClass() { return findClassIfExists(mNfcTileClsName); } @Override public String setTileProvider() { return isMoreAndroidVersion(Build.VERSION_CODES.TIRAMISU) ? "nfcTileProvider" : "mNfcTileProvider"; } @Override public String customName() { return "custom_5G"; } @Override public int customRes() { return R.string.system_control_center_5g_toggle_label; } @Override public void tileCheck(MethodHookParam param, String tileName) { // 获取设置是否支持5G param.setResult(TelephonyManager.getDefault().isFiveGCapable()); } @Override public void tileLongClickIntent(MethodHookParam param, String tileName) { Intent intent = new Intent(Intent.ACTION_MAIN); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); intent.setComponent(new ComponentName("com.android.phone", "com.android.phone.settings.MiuiFiveGNetworkSetting")); // 原活动是 com.android.phone.settings.PreferredNetworkTypeListPreference param.setResult(intent); } @Override public void tileClick(MethodHookParam param, String tileName) { TelephonyManager manager = TelephonyManager.getDefault(); // 切换5G状态 manager.setUserFiveGEnabled(!manager.isUserFiveGEnabled()); // 更新磁贴状态 XposedHelpers.callMethod(param.thisObject, "refreshState"); } @Override public void tileListening(MethodHookParam param, String tileName) { Context mContext = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext"); boolean mListening = (boolean) param.args[0]; if (mListening) { ContentObserver contentObserver = new ContentObserver(new Handler(mContext.getMainLooper())) { @Override public void onChange(boolean z) { XposedHelpers.callMethod(param.thisObject, "refreshState"); } }; mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor("fiveg_user_enable"), false, contentObserver); mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor("dual_nr_enabled"), false, contentObserver); XposedHelpers.setAdditionalInstanceField(param.thisObject, "tileListener", contentObserver); } else { ContentObserver contentObserver = (ContentObserver) XposedHelpers.getAdditionalInstanceField(param.thisObject, "tileListener"); mContext.getContentResolver().unregisterContentObserver(contentObserver); } } @Override public ArrayMap<String, Integer> tileUpdateState(MethodHookParam param, Class<?> mResourceIcon, String tileName) { boolean isEnable; TelephonyManager manager = TelephonyManager.getDefault(); isEnable = manager.isUserFiveGEnabled(); ArrayMap<String, Integer> tileResMap = new ArrayMap<>(); tileResMap.put("custom_5G_Enable", isEnable ? 1 : 0); tileResMap.put("custom_5G_ON", Style ? R.drawable.ic_control_center_5g_toggle_on : R.drawable.ic_control_center_5g_toggle_v2_on); tileResMap.put("custom_5G_OFF", Style ? R.drawable.ic_control_center_5g_toggle_off : R.drawable.ic_control_center_5g_toggle_v2_off); return tileResMap; } }
[ "com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable" ]
[((2395, 2441), 'com.sevtinge.hyperceiler.utils.devicesdk.TelephonyManager.getDefault().isFiveGCapable'), ((3920, 3966), 'android.provider.Settings.Global.getUriFor'), ((4059, 4103), 'android.provider.Settings.Global.getUriFor')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.home.dock; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.os.Bundle; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import com.sevtinge.hyperceiler.XposedInit; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.utils.DisplayUtils; import com.sevtinge.hyperceiler.utils.blur.BlurUtils; import de.robv.android.xposed.XposedHelpers; public class DockCustom extends BaseHook { FrameLayout mDockView; boolean isFolderShowing; boolean isShowEditPanel; boolean isRecentShowing; Class<?> mLauncherCls; Class<?> mLauncherStateCls; Class<?> mDeviceConfigCls; Class<?> mFolderInfo; Class<?> mBlurUtils; @Override public void init() { mLauncherCls = findClassIfExists("com.miui.home.launcher.Launcher"); mLauncherStateCls = findClassIfExists("com.miui.home.launcher.LauncherState"); mDeviceConfigCls = findClassIfExists("com.miui.home.launcher.DeviceConfig"); mFolderInfo = findClassIfExists("com.miui.home.launcher.FolderInfo"); mBlurUtils = findClassIfExists("com.miui.home.launcher.common.BlurUtils"); findAndHookMethod(mLauncherCls, "onCreate", Bundle.class, new MethodHook() { @Override protected void after(MethodHookParam param) { Activity mActivity = (Activity) param.thisObject; FrameLayout mSearchBarContainer = (FrameLayout) XposedHelpers.callMethod(param.thisObject, "getSearchBarContainer"); FrameLayout mSearchEdgeLayout = (FrameLayout) mSearchBarContainer.getParent(); int mDockHeight = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_height", 80)); int mDockMargin = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_margin_horizontal", 30)); int mDockBottomMargin = DisplayUtils.dip2px(mSearchBarContainer.getContext(), XposedInit.mPrefsMap.getInt("home_dock_bg_margin_bottom", 30)); mDockView = new FrameLayout(mSearchBarContainer.getContext()); FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, mDockHeight); layoutParams.gravity = Gravity.BOTTOM; layoutParams.setMargins(mDockMargin, 0, mDockMargin, mDockBottomMargin); mDockView.setLayoutParams(layoutParams); mSearchEdgeLayout.addView(mDockView, 0); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { new BlurUtils(mDockView, "home_dock_bg_custom"); } findAndHookMethod(mLauncherCls, "isFolderShowing", new MethodHook() { @Override protected void after(MethodHookParam param) { isFolderShowing = (boolean) param.getResult(); } }); findAndHookMethod(mLauncherCls, "showEditPanel", boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { isShowEditPanel = (boolean) param.args[0]; mDockView.setVisibility(isShowEditPanel ? View.GONE : View.VISIBLE); } }); findAndHookMethod(mLauncherCls, "openFolder", mFolderInfo, View.class, new MethodHook() { @Override protected void after(MethodHookParam param) { mDockView.setVisibility(View.GONE); } }); findAndHookMethod(mLauncherCls, "closeFolder", boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { if (!isShowEditPanel) mDockView.setVisibility(View.VISIBLE); } }); findAndHookMethod(mBlurUtils, "fastBlurWhenEnterRecents", mLauncherCls, mLauncherStateCls, boolean.class, new MethodHook() { @Override protected void after(MethodHookParam param) { mDockView.setVisibility(View.GONE); } }); } }); findAndHookMethod(mLauncherCls, "onStateSetStart", mLauncherStateCls, new MethodHook() { @Override protected void after(MethodHookParam param) { Boolean mLauncherState = param.args[0].getClass().getSimpleName().equals("LauncherState"); Boolean mNormalState = param.args[0].getClass().getSimpleName().equals("NormalState"); if ((mLauncherState || mNormalState) && !isFolderShowing && !isShowEditPanel) { mDockView.setVisibility(View.VISIBLE); } else { mDockView.setVisibility(View.GONE); } } }); /*findAndHookMethod(mDeviceConfigCls,"calcHotSeatsMarginTop", Context.class, boolean.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { Context context = (Context) param.args[0]; param.setResult(DisplayUtils.dip2px(context, XposedInit.mPrefsMap.getInt("home_dock_margin_top",25))); } }); findAndHookMethod(mDeviceConfigCls,"calcHotSeatsMarginBottom", Context.class, boolean.class, boolean.class, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { Context context = (Context) param.args[0]; param.setResult(DisplayUtils.dip2px(context, XposedInit.mPrefsMap.getInt("home_dock_icon_margin_bottom",90))); } });*/ } public GradientDrawable getDockBackground(Context context) { GradientDrawable mDockBackground = new GradientDrawable(); mDockBackground.setShape(GradientDrawable.RECTANGLE); mDockBackground.setColor(Color.argb(60, 255, 255, 255)); mDockBackground.setCornerRadius(DisplayUtils.dip2px(context, 22)); return mDockBackground; } }
[ "com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt" ]
[((2660, 2714), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2805, 2870), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt'), ((2967, 3028), 'com.sevtinge.hyperceiler.XposedInit.mPrefsMap.getInt')]
/* * This file is part of HyperCeiler. * HyperCeiler is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. * Copyright (C) 2023-2024 HyperCeiler Contributions */ package com.sevtinge.hyperceiler.module.hook.camera; import com.sevtinge.hyperceiler.module.base.BaseHook; import com.sevtinge.hyperceiler.module.base.dexkit.DexKit; import org.luckypray.dexkit.query.FindMethod; import org.luckypray.dexkit.query.matchers.MethodMatcher; import org.luckypray.dexkit.result.MethodData; import java.lang.reflect.Method; import java.util.Objects; public class EnableLabOptions extends BaseHook { @Override public void init() throws NoSuchMethodException { MethodData methodData = DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create() .matcher(MethodMatcher.create() .usingStrings("getBoolean", "SystemProperties", "Exception while getting system property: ") ) ).singleOrThrow(() -> new IllegalStateException("EnableLabOptions: Cannot found MethodData")); Method method = methodData.getMethodInstance(lpparam.classLoader); logD(TAG, lpparam.packageName, "Unlock camera.lab.options method is " + method); hookMethod(method, new MethodHook() { @Override protected void before(MethodHookParam param) throws Throwable { String mStr = (String) param.args[0]; if (Objects.equals(mStr, "camera.lab.options")) param.setResult(true); } }); } }
[ "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod", "com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings(\"getBoolean\", \"SystemProperties\", \"Exception while getting system property: \")\n )\n ).singleOrThrow" ]
[((1263, 1596), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod(FindMethod.create()\n .matcher(MethodMatcher.create()\n .usingStrings("getBoolean", "SystemProperties", "Exception while getting system property: ")\n )\n ).singleOrThrow'), ((1263, 1504), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge().findMethod'), ((1263, 1296), 'com.sevtinge.hyperceiler.module.base.dexkit.DexKit.INSTANCE.getDexKitBridge'), ((1308, 1494), 'org.luckypray.dexkit.query.FindMethod.create().matcher'), ((1349, 1480), 'org.luckypray.dexkit.query.matchers.MethodMatcher.create().usingStrings')]
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
5