Skip to content

Commit

Permalink
opt: migrate some code && adjust the way of loading hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
lingqiqi5211 committed Apr 21, 2024
1 parent 5ff46b1 commit d84130b
Show file tree
Hide file tree
Showing 57 changed files with 117 additions and 115 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.aiasst.AiCaptions;
import com.sevtinge.hyperceiler.module.hook.aiasst.DisableWatermark;

@HookExpand(pkg = "com.xiaomi.aiasst.vision", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.aiasst.vision", isPad = false, tarAndroid = 33)
public class AiAsst extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.aod.UnlockAlwaysOnDisplay;
import com.sevtinge.hyperceiler.module.hook.aod.UnlockAodAon;

@HookExpand(pkg = "com.miui.aod", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.aod", isPad = false, tarAndroid = 33)
public class Aod extends BaseModule {
@Override
public void handleLoadPackage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.backup.AllowBackupAllApps;
import com.sevtinge.hyperceiler.module.hook.backup.UnlockBrokenScreenBackup;

@HookExpand(pkg = "com.miui.backup", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.backup", isPad = false, tarAndroid = 33)
public class Backup extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/
package com.sevtinge.hyperceiler.module.app;

import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.barrage.*;
import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.barrage.AnyBarrage;
import com.sevtinge.hyperceiler.module.hook.barrage.CustomBarrageLength;

@HookExpand(pkg = "com.xiaomi.barrage", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.barrage", isPad = false, tarAndroid = 33)
public class Barrage extends BaseModule {
@Override
public void handleLoadPackage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.sevtinge.hyperceiler.module.hook.browser.EnableDebugEnvironment;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.android.browser", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.browser", isPad = false, tarAndroid = 33)
public class Browser extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.calendar.UnlockSubscription;

@HookExpand(pkg = "com.android.calendar", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.calendar", isPad = false, tarAndroid = 33)
public class Calendar extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import com.sevtinge.hyperceiler.module.hook.camera.UnlockVlog;
import com.sevtinge.hyperceiler.module.hook.camera.UnlockVlogPro;

@HookExpand(pkg = "com.android.camera", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.camera", isPad = false, tarAndroid = 33)
public class Camera extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
*/
package com.sevtinge.hyperceiler.module.app;

import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion;

import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.contentextension.DoublePress;
Expand All @@ -30,7 +28,7 @@
import com.sevtinge.hyperceiler.module.hook.contentextension.UnlockTaplus;
import com.sevtinge.hyperceiler.module.hook.contentextension.UseThirdPartyBrowser;

@HookExpand(pkg = "com.miui.contentextension", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.contentextension", isPad = false, tarAndroid = 33)
public class ContentExtension extends BaseModule {

@Override
Expand All @@ -39,11 +37,8 @@ public void handleLoadPackage() {
initHook(new DoublePress(), mPrefsMap.getBoolean("content_extension_double_press"));
initHook(new SuperImage(), mPrefsMap.getBoolean("content_extension_super_image"));
initHook(new Taplus(), mPrefsMap.getBoolean("security_center_taplus"));
initHook(new LinkOpenMode());
initHook(new LinkOpenMode(), true);
initHook(HorizontalContentExtension.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus_horizontal"));

if (!isAndroidVersion(30)) {
initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
}
initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.creation.UnlockCreation;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.miui.creation", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.creation", isPad = false, tarAndroid = 33)
public class Creation extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
import com.sevtinge.hyperceiler.module.hook.demo.ColorTest;
import com.sevtinge.hyperceiler.module.hook.demo.CrashDemo;
import com.sevtinge.hyperceiler.module.hook.demo.ToastTest;
import com.sevtinge.hyperceiler.utils.log.XposedLogUtils;

@HookExpand(pkg = "com.hchen.demo", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.hchen.demo", isPad = false, tarAndroid = 33)
public class Demo extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.downloads.FuckXlDownload;

@HookExpand(pkg = "com.android.providers.downloads", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.providers.downloads", isPad = false, tarAndroid = 33)
public class Downloads extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.externalstorage.DisableFolderCantUse;

@HookExpand(pkg = "com.android.externalstorage", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.externalstorage", isPad = false, tarAndroid = 33)
public class ExternalStorage extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.fileexplorer.SelectName;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.android.fileexplorer", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.fileexplorer", isPad = false, tarAndroid = 33)
public class FileExplorer extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.sevtinge.hyperceiler.module.hook.gallery.UnlockAIGallery;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.miui.gallery", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.gallery", isPad = false, tarAndroid = 33)
public class Gallery extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.getapps.DeviceModify;
import com.sevtinge.hyperceiler.module.hook.getapps.DisablePackageMonitor;

@HookExpand(pkg = "com.xiaomi.market", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.market", isPad = false, tarAndroid = 33)
public class GetApps extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.guardprovider.DisableUploadAppListNew;

@HookExpand(pkg = "com.miui.guardprovider", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.guardprovider", isPad = false, tarAndroid = 33)
public class GuardProvider extends BaseModule {
@Override
public void handleLoadPackage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.module.app;
package com.sevtinge.hyperceiler.module.app.Home.Phone;

import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad;

Expand Down Expand Up @@ -135,8 +135,8 @@

import java.util.Objects;

@HookExpand(pkg = "com.miui.home", isPad = false, tarAndroid = 34)
public class Home extends BaseModule {
@HookExpand(pkg = "com.miui.home", isPad = false, tarAndroid = 33)
public class HomeT extends BaseModule {

@Override
public void handleLoadPackage() {
Expand Down Expand Up @@ -204,13 +204,13 @@ public void handleLoadPackage() {
initHook(DisableRecentViewWallpaperDarken.INSTANCE, mPrefsMap.getBoolean("home_recent_disable_wallpaper_dimming"));
initHook(HideStatusBarWhenEnterRecent.INSTANCE, mPrefsMap.getBoolean("home_recent_hide_status_bar_in_task_view"));
initHook(RemoveCardAnim.INSTANCE, mPrefsMap.getBoolean("home_recent_modify_animation"));
initHook(TaskViewHorizontal.INSTANCE);
initHook(TaskViewVertical.INSTANCE);
initHook(TaskViewHorizontal.INSTANCE, true);
initHook(TaskViewVertical.INSTANCE, true);
initHook(HideFreeform.INSTANCE, mPrefsMap.getBoolean("home_recent_hide_freeform"));
initHook(new HideCleanUp(), mPrefsMap.getBoolean("home_recent_hide_clean_up"));
initHook(FreeformCardBackgroundColor.INSTANCE);
initHook(CardTextColor.INSTANCE);
initHook(CardTextSize.INSTANCE);
initHook(FreeformCardBackgroundColor.INSTANCE, true);
initHook(CardTextColor.INSTANCE, true);
initHook(CardTextSize.INSTANCE, true);
initHook(UnlockPin.INSTANCE, mPrefsMap.getBoolean("home_recent_unlock_pin"));
initHook(RecentText.INSTANCE, !Objects.equals(mPrefsMap.getString("home_recent_text", ""), ""));
initHook(RemoveIcon.INSTANCE, mPrefsMap.getBoolean("home_recent_remove_icon"));
Expand Down Expand Up @@ -238,7 +238,7 @@ public void handleLoadPackage() {
initHook(new IconTitleCustomization(), mPrefsMap.getBoolean("home_title_title_icontitlecustomization_onoff"));
initHook(new HiddenAllTitle(), mPrefsMap.getBoolean("home_drawer_font_hidden"));
initHook(new TitleFontSize(), mPrefsMap.getInt("home_title_font_size", 12) != 12);
initHook(IconTitleColor.INSTANCE);
initHook(IconTitleColor.INSTANCE, true);
initHook(new UnlockHotseatIcon(), mPrefsMap.getBoolean("home_dock_unlock_hotseat"));

// 小部件
Expand Down Expand Up @@ -278,7 +278,7 @@ public void handleLoadPackage() {
initHook(AlwaysBlurWallpaper.INSTANCE, mPrefsMap.getBoolean("home_other_always_blur_launcher_wallpaper"));
initHook(BlurRadius.INSTANCE, mPrefsMap.getInt("home_other_blur_radius", 100) != 100);
initHook(ShortcutItemCount.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_remove_restrictions"));
initHook(ShowAllHideApp.INSTANCE); // 桌面快捷方式管理
initHook(ShowAllHideApp.INSTANCE, true); // 桌面快捷方式管理
initHook(new AllowShareApk(), mPrefsMap.getBoolean("home_other_allow_share_apk"));

// 实验性功能
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.huanji.AllowMoveAllApps;

@HookExpand(pkg = "com.miui.huanji", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.huanji", isPad = false, tarAndroid = 33)
public class Huanji extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.incallui.AnswerInHeadUp;
import com.sevtinge.hyperceiler.module.hook.incallui.HideCrbt;

@HookExpand(pkg = "com.android.incallui", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.incallui", isPad = false, tarAndroid = 33)
public class InCallUi extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.joyose.DisableCloudControl;
import com.sevtinge.hyperceiler.module.hook.joyose.EnableGpuTuner;

@HookExpand(pkg = "com.xiaomi.joyose", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.joyose", isPad = false, tarAndroid = 33)
public class Joyose extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.lbe.DisableClipboardTip;

@HookExpand(pkg = "com.lbe.security.miui", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.lbe.security.miui", isPad = false, tarAndroid = 33)
public class Lbe extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import java.util.Objects;

@HookExpand(pkg = "com.miui.mediaeditor", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.mediaeditor", isPad = false, tarAndroid = 33)
public class MediaEditor extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.cloudservice.CloudList;

@HookExpand(pkg = "com.miui.cloudservice", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.cloudservice", isPad = false, tarAndroid = 33)
public class MiCloudService extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import com.sevtinge.hyperceiler.module.hook.milink.UnlockHMind;
import com.sevtinge.hyperceiler.module.hook.milink.UnlockMiShare;

@HookExpand(pkg = "com.milink.service", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.milink.service", isPad = false, tarAndroid = 33)
public class MiLink extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.misettings.CustomRefreshRate;
import com.sevtinge.hyperceiler.module.hook.misettings.ShowMoreFpsList;

@HookExpand(pkg = "com.xiaomi.misettings", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.misettings", isPad = false, tarAndroid = 33)
public class MiSettings extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import com.sevtinge.hyperceiler.module.hook.mishare.NoAutoTurnOff;
import com.sevtinge.hyperceiler.module.hook.mishare.UnlockTurboMode;

@HookExpand(pkg = "com.miui.mishare.connectivity", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.mishare.connectivity", isPad = false, tarAndroid = 33)
public class MiShare extends BaseModule {

@Override
public void handleLoadPackage() {
initHook(NoAutoTurnOff.INSTANCE, mPrefsMap.getBoolean("disable_mishare_auto_off"));
initHook(UnlockTurboMode.INSTANCE, mPrefsMap.getBoolean("unlock_turbo_mode"));
initHook(NoAutoTurnOff.INSTANCE); // 禁用 10 分钟自动关闭
initHook(UnlockTurboMode.INSTANCE); // 解锁极速传输模式
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.misound.IncreaseSamplingRate;

@HookExpand(pkg = "com.miui.misound", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.misound", isPad = false, tarAndroid = 33)
public class MiSound extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.miwallpaper.UnlockSuperWallpaper;

@HookExpand(pkg = "com.miui.miwallpaper", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.miwallpaper", isPad = false, tarAndroid = 33)
public class MiWallpaper extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.mms.DisableAd;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.android.mms", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.mms", isPad = false, tarAndroid = 33)
public class Mms extends BaseModule {
@Override
public void handleLoadPackage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.mtb.BypassAuthentication;
import com.sevtinge.hyperceiler.module.hook.mtb.IsUserBuild;

@HookExpand(pkg = "com.xiaomi.mtb", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.xiaomi.mtb", isPad = false, tarAndroid = 33)
public class Mtb extends BaseModule {
@Override
public void handleLoadPackage() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.nfc.AllowInformationScreen;
import com.sevtinge.hyperceiler.module.hook.nfc.DisableSound;

@HookExpand(pkg = "com.android.nfc", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.android.nfc", isPad = false, tarAndroid = 33)
public class Nfc extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.sevtinge.hyperceiler.module.base.HookExpand;
import com.sevtinge.hyperceiler.module.hook.various.UnlockSuperClipboard;

@HookExpand(pkg = "com.miui.notes", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.notes", isPad = false, tarAndroid = 33)
public class Notes extends BaseModule {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.sevtinge.hyperceiler.module.hook.packageinstaller.InstallRiskDisable;
import com.sevtinge.hyperceiler.module.hook.packageinstaller.InstallSource;

@HookExpand(pkg = "com.miui.packageinstaller", isPad = false, tarAndroid = 34)
@HookExpand(pkg = "com.miui.packageinstaller", isPad = false, tarAndroid = 33)
public class PackageInstaller extends BaseModule {

public void handleLoadPackage() {
Expand Down
Loading

0 comments on commit d84130b

Please sign in to comment.