Skip to content
Draft
29 changes: 29 additions & 0 deletions PERSONAL_INTERACTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# OneUIX 个人交互增强分支

本分支基于上游 `main` 的 `78e2ef1d10320aab293631f97ec636cf64d4cbea`,保留原有包名、作者信息和 AGPL-3.0 License。新增功能集中在一级分类“交互增强”,所有会改变系统交互的功能默认关闭。

## 实现边界

- 锁屏距离:在 `KeyguardTouchBase` 的唯一安全 `initDimens*` 初始化点完成后,仅缩放 `swipeUnlockRadius`,范围为 10%~100%,按 10% 分档。
- 锁屏导航条:在三星 `SecStatusBarKeyguardViewManager` 认定导航条不可见时,仅对“锁屏正在显示、未被遮挡、非 AOD、非熄屏动画”的状态强制显示导航栏窗口;同时在 `SamsungNavigationBarView` 中放开中间手势提示条的可见性,左右提示保持系统原逻辑。锁屏上滑时,小白条按实际解锁进度向上移动、横向拉伸并轻微增强不透明度;取消手势后用 220ms 动画回到底部。关闭后恢复三星默认行为。
- 最近任务按钮:在 One UI Home 创建 `CloseAllButton` 时将其隐藏,并持续阻止布局刷新重新显示。仅移除“全部关闭”入口,不影响逐个上滑关闭应用,不结束或锁定任何后台应用;关闭选项并重启 One UI Home 后恢复三星默认界面。
- 通知直达:只在通知行点击、Keyguard 仍显示、`canDismissLockScreen` 为真、系统已不再判定设备为锁定时,取消三星额外的 swipe bouncer;通知点击和 `PendingIntent` 仍走 SystemUI 原生流程。
- 主屏搜索:在 One UI 8.5 `HomeView` 上识别从下方 75% 空白区域开始的单指向下手势,复用 `SearchScreenController.startSearch(SEARCH_FROM_KEY, true)`,并聚焦 Finder 原生输入框、请求显示输入法;不启动或伪造 Finder Activity。
- 通知亮屏:模块自身的 `NotificationListenerService` 过滤自身通知、常驻通知、group summary 和已亮屏状态;SystemUI 负责点亮,并在 1~10 秒滑轨设定的时长到达且仍处于锁屏时主动熄屏,不保存通知正文。
- 滑轨触感:交互增强内的亮屏时长、主屏下拉阈值和锁屏上滑距离均在跨越离散档位时调用系统级触感反馈,并遵循系统触感开关。
- 滑轨指引:三个滑轨的顶部数值均跟随拖动位置实时更新,松手后再写入配置,避免拖动过程中看不到目标档位。
- 菜单精简:主界面固定保留“管理主界面菜单”入口,可逐项隐藏不常用分类或一键全部恢复;隐藏仅影响菜单显示,不关闭功能,状态随配置备份和恢复。
- 软重启:交互增强页面提供二次确认按钮,通过 Root 执行与 KernelSU 管理器“软重启”相同的 `/system/bin/setprop ctl.restart zygote`,重新启动 Android 应用运行环境;不重启内核、不清除数据,但会关闭 SystemUI、主屏幕及所有正在运行的应用。KernelSU 中范围更大的“用户空间重启”是另一项功能,本按钮不调用该功能。
- 应用自启:只列出带桌面入口的用户安装应用,可多选并设置总开关。普通 `BOOT_COMPLETED` 或本应用发起软重启前会登记持久 Job,系统恢复约 15 秒后通过 Root `am start` 逐个打开;不修改目标应用权限或系统后台策略。多个应用依次启动,最后一个留在前台;冷启动后 Root 尚未加载时记录失败且不循环请求。

任何类、字段或方法匹配失败都会保留三星原行为并写入 `OneUIX.Interaction` / LSPosed 日志。SystemUI 和 One UI Home 的 Hook 配置在对应进程启动时读取,修改后需重启对应进程。

## 首次真机测试顺序

