Skip to content

Commit

Permalink
Revert "[移除] 结束对 Android 11/12 的支持 && 提升 min sdk 为 33 && 移除部分仅旧版 Andr…
Browse files Browse the repository at this point in the history
…oid 设备支持的功能"
  • Loading branch information
Sevtinge committed Nov 10, 2023
1 parent 1bda0c3 commit 95d53d9
Show file tree
Hide file tree
Showing 73 changed files with 965 additions and 183 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/androidr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Android-R CI

on:
push:
branches: [ "Android_R" ]
pull_request:
branches: [ "Android_R" ]
paths-ignore:
- ".github/**"
- "!.github/workflows/**"
- ".idea/"
- "doc/*"
- "*.md"
- ".github/workflows/crowdin.yml"
- "crowdin.yml"
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
name: Build App
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'
cache: gradle

- name: Create Sign File
run: |
touch signing.properties
echo storePassword=${{ secrets.KEY_STORE_PASSWORD }} >> signing.properties
echo keyAlias=${{ secrets.ALIAS }} >> signing.properties
echo keyPassword='${{ secrets.KEY_STORE_PASSWORD }}' >> signing.properties
echo storeFile=key.jks >> signing.properties
echo ${{ secrets.SIGNING_KEY }} | base64 --decode > key.jks
- name: Build with Gradle
if: contains(github.event.head_commit.message, '[skip]') == false
shell: bash
run: ./gradlew assembleCanary

- name: Find APKs
if: contains(github.event.head_commit.message, '[skip]') == false
run: |
echo "APK_FILE_CANARY=$(find app/build/outputs/apk/canary -name '*.apk')" >> $GITHUB_ENV
- name: Show APKs SHA256
if: success() && contains(github.event.head_commit.message, '[skip]') == false
run: |
echo "### Build Success" >> $GITHUB_STEP_SUMMARY
echo "|Artifact|SHA256|" >> $GITHUB_STEP_SUMMARY
echo "|:--------:|:----------|" >> $GITHUB_STEP_SUMMARY
canary=($(sha256sum '${{ env.APK_FILE_CANARY }}'))
echo "|Canary|$canary" >> $GITHUB_STEP_SUMMARY
- name: Upload Canary APK
if: contains(github.event.head_commit.message, '[upload]') == true
uses: actions/upload-artifact@v3
with:
name: Cemiler Canary
path: ${{ env.APK_FILE_CANARY }}

