OShin | O神「自动构建 CI Build」
1.54K subscribers
2 photos
1 video
772 files
681 links
OPPO/OneOlus 系统辅助应用

Channel/频道
@OPatchA
Chat/聊天
@OPatchB
Download Telegram
🚀 OShin New CI Build!

Refactor(hook): Optimize SystemUI Clock Hook and Improve Readability

This commit refactors the hook for with several improvements focused on code structure, performance, and readability.

Key Changes:

- Configuration Loading:
- Preference values are now read using initialization. This defers reading from until the value is first accessed, potentially improving startup performance if the clock hook is not immediately used.
- Hooking Logic:
- Replaced direct calls (, ) with for a more structured and type-safe approach to reflection.
- Consolidated hook logic:
- now checks upfront and returns early if disabled.
- Separated hook setup into and .
- Introduced to centralize property settings (padding, single line, gravity, font size, line spacing).
- High-frequency update logic is now in a dedicated method.
- Date/Time Formatting:
- Introduced a cache () to reuse formatter instances, reducing object creation overhead for common patterns.
- , , , , and methods now accept the object () as a parameter instead of relying on a class-level variable. This makes the functions more self-contained and predictable.
- Simplified :
- Uses for year format consistently.
- Corrected space handling for non-Chinese locales when is enabled.
- Returns an empty string if no date components are enabled, preventing unnecessary formatter creation.
- Simplified :
- Directly uses the parameter for formatting.
- Simplified and :
- Directly use the parameter.
- Use range expressions () for hour checks in .
- Readability and Structure:
- Divided the class into 配置读取区 (Configuration Reading Area) and 工具变量区 (Utility Variables Area) using comments.
- Renamed some variables for clarity (e.g., to , to ).
- More consistent use of for immutable properties.
- Removed unused variable.
- Renamed field to to avoid confusion with local variables.
- Minor Fixes:
- Ensured is made accessible before invoking in .
- Corrected the year format in for Chinese locales from to for consistency.

These changes aim to make the clock hook more robust, performant, and easier to maintain.
🔗 查看本次提交
🚀 OShin New CI Build!

Refactor(hook): Update YukiHookAPI usage and minor logic changes in

This commit updates the hook file to use the newer KavaRef API from YukiHookAPI and makes some minor adjustments to the hooking logic.

Key Changes:

- API Migration:
- Replaced direct calls to with for method hooking. This aligns with the recommended KavaRef API for reflection and method finding.
- Updated to in method finders.

- Hook Logic (Minor):
- The code related to modifying 's cloud control record () has been commented out. This was likely an experimental feature or a feature that is no longer needed.

These changes primarily focus on adopting the latest YukiHookAPI patterns for better maintainability and compatibility.
🔗 查看本次提交
🚀 OShin New CI Build!

feat(verify): Introduce developer verification dialog

This commit adds a verification dialog displayed on app launch if the current version hasn't been verified. The dialog aims to ensure users obtain the app from the official GitHub source.

Key Changes:

- (New Logic):
- Verification Modes:
- Molecule Mode: Users are presented with a 2D representation of a glucose molecule and must select all chiral carbon atoms.
- , , data classes define the structure.
- provides the glucose data.
- displays the molecule and handles click interactions on carbon atoms. Selected carbons are highlighted.
- defines the set of correct answers.
- Text Mode: Users must input the module's GitHub repository URL.
- is used for input.
- Verification checks if the input contains github.com/suqi8/OShin.
- Dialog Behavior:
- The dialog is shown if and the device language is Chinese.
- is used to switch between Molecule and Text verification modes with vertical slide and fade animations.
- A Switch Mode button allows users to toggle between the two verification methods.
- Upon successful verification in either mode:
- A Verification successful! toast is shown.
- The current is saved to under verifyVersion to prevent the dialog from showing again for this version.
- The dialog is dismissed.
- If verification fails, an appropriate error toast is shown.
- UI Elements:
- is used as the base for the verification dialog.
- and are used for actions and mode switching.
- is used in to draw atoms and bonds.
- Helper functions and assist in rendering the molecule.

- :
- The composable is now called within , triggering the verification flow when the main content is composed.

This feature is intended to guide users to the official distribution channel and acknowledge the developer's work.
🔗 查看本次提交
🚀 OShin New CI Build!

refactor(version): Update version name format

This commit updates the version naming scheme in .