1. 仅开启“自定义锁屏上滑距离”,设为 70%,重启 SystemUI;比较锁屏上滑行程。
2. 开启“认证后点击通知直接打开”,重启 SystemUI;依次验证未认证不能绕过、认证后点击直达、重启后首次 PIN 前不能绕过。
3. 开启“屏幕中部下拉打开搜索”,重启 One UI Home;验证顶部下拉仍打开通知栏、中部空白下拉进入原生搜索、横滑和图标拖动不误触。
4. 授权通知访问并开启自动亮屏;验证息屏普通消息亮屏、亮屏时不重复、常驻通知和 group summary 不触发、仍显示三星原生锁屏。
5. 四项同时开启,验证完整链路:通知到达 → 自动亮屏 → 生物认证 → 主动点击通知 → 对应应用。

测试期间不得关闭锁屏安全,不修改 PIN、密码、Strong Auth 或 `canDismissLockScreen` 判定。出现 SystemUI 或桌面异常时先在 LSPosed 停用本模块作用域并重启,所有新增功能关闭后均回到三星原行为。
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

## 释放三星 One UI 的无限可能 | Unleash the full potential of Samsung One UI

[![Stars](https://img.shields.io/github/stars/SoClear/OneUIX?style=for-the-badge&logo=github)](https://github.com/SoClear/OneUIX) [![Release](https://img.shields.io/github/v/release/SoClear/OneUIX?style=for-the-badge)](https://github.com/SoClear/OneUIX/releases/latest)
[![Stars](https://img.shields.io/github/stars/xrzcc/OneUIX?style=for-the-badge&logo=github)](https://github.com/xrzcc/OneUIX) [![Personal Release](https://img.shields.io/github/v/release/xrzcc/OneUIX?include_prereleases&style=for-the-badge&label=Personal%20Release)](https://github.com/xrzcc/OneUIX/releases/tag/v1.7.0-personal.2)

![LSPosed](https://img.shields.io/badge/Powered_by-LSPosed-blue?style=flat-square&logo=android)
[![License](https://img.shields.io/badge/License-AGPL%20v3-blue.svg?style=flat-square)](https://github.com/SoClear/OneUIX/blob/main/LICENSE.txt)
[![License](https://img.shields.io/badge/License-AGPL%20v3-blue.svg?style=flat-square)](https://github.com/xrzcc/OneUIX/blob/main/LICENSE.txt)
[![Min SDK](https://img.shields.io/badge/Min_SDK-33-brightgreen?style=flat-square&logo=android)](https://developer.android.com/about/versions)
[![Language](https://img.shields.io/github/languages/top/SoClear/OneUIX?style=flat-square&color=blueviolet&logo=kotlin)](https://github.com/SoClear/OneUIX)
[![GitHub Downloads](https://img.shields.io/github/downloads/SoClear/OneUIX/total?style=flat-square&color=blue&label=GitHub%20Downloads)](https://github.com/SoClear/OneUIX/releases)
[![Language](https://img.shields.io/github/languages/top/xrzcc/OneUIX?style=flat-square&color=blueviolet&logo=kotlin)](https://github.com/xrzcc/OneUIX)
[![GitHub Downloads](https://img.shields.io/github/downloads/xrzcc/OneUIX/total?style=flat-square&color=blue&label=Personal%20Downloads)](https://github.com/xrzcc/OneUIX/releases)
[![LSPosed Downloads](https://img.shields.io/github/downloads/Xposed-Modules-Repo/io.github.soclear.oneuix/total?style=flat-square&color=orange&label=LSPosed%20Downloads)](https://github.com/Xposed-Modules-Repo/io.github.soclear.oneuix/releases)

<img src="./icon.svg" width="150" alt="One UI X Logo">
Expand All @@ -21,12 +21,32 @@

---

> [!IMPORTANT]
> **个人增强分支 / Personal Enhanced Fork**
>
> 本仓库是基于 [SoClear/OneUIX](https://github.com/SoClear/OneUIX) 的个人增强版本,重点适配已 Root、已启用 LSPosed 的 Samsung One UI 8.5 / Android 16 设备。新增交互功能全部默认关闭,可按需启用;使用前请阅读对应功能说明并保留系统锁屏安全验证。
>
> This repository is a personal enhanced fork of [SoClear/OneUIX](https://github.com/SoClear/OneUIX), primarily tested on rooted Samsung devices running One UI 8.5 / Android 16 with LSPosed. Every added interaction feature is disabled by default and can be enabled individually without bypassing Android lock-screen authentication.
>
> **[下载当前个人版 APK / Download the current personal build](https://github.com/xrzcc/OneUIX/releases/tag/v1.7.0-personal.2)**

## 简体中文

**One UI X** 是一个专为三星设备设计的强大 LSPosed 模块。它旨在提供高度可定制的系统体验,解除烦人的限制,并为状态栏、快捷设置以及系统自带应用注入强大的增强功能。

### ✨ 功能

#### 交互增强(One UI 8.5 / Android 16)

- 在主屏幕中部空白区域向下滑动即可打开三星查找器,并自动聚焦搜索框和显示键盘;屏幕顶部的通知栏下拉手势保持不变
- 将锁屏上滑解锁行程设置为三星默认距离的 10%~100%,仅调整手势距离,不绕过人脸、指纹、图案、PIN 或密码验证
- 系统已经完成人脸、指纹等认证且允许解除锁定时,点击锁屏通知直接进入对应应用,无需再手动上滑
- 普通新通知到达时自动点亮屏幕,并请求三星原生人脸识别(仍受密码、锁定及摄像头隐私等系统规则约束);可设置 1~10 秒亮屏时长,常驻通知、分组摘要和屏幕已亮场景不会重复触发
- 交互增强滑轨实时显示当前数值,并在跨越档位时调用遵循系统设置的震动反馈
- 可隐藏主界面中不常使用的功能分类;隐藏只影响菜单显示,不会关闭功能或删除原有配置
- 提供与 KernelSU 管理器相同的 zygote 软重启操作,并在执行前显示确认提示
- 可选择带桌面入口的用户安装应用,在完整开机或软重启后通过 Root 依次打开;不会修改目标应用权限或系统后台策略

#### Android 系统

- 禁用每 72 小时验证锁屏密码
Expand Down Expand Up @@ -60,6 +80,7 @@
- 修改状态栏最大通知图标数量
- 自定义运营商名称
- 隐藏锁屏界面的状态栏
- 在亮屏锁屏界面显示当前系统导航条;手势导航的小白条会随上滑解锁进度上移、拉伸并在取消后回弹,不影响 AOD 或解锁后的导航逻辑

##### 快捷设置

Expand Down Expand Up @@ -124,6 +145,7 @@
- 应用分身支持所有用户应用
- 天气源设为中国天气
- 最近任务页面显示内存信息
- 隐藏最近任务页面的“全部关闭”按钮,保留逐个上滑关闭应用
- 视频播放器添加 3.0 和 4.0 倍速
- 强制链接跳转外部三星浏览器
- 显示相册的所有设置
Expand Down Expand Up @@ -171,6 +193,17 @@

### ✨ Features

#### Interaction Enhancements (One UI 8.5 / Android 16)

- Swipe down on an empty area in the middle of Home to open Samsung Finder with its search field focused and keyboard shown, while keeping the top-edge notification-shade gesture unchanged
- Set the lock-screen upward swipe distance to 10%–100% of Samsung's default without bypassing Face, fingerprint, pattern, PIN, or password authentication
- Open a lock-screen notification directly after Face, fingerprint, or another system authentication has already made the lock screen dismissible, without requiring an additional swipe
- Wake the screen for eligible new notifications with a configurable 1–10 second duration, excluding ongoing notifications, group summaries, and already-screen-on cases
- Show live values above interaction sliders and provide system-respecting haptic feedback when crossing discrete steps
- Hide rarely used categories from the main menu without disabling their features or deleting saved settings
- Provide a confirmed zygote soft restart using the same operation as KernelSU Manager
- Select launchable user-installed apps to open sequentially through root after a full boot or soft restart without changing their permissions or Android background policies

#### Android System

- Disable PIN verification every 72 hours
Expand Down Expand Up @@ -204,6 +237,7 @@
- Modify maximum number of notification icons in status bar
- Set custom carrier name
- Hide status bar on lock screen
- Show the system navigation bar on the active lock screen; in gesture mode, the handle follows upward swipe progress, stretches slightly, and springs back when the gesture is cancelled without affecting AOD or unlocked navigation

##### Quick Settings

Expand Down Expand Up @@ -268,6 +302,7 @@
- Make all user apps available for app cloning
- Set weather provider to China Weather
- Show memory usage in Recents page
- Hide the “Close all” button in Recents while keeping per-app swipe dismissal available
- Add 3.0x and 4.0x playback speeds to video player
- Force links to open in external Samsung Internet
- Show all Gallery settings
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
applicationId = "io.github.soclear.oneuix"
minSdk = 33
targetSdk = 37
versionCode = 9
versionName = "1.7.0"
versionCode = 15
versionName = "1.7.0-personal.6-test"

ndk {
// ABI过滤,只加载 arm 架构 64 位动态链接库
Expand Down
27 changes: 27 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,14 @@
<uses-permission
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<queries>
<intent>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent>
<package android:name="com.android.settings" />
<package android:name="com.android.systemui" />
<package android:name="com.samsung.android.app.notes" />
Expand Down Expand Up @@ -74,6 +80,27 @@
<meta-data
android:name="xposedscope"
android:resource="@array/xposed_scope" />
<service
android:name=".service.NotificationWakeService"
android:exported="false"
android:label="@string/notification_wake_service"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
<receiver
android:name=".service.BootAutoStartReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service
android:name=".service.AutoStartJobService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".FiveGTileService"
android:exported="true"
Expand Down
19 changes: 19 additions & 0 deletions app/src/main/java/io/github/soclear/oneuix/data/Preference.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,30 @@ import kotlinx.serialization.json.Json

@Serializable
data class Preference(
val hiddenMainMenuCategories: Set<String> = emptySet(),
val interaction: Interaction = Interaction(),
val android: Android = Android(),
val systemUI: SystemUI = SystemUI(),
val settings: Settings = Settings(),
val call: Call = Call(),
val camera: Camera = Camera(),
val other: Other = Other(),
) {
@Serializable
data class Interaction(
val wakeOnNotification: Boolean = false,
val wakeDurationSeconds: Int = 8,
val wakeOnlyWhenScreenOff: Boolean = true,
val notificationDirectOpenAfterAuth: Boolean = false,
val homeSwipeDownSearch: Boolean = false,
val keepOriginalSwipeUpSearch: Boolean = true,
val homeSwipeDownThresholdDp: Float = 96f,
val customizeLockscreenSwipeDistance: Boolean = false,
val lockscreenSwipeDistanceScale: Float = 1.0f,
val autoStartEnabled: Boolean = false,
val autoStartPackages: Set<String> = emptySet(),
)

@Serializable
data class Android(
val disablePinVerifyPer72h: Boolean = false,
Expand Down Expand Up @@ -94,6 +111,7 @@ data class Preference(

@Serializable
data class Other(
val showNavigationBarOnLockscreen: Boolean = false,
val disableScreenshotCaptureSound: Boolean = false,
val customPowerMenu: Boolean = false,
val powerMenuActions: List<PowerMenuAction> =
Expand Down Expand Up @@ -138,6 +156,7 @@ data class Preference(
val makeAllUserAppsAvailable: Boolean = true,
val setWeatherProviderCN: Boolean = false,
val showMemoryUsageInRecents: Boolean = false,
val hideRecentsCloseAllButton: Boolean = false,
val showMorePlaybackSpeeds: Boolean = false,
val redirectCustomTab: Boolean = false,
val supportAllGallerySettings: Boolean = true,
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/io/github/soclear/oneuix/hook/Launcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,32 @@ import kotlin.math.roundToInt


object Launcher {
fun hideRecentsCloseAllButton(loadPackageParam: LoadPackageParam) {
if (loadPackageParam.packageName != Package.LAUNCHER) return

try {
findAndHookConstructor(
"com.honeyspace.ui.honeypots.tasklist.presentation.CloseAllButton",
loadPackageParam.classLoader,
Context::class.java,
AttributeSet::class.java,
object : XC_MethodHook() {
override fun afterHookedMethod(param: MethodHookParam) {
val button = param.thisObject as View
button.visibility = View.GONE
button.addOnLayoutChangeListener { view, _, _, _, _, _, _, _, _ ->
if (view.visibility != View.GONE) view.visibility = View.GONE
}
}
}
)
XposedBridge.log("OneUIX [Launcher] Recents close-all button hidden")
} catch (t: Throwable) {
XposedBridge.log("OneUIX [Launcher] Failed to hide Recents close-all button")
XposedBridge.log(t)
}
}

fun showMemoryUsageInRecents(loadPackageParam: LoadPackageParam) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA) {
showMemoryUsageInRecentsTargetSdk36(loadPackageParam)
Expand Down
Loading