- name: Post to Android R/S Channel
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && github.ref_type != 'tag' && contains(github.event.head_commit.message, '[skip post]') == false && contains(github.event.head_commit.message, 's#') == false }}
shell: bash
env:
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN_TWO }}
CANARY: ${{ env.APK_FILE_CANARY }}
run: |
mkdir -p ${{ github.workspace }}/git_clone
git clone ${{ github.event.repository.url }} ${{ github.workspace }}/git_clone -b ${{ github.ref_name }}
cd ${{ github.workspace }}/git_clone
{
echo -e "Github Action for Android_R\n";
git log ${{ github.event.before }}..${{ github.event.after }} --pretty=format:"%h %s";
echo -e " (by ${{ github.event.head_commit.author.name }})";
} > ${{ github.workspace }}/git_log
ESCAPED="$(cat ${{ github.workspace }}/git_log | gawk '{gsub(/[_*[\]()~`>#+=\|{}.!-]/,"\\\\\\\\&")}1' | sed -e 's|"|\\"|g' -e 's|^[0-9a-z]\+|__&__|' | hexdump -v -e '/1 "%02X"' | sed 's/\(..\)/%\1/g')"
cd ${{ github.workspace }}
curl -v "https://api.telegram.org/bot${BOT_TOKEN}/sendMediaGroup?chat_id=${CHANNEL_ID}&media=%5B%7B%22type%22%3A%22document%22%2C%20%22media%22%3A%22attach%3A%2F%2Fcanary%22%2C%22parse_mode%22%3A%22MarkdownV2%22%2C%22caption%22%3A%22${ESCAPED}%22%7D%5D" -F canary="@${CANARY}"
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ android {
defaultConfig {
namespace 'com.sevtinge.hyperceiler'
applicationId namespace
minSdk 33
minSdk 30
targetSdk 34
versionCode 132
versionName "2.3.132"
project.archivesBaseName = "HyperCeiler"
ndk {
// noinspection ChromeOsAbiSupport
abiFilters 'arm64-v8a'
abiFilters 'arm64-v8a', 'armeabi-v7a'
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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.hook.contentextension.DoublePress;
import com.sevtinge.hyperceiler.module.hook.contentextension.HorizontalContentExtension;
Expand All @@ -18,7 +20,9 @@ public void handleLoadPackage() {
initHook(new LinkOpenMode());
initHook(HorizontalContentExtension.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus_horizontal"));

initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
if (!isAndroidVersion(30)){
initHook(UnlockTaplus.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
}
}
}

14 changes: 9 additions & 5 deletions app/src/main/java/com/sevtinge/hyperceiler/module/app/Home.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.sevtinge.hyperceiler.module.app;

import static com.sevtinge.hyperceiler.utils.BuildUtils.getBuildType;
import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad;
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isAndroidVersion;

import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.base.CloseHostDir;
Expand Down Expand Up @@ -60,6 +62,7 @@
import com.sevtinge.hyperceiler.module.hook.home.other.BlurRadius;
import com.sevtinge.hyperceiler.module.hook.home.other.BlurWhenShowShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.DisableHideGoogle;
import com.sevtinge.hyperceiler.module.hook.home.other.FixAndroidRS;
import com.sevtinge.hyperceiler.module.hook.home.other.FreeformShortcutMenu;
import com.sevtinge.hyperceiler.module.hook.home.other.HomeMode;
import com.sevtinge.hyperceiler.module.hook.home.other.InfiniteScroll;
Expand Down Expand Up @@ -159,7 +162,7 @@ public void handleLoadPackage() {
// 抽屉
initHook(AppDrawer.INSTANCE, mPrefsMap.getBoolean("home_drawer_all") ||
mPrefsMap.getBoolean("home_drawer_editor"));
initHook(AllAppsContainerViewBlur.INSTANCE, mPrefsMap.getBoolean("home_drawer_blur"));
initHook(AllAppsContainerViewBlur.INSTANCE, mPrefsMap.getBoolean("home_drawer_blur") && !isAndroidVersion(30));
initHook(new PinyinArrangement(), mPrefsMap.getBoolean("home_drawer_pinyin"));

// 最近任务
Expand Down Expand Up @@ -230,12 +233,13 @@ public void handleLoadPackage() {
initHook(ShortcutItemCount.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_remove_restrictions"));
initHook(DisableHideGoogle.INSTANCE, mPrefsMap.getBoolean("home_other_disable_hide_google"));
initHook(ShowAllHideApp.INSTANCE); // 桌面快捷方式管理
initHook(FixAndroidRS.INSTANCE, mPrefsMap.getBoolean("home_other_fix_android_r_s"));

// 实验性功能
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur"));
initHook(FolderBlur.INSTANCE, mPrefsMap.getBoolean("home_folder_blur"));
initHook(BlurWhenShowShortcutMenu.INSTANCE, mPrefsMap.getBoolean("home_other_shortcut_background_blur") && !isAndroidVersion(30));
initHook(FolderBlur.INSTANCE, mPrefsMap.getBoolean("home_folder_blur") && !isAndroidVersion(30));
initHook(new FoldDock(), mPrefsMap.getBoolean("home_other_fold_dock"));
initHook(new AllAppsBlur());
initHook(new AllAppsBlur(), !isAndroidVersion(30));
initHook(new FixAnimation(), mPrefsMap.getBoolean("home_title_fix_animation"));
initHook(new LargeIconCornerRadius(), mPrefsMap.getBoolean("home_large_icon_enable"));

Expand All @@ -244,7 +248,7 @@ public void handleLoadPackage() {
initHook(new MaxFreeForm(), mPrefsMap.getBoolean("system_framework_freeform_count"));

// Fold2样式负一屏
initHook(new OverlapMode(), mPrefsMap.getBoolean("personal_assistant_overlap_mode"));
initHook(new OverlapMode(), mPrefsMap.getBoolean("personal_assistant_overlap_mode") && !isAndroidVersion(30));

// Other
initHook(new ToastSlideAgain(), mPrefsMap.getBoolean("home_other_toast_slide_again"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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.CloseHostDir;
import com.sevtinge.hyperceiler.module.base.LoadHostDir;
Expand All @@ -17,9 +19,9 @@ public void handleLoadPackage() {
// initHook(new BlurOverlay(), false);
initHook(new EnableFoldWidget(), mPrefsMap.getBoolean("personal_assistant_fold_widget_enable"));

if (mPrefsMap.getStringAsInt("personal_assistant_value", 0) == 2) {
if (mPrefsMap.getStringAsInt("personal_assistant_value", 0) == 2 && !isAndroidVersion(30)) {
initHook(BlurPersonalAssistant.INSTANCE, mPrefsMap.getBoolean("pa_enable"));
} else if (mPrefsMap.getStringAsInt("personal_assistant_value", 0) == 1) {
} else if (mPrefsMap.getStringAsInt("personal_assistant_value", 0) == 1 && !isAndroidVersion(30)) {
initHook(BlurPersonalAssistantBackGround.INSTANCE, mPrefsMap.getBoolean("pa_enable"));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sevtinge.hyperceiler.module.app;

import static com.sevtinge.hyperceiler.utils.api.VoyagerApisKt.isPad;
import static com.sevtinge.hyperceiler.utils.devicesdk.SystemSDKKt.isMoreAndroidVersion;

import com.sevtinge.hyperceiler.module.base.BaseModule;
import com.sevtinge.hyperceiler.module.hook.systemframework.AllowUntrustedTouch;
Expand All @@ -22,6 +23,7 @@
import com.sevtinge.hyperceiler.module.hook.systemframework.SpeedInstall;
import com.sevtinge.hyperceiler.module.hook.systemframework.StickyFloatingWindows;
import com.sevtinge.hyperceiler.module.hook.systemframework.ThermalBrightness;
import com.sevtinge.hyperceiler.module.hook.systemframework.UseOriginalAnimation;
import com.sevtinge.hyperceiler.module.hook.systemframework.VolumeDefaultStream;
import com.sevtinge.hyperceiler.module.hook.systemframework.VolumeDisableSafe;
import com.sevtinge.hyperceiler.module.hook.systemframework.VolumeFirstPress;
Expand Down Expand Up @@ -80,6 +82,7 @@ public void handleLoadPackage() {
initHook(new AllowUntrustedTouch(), mPrefsMap.getBoolean("system_framework_allow_untrusted_touch"));
initHook(new FlagSecure(), mPrefsMap.getBoolean("system_other_flag_secure"));
initHook(new AppLinkVerify(), mPrefsMap.getBoolean("system_framework_disable_app_link_verify"));
initHook(new UseOriginalAnimation(), mPrefsMap.getBoolean("system_framework_other_use_original_animation"));
initHook(new SpeedInstall(), mPrefsMap.getBoolean("system_framework_other_speed_install"));
initHook(DeleteOnPostNotification.INSTANCE, mPrefsMap.getBoolean("system_other_delete_on_post_notification"));
initHook(NoAccessDeviceLogsRequest.INSTANCE, mPrefsMap.getBoolean("various_disable_access_device_logs"));
Expand All @@ -102,8 +105,10 @@ public void handleLoadPackage() {
}

// 核心破解
initHook(BypassSignCheckForT.INSTANCE, mPrefsMap.getBoolean("system_framework_core_patch_auth_creak") ||
if (isMoreAndroidVersion(33)) {
initHook(BypassSignCheckForT.INSTANCE, mPrefsMap.getBoolean("system_framework_core_patch_auth_creak") ||
mPrefsMap.getBoolean("system_framework_core_patch_disable_integrity"));
}

// 网络
initHook(DualNRSupport.INSTANCE, mPrefsMap.getBoolean("phone_double_5g_nr"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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.hook.systemsettings.AddMiuiPlusEntry;
import com.sevtinge.hyperceiler.module.hook.systemsettings.AppsFreezerEnable;
Expand All @@ -11,6 +13,7 @@
import com.sevtinge.hyperceiler.module.hook.systemsettings.NoveltyHaptic;
import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManageOverlayPermission;
import com.sevtinge.hyperceiler.module.hook.systemsettings.QuickManageUnknownAppSources;
import com.sevtinge.hyperceiler.module.hook.systemsettings.UnLockAreaScreenshot;
import com.sevtinge.hyperceiler.module.hook.systemsettings.UnlockTaplusForSettings;
import com.sevtinge.hyperceiler.module.hook.systemsettings.ViewWifiPasswordHook;
import com.sevtinge.hyperceiler.module.hook.systemsettings.VoipAssistantController;
Expand All @@ -35,11 +38,15 @@ public void handleLoadPackage() {
initHook(new UnlockSuperResolution(), mPrefsMap.getBoolean("system_settings_ai_image_unlock_sr"));
initHook(new UnlockAi(), mPrefsMap.getBoolean("system_settings_ai_image_unlock_ai"));
initHook(new UnlockMemc(), mPrefsMap.getBoolean("system_settings_ai_image_unlock_memc"));
initHook(UnLockAreaScreenshot.INSTANCE, mPrefsMap.getBoolean("system_settings_area_screenshot"));
initHook(NoveltyHaptic.INSTANCE, mPrefsMap.getBoolean("system_settings_novelty_haptic"));

initHook(new EnablePadArea(),mPrefsMap.getBoolean("system_settings_enable_pad_area"));
initHook(new EnableFoldArea(),mPrefsMap.getBoolean("system_settings_enable_fold_area"));
initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));

if (!isAndroidVersion(30)) {
initHook(UnlockTaplusForSettings.INSTANCE, mPrefsMap.getBoolean("content_extension_unlock_taplus"));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sevtinge.hyperceiler.module.app;

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

import com.sevtinge.hyperceiler.module.base.BaseModule;
Expand Down Expand Up @@ -27,9 +28,11 @@
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.NotificationWeatherNew;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.NotificationWeatherOld;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QQSGrid;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QQSGridOld;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QSControlDetailBackgroundAlpha;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QSGrid;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QSGridLabels;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.QSGridOld;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.RedirectToNotificationChannelSetting;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.SunlightMode;
import com.sevtinge.hyperceiler.module.hook.systemui.controlcenter.SwitchCCAndNotification;
Expand Down Expand Up @@ -86,8 +89,6 @@ public class SystemUI extends BaseModule {

@Override
public void handleLoadPackage() {
initHook(new PluginHelper());

// 充电动画
initHook(new ChargeAnimationStyle(), mPrefsMap.getStringAsInt("system_ui_charge_animation_style", 0) > 0);
initHook(new OriginChargeAnimation(), mPrefsMap.getBoolean("system_ui_origin_charge_animation"));
Expand Down Expand Up @@ -200,7 +201,13 @@ public void handleLoadPackage() {
mPrefsMap.getInt("system_control_center_cc_columns", 4) > 4 ||
mPrefsMap.getBoolean("system_ui_control_center_rounded_rect") ||
mPrefsMap.getBoolean("system_control_center_qs_tile_label"));
initHook(new QSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable"));initHook(new QQSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable"));
if (isMoreAndroidVersion(33)) {
initHook(new QSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable"));
initHook(new QQSGrid(), mPrefsMap.getBoolean("system_control_center_old_enable"));
} else {
initHook(new QSGridOld(), mPrefsMap.getBoolean("system_control_center_old_enable_1"));
initHook(new QQSGridOld(), mPrefsMap.getBoolean("system_control_center_old_enable_1"));
}
initHook(new AutoCollapse(), mPrefsMap.getBoolean("system_ui_control_auto_close"));
initHook(RedirectToNotificationChannelSetting.INSTANCE, mPrefsMap.getBoolean("system_ui_control_center_redirect_notice"));
initHook(ControlCenterStyle.INSTANCE, mPrefsMap.getBoolean("system_control_center_unlock_old"));
Expand All @@ -225,10 +232,14 @@ public void handleLoadPackage() {
initHook(HideLockScreenHint.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_unlock_tip"));
initHook(HideLockScreenStatusBar.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_hide_status_bar"));

initHook(AddBlurEffectToLockScreen.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_blur_button"));
initHook(AddBlurEffectToNotificationView.INSTANCE, mPrefsMap.getBoolean("n_enable"));
initHook(BlurButton.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_blur_button"));
if (!isAndroidVersion(30)) {
initHook(AddBlurEffectToLockScreen.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_blur_button"));
initHook(AddBlurEffectToNotificationView.INSTANCE, mPrefsMap.getBoolean("n_enable"));
initHook(BlurButton.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_blur_button"));
}

initHook(DoubleTapToSleep.INSTANCE, mPrefsMap.getBoolean("system_ui_status_bar_double_tap_to_sleep"));

initHook(new PluginHelper());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import android.graphics.Shader
import android.graphics.drawable.Drawable
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.ShapeDrawable
import android.os.Build
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.annotation.RequiresApi
import androidx.core.view.ViewCompat.animate
import com.sevtinge.hyperceiler.module.base.BaseHook
import com.sevtinge.hyperceiler.utils.HookUtils
import com.sevtinge.hyperceiler.utils.getObjectField

import de.robv.android.xposed.XC_MethodHook
import de.robv.android.xposed.XposedBridge
import de.robv.android.xposed.XposedHelpers
Expand Down Expand Up @@ -58,6 +61,7 @@ object BlurWhenShowShortcutMenu : BaseHook() {
shortcutMenuLayerClass,
"showShortcutMenu",
object : XC_MethodHook() {
@RequiresApi(Build.VERSION_CODES.S)
override fun beforeHookedMethod(param: MethodHookParam) {
val dragObject = param.args[0]
val dragViewInfo = XposedHelpers.callMethod(dragObject, "getDragInfo")
Expand Down Expand Up @@ -171,6 +175,7 @@ object BlurWhenShowShortcutMenu : BaseHook() {
shortcutMenuLayerClass,
"hideShortcutMenu",
object : XC_MethodHook() {
@RequiresApi(Build.VERSION_CODES.S)
override fun beforeHookedMethod(param: MethodHookParam) {
if (isShortcutMenuLayerBlurred) {
val editStateChangeReason = param.args[0]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.sevtinge.hyperceiler.module.hook.home.other

import com.sevtinge.hyperceiler.module.base.BaseHook
import de.robv.android.xposed.XC_MethodReplacement
import de.robv.android.xposed.XposedHelpers

object FixAndroidRS : BaseHook() {
override fun init() {
val globalSearchUtilClass = "com.miui.home.launcher.GlobalSearchUtil"
XposedHelpers.findAndHookMethod(globalSearchUtilClass, lpparam.classLoader,
"isSupportPullDownSearch", object : XC_MethodReplacement() {
override fun replaceHookedMethod(param: MethodHookParam?): Any {
return false
}
})

}
}
Loading

0 comments on commit 95d53d9

Please sign in to comment.