The main version number has been incremented from to .
The fallback version name for non-Git environments has been simplified from to .

The version name format remains (e.g., ).
🔗 查看本次提交
🚀 OShin New CI Build!

feat(about): Add new referenced projects

This commit updates the Referenced Projects section in the About page.

New Projects Added:
- Oxygen-Customizer: by DHD2280 (GPL-3.0)
- Capsule: by Kyant0 (Apache-2.0)
🔗 查看本次提交
🚀 OShin New CI Build!

Refactor(UI): Update Miuix KMP dependency and replace SmoothRoundedCornerShape

This commit updates the Miuix KMP library to version and replaces all usages of with from the Miuix KMP library. Additionally, the Umeng Common SDK is updated to version .

Key Changes:

- Dependency Updates ():
- version changed from to .
- version changed from to .

- Shape Replacement:
- :
- replaced with for button and card shadows.
- :
- replaced with for the dropdown popup shape.
- :
- replaced with for the switch track clip shape.
- :
- Replaced with for card background and clipping.
- The in now uses with specifically for touch feedback compatibility.
- Updated press feedback logic in to use the new modifier from Miuix KMP utils, along with and . Removed manual pointer input handling for press and long-press, opting for .

- Minor Code Adjustments:
- : Added to the composable.
- :
- Reordered modifiers in : now comes before .
- Imports for and Miuix KMP utils related to old press feedback (, ) were removed, and new ones (, , , , ) were added.

These changes are primarily aimed at leveraging the updated Miuix KMP library components and improving UI consistency and touch feedback handling.
🔗 查看本次提交
🍌2
🚀 OShin New CI Build!

Refactor(HardwareIndicator): Major overhaul for stability, performance, and UI consistency

This commit introduces a significant refactor of the Hardware Indicator feature for SystemUI. The changes focus on improving resource management, performance, code structure, and the user interface for configuring the indicators.

Key Changes in (Hook Logic):

- Resource Management & Lifecycle:
- Hooks and of the view.
- Resources (TextViews, Runnables, Listeners) for each indicator are now managed in a data class and stored in a map, keyed by the instance.
- function added to explicitly release all resources (remove callbacks, unregister listeners/receivers) when the is detached, preventing memory leaks.
- Performance & Threading:
- Introduced a (single-threaded ) to perform file I/O (reading battery/CPU temperature) off the main thread.
- UI updates are posted back to the main thread using a .
- Preference values are read using initialization for .
- Code Structure & Readability:
- Renamed to .
- Consolidated logic for creating consumption and temperature indicators into and .
- Unified indicator update logic:
- now handles styling updates (font size, bold, alignment) by re-reading prefs.
- handles fetching data in the background and updating the text on the UI thread.
- centralizes the formatting of all hardware data.
- now returns a for better control over starting/stopping updates.
- now manages both the (for color/visibility sync) and a (for configuration changes like dark mode) for all active indicators associated with a .
- More robust error handling for file reading and receiver unregistration.
- Functionality & Bug Fixes:
- Indicators (power, temperature) are now correctly added and removed from the 's parent .
- The insertion position of indicators is calculated more reliably.
- Color and visibility of indicators now consistently sync with the main view.
- Initial color of indicators is set when created.
- Padding and margin adjustments for better visual spacing.
- Uses for method hooking, replacing direct calls.
- Configuration Keys Renamed (Internal):
- Many preference keys used for storing indicator settings have been renamed for clarity and consistency (e.g., to , to ).

Key Changes in (Settings UI):

- State Management:
- Uses with and to manage UI state, directly reflecting preference values.
- object is remembered to avoid repeated calls to .
- UI Structure & Options:
- The list of available content for display () now includes CPU and Battery Temperature, making it consistent for both power and temperature indicators.
- Hide Unit settings are now grouped under a common section for all unit types (Power, Current, Voltage, Battery Temp, CPU Temp).
- Preference keys in , , updated to match the renamed keys in the hook.
- Clarity and Consistency:
- Variable names updated for better readability (e.g., state variable to ).
- More consistent use of to show/hide sections based on whether an indicator is enabled.

Overall Impact:

This refactor makes the Hardware Indicator feature more robust, less prone to resource leaks, and improves its performance by moving I/O operations to a background thread. The settings UI is now more aligned with the underlying preference keys and provides a more consistent user experience.
🔗 查看本次提交
🚀 OShin New CI Build!

Refactor(SystemUI): Reorganize Hardware Indicator Settings and Add Global Options

This commit refactors the Hardware Indicator settings page for SystemUI () to improve structure and introduce global settings for data sources and unit display.

Key Changes:

- :
- Added new string resources for section titles:
- (外观与更新)
- (数据源设置)
- (单位隐藏)

- :
- Introduced Composable:
- A new reusable composable function has been created to encapsulate the common settings for both Power and Temperature indicators. This includes options for:
- Dual row display
- First and second line content
- Bold text
- Alignment
- Update interval
- Font size
- This refactoring significantly reduces code duplication for indicator-specific settings.
- State management for these settings (dual row, line content, alignment) is now handled within using and /, initialized from .
- Reorganized Settings Structure:
- The settings page is now divided into more logical sections:
- Power Indicator: Toggle and its specific settings (now using ).
- Temperature Indicator: Toggle and its specific settings (now using ).
- Global Data Source Settings:
- Moved Dual Cell and Absolute Value (for power) options to this global section.
- Moved Show CPU Temp Data and Change CPU Temp Source options to this global section.
- Global Unit Display Settings:
- Settings to hide units for Power, Current, Voltage, Battery Temperature, and CPU Temperature are now grouped under this global section.
- Removed Redundant State Variables:
- Local and variables for alignment, dual row, and line content specific to power and temperature indicators in the main composable were removed, as this is now handled by the composable.
- UI Flow:
- The blocks for power and temperature indicators now conditionally render the composable.
- New components are used to label the Data Source Settings and Unit Display Settings sections.

This reorganization makes the settings page more modular, easier to understand, and simplifies the management of individual indicator configurations.
🔗 查看本次提交
🚀 OShin New CI Build!

feat(hardware): Add CPU freq, CPU usage, RAM usage indicators

This commit enhances the hardware indicator feature by adding new data points: CPU frequency, CPU usage, and RAM usage. It also introduces settings to customize their display and data sources.

Key Changes:

- (Hook Logic):
- New Data Fetching:
- : Reads current CPU frequency for a specified core from .
- : Calculates RAM usage percentage based on and from .
- : Calculates CPU usage percentage by comparing total and idle CPU times from between updates. Stores last total and idle times in .
- : Refactored from existing logic to read CPU temperature from .
- Data Formatting & Display:
- updated to include formatted strings for CPU frequency (MHz), CPU usage (%), and RAM usage (%).
- now fetches and passes these new data points to .
- Preferences for hiding units of new indicators (, , ) are respected.
- Resource Passing:
- and now accept to access and for CPU usage calculation.

- (Settings UI):
- New Data Source Settings:
- Change CPU frequency data source ( for ): Allows users to specify which CPU core's frequency to display.
- Show CPU frequency data (): Opens a dialog displaying current frequencies for all available CPU cores.
- composable: Implements the dialog using and to list core names and their frequencies obtained via .
- : Reads frequency data from for all cores.
- data class added.
- New Unit Display Settings:
- Switches () added under Unit Display Settings to toggle visibility of units for:
- CPU Frequency ()
- CPU Usage ()
- RAM Usage ()
- UI Adjustments:
- Updated list to include titles for the new indicators.
- Minor padding adjustments for elements.

- :
- Added new string resources for:
- CPU Frequency, CPU Usage, RAM Usage labels.
- Settings titles and summaries for changing CPU frequency source and showing CPU frequency data.

This update provides users with more comprehensive hardware monitoring capabilities directly in the status bar.
🔗 查看本次提交
🚀 OShin New CI Build!

Refactor(HardwareIndicator): Correct dual-cell power calculation

This commit adjusts the power calculation logic in for devices with dual-cell batteries.

Previously, the voltage was multiplied by 2 for dual-cell configurations. This change moves the multiplication factor to the current calculation instead.

- Old Calculation:
-
-
- New Calculation:
-
-

The battery wattage is still calculated as . This change ensures the power calculation accurately reflects dual-cell battery architecture.
🔗 查看本次提交
🚀 OShin New CI Build!

Refactor(UI): Minor UI adjustments in About and Main screens

This commit introduces small UI changes:

- About Screen ():
- The Check Update button has been commented out, effectively removing it from the UI.

- Main Screen ():
- The bottom navigation bar () is now conditionally displayed using . It will be hidden when the of the is 3 (presumably the About or a similar settings-like page).
🔗 查看本次提交