1 Commits

Author SHA1 Message Date
9465286ce1 Bump version to 2.110 2023-11-03 13:23:46 +08:00
55 changed files with 394 additions and 806 deletions

View File

@@ -10,22 +10,6 @@ ktlint_standard_argument-list-wrapping = disabled
ktlint_standard_parameter-list-wrapping = disabled ktlint_standard_parameter-list-wrapping = disabled
ktlint_standard_trailing-comma-on-declaration-site = disabled ktlint_standard_trailing-comma-on-declaration-site = disabled
ktlint_function_signature_body_expression_wrapping = multiline ktlint_function_signature_body_expression_wrapping = multiline
ktlint_standard_string-template-indent = disabled
ktlint_standard_function-signature = disabled
ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_no-empty-first-line-in-class-body = disabled
ktlint_standard_if-else-wrapping = disabled
ktlint_standard_if-else-bracing = disabled
ktlint_standard_statement-wrapping = disabled
ktlint_standard_blank-line-before-declaration = disabled
ktlint_standard_no-empty-file = disabled
ktlint_standard_property-naming = disabled
ktlint_standard_function-naming = disabled
ktlint_standard_chain-method-continuation = disabled
ktlint_standard_class-signature = disabled
ktlint_standard_condition-wrapping = disabled
ktlint_standard_class-signature = disabled
ij_continuation_indent_size = 2 ij_continuation_indent_size = 2
indent_size = 4 indent_size = 4
indent_style = space indent_style = space

View File

@@ -41,7 +41,6 @@ body:
attributes: attributes:
label: Android 版本 label: Android 版本
options: options:
- 15
- 14 - 14
- 13 - 13
- 12L/12.1 - 12L/12.1

View File

@@ -27,7 +27,7 @@ jobs:
See commit detail [here](${{ github.event.head_commit.url }}) See commit detail [here](${{ github.event.head_commit.url }})
COMMIT_URL: ${{ github.event.head_commit.url }} COMMIT_URL: ${{ github.event.head_commit.url }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Prepare GitHub Env - name: Prepare GitHub Env
run: | run: |
GITHUB_SHA=${{ github.sha }} GITHUB_SHA=${{ github.sha }}
@@ -37,10 +37,10 @@ jobs:
uses: jwlawson/actions-setup-cmake@v1 uses: jwlawson/actions-setup-cmake@v1
with: with:
cmake-version: '3.22.1' cmake-version: '3.22.1'
- name: Prepare Java 21 - name: Prepare Java 17
uses: actions/setup-java@v4 uses: actions/setup-java@v3
with: with:
java-version: 21 java-version: 17
java-package: jdk java-package: jdk
distribution: 'temurin' distribution: 'temurin'
cache: 'gradle' cache: 'gradle'
@@ -69,12 +69,12 @@ jobs:
echo "DEBUG_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV echo "DEBUG_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV
echo "RELEASE_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV echo "RELEASE_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV
- name: Upload Artifacts (Debug) - name: Upload Artifacts (Debug)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
path: ${{ env.DEBUG_APK_PATH }} path: ${{ env.DEBUG_APK_PATH }}
name: MIUINativeNotifyIcon-debug-${{ github.event.head_commit.id }} name: MIUINativeNotifyIcon-debug-${{ github.event.head_commit.id }}
- name: Upload Artifacts (Release) - name: Upload Artifacts (Release)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
path: ${{ env.RELEASE_APK_PATH }} path: ${{ env.RELEASE_APK_PATH }}
name: MIUINativeNotifyIcon-release-${{ github.event.head_commit.id }} name: MIUINativeNotifyIcon-release-${{ github.event.head_commit.id }}

View File

@@ -17,7 +17,7 @@ jobs:
env: env:
APK_OUTPUT_PATH: 'app/build/outputs/apk' APK_OUTPUT_PATH: 'app/build/outputs/apk'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Prepare GitHub Env - name: Prepare GitHub Env
run: | run: |
GITHUB_SHA=${{ github.sha }} GITHUB_SHA=${{ github.sha }}
@@ -27,10 +27,10 @@ jobs:
uses: jwlawson/actions-setup-cmake@v1 uses: jwlawson/actions-setup-cmake@v1
with: with:
cmake-version: '3.22.1' cmake-version: '3.22.1'
- name: Prepare Java 21 - name: Prepare Java 17
uses: actions/setup-java@v4 uses: actions/setup-java@v3
with: with:
java-version: 21 java-version: 17
java-package: jdk java-package: jdk
distribution: 'temurin' distribution: 'temurin'
cache: 'gradle' cache: 'gradle'
@@ -59,12 +59,12 @@ jobs:
echo "DEBUG_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV echo "DEBUG_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/debug -name '*.apk')" >> $GITHUB_ENV
echo "RELEASE_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV echo "RELEASE_APK_PATH=$(find ${{ env.APK_OUTPUT_PATH }}/release -name '*.apk')" >> $GITHUB_ENV
- name: Upload Artifacts (Debug) - name: Upload Artifacts (Debug)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
path: ${{ env.DEBUG_APK_PATH }} path: ${{ env.DEBUG_APK_PATH }}
name: MIUINativeNotifyIcon-debug-${{ github.event.head_commit.id }} name: MIUINativeNotifyIcon-debug-${{ github.event.head_commit.id }}
- name: Upload Artifacts (Release) - name: Upload Artifacts (Release)
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
path: ${{ env.RELEASE_APK_PATH }} path: ${{ env.RELEASE_APK_PATH }}
name: MIUINativeNotifyIcon-release-${{ github.event.head_commit.id }} name: MIUINativeNotifyIcon-release-${{ github.event.head_commit.id }}

117
.gitignore vendored
View File

@@ -1,110 +1,15 @@
## Fully .gtignore for IntelliJ, Android Studio and Gradle based Java projects
## References:
## - https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
## - https://github.com/android/platform-samples/blob/main/.gitignore
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
.idea/.name
.idea/artifacts
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
.idea/caches
.idea/material_theme**
.idea/other.xml
*.iml *.iml
*.ipr .gradle
/local.properties
# Kotlin /.idea/caches
.kotlin /.idea/libraries
/.idea/modules.xml
# Misc /.idea/workspace.xml
.idea/misc.xml /.idea/navEditor.xml
/.idea/assetWizardSettings.xml
# CMake .DS_Store
cmake-build-*/ /build
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# SonarLint plugin
.idea/sonarlint/
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# Android studio 3.1+ additional
.idea/deployment*.xml
.idea/assetWizardSettings.xml
.idea/androidTestResultsUserPreferences.xml
# Android projects
**/local.properties
/captures /captures
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties
# Gradle projects
.gradle
build/
# Mkdocs temporary serving folder
docs-gen
site
*.bak
.idea/appInsightsSettings.xml
# Mac OS
.DS_Store

5
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,5 @@
# Default ignored files
/shelf/
/workspace.xml
/gradle.xml
/misc.xml

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AndroidProjectSystem">
<option name="providerId" value="com.android.tools.idea.GradleProjectSystem" />
</component>
</project>

26
.idea/appInsightsSettings.xml generated Normal file
View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AppInsightsSettings">
<option name="tabSettings">
<map>
<entry key="Firebase Crashlytics">
<value>
<InsightsFilterSettings>
<option name="connection">
<ConnectionSetting>
<option name="appId" value="PLACEHOLDER" />
<option name="mobileSdkAppId" value="" />
<option name="projectId" value="" />
<option name="projectNumber" value="" />
</ConnectionSetting>
</option>
<option name="signal" value="SIGNAL_UNSPECIFIED" />
<option name="timeIntervalDays" value="THIRTY_DAYS" />
<option name="visibilityType" value="ALL" />
</InsightsFilterSettings>
</value>
</entry>
</map>
</option>
</component>
</project>

6
.idea/compiler.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="17" />
</component>
</project>

10
.idea/deploymentTargetDropDown.xml generated Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
</component>
</project>

View File

@@ -1,7 +1,6 @@
<component name="InspectionProjectProfileManager"> <component name="InspectionProjectProfileManager">
<profile version="1.0"> <profile version="1.0">
<option name="myName" value="Project Default" /> <option name="myName" value="Project Default" />
<inspection_tool class="CheckImageSize" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false"> <inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" /> <option name="processCode" value="true" />
<option name="processLiterals" value="true" /> <option name="processLiterals" value="true" />

40
.idea/jarRepositories.xml generated Normal file
View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven3" />
<option name="name" value="maven3" />
<option name="url" value="https://www.jitpack.io" />
</remote-repository>
<remote-repository>
<option name="id" value="maven" />
<option name="name" value="maven" />
<option name="url" value="https://maven.aliyun.com/nexus/content/groups/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="https://maven.aliyun.com/nexus/content/repositories/jcenter" />
</remote-repository>
<remote-repository>
<option name="id" value="Google" />
<option name="name" value="Google" />
<option name="url" value="https://dl.google.com/dl/android/maven2/" />
</remote-repository>
</component>
</project>

2
.idea/kotlinc.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="KotlinJpsPluginSettings"> <component name="KotlinJpsPluginSettings">
<option name="version" value="2.1.10" /> <option name="version" value="1.9.10" />
</component> </component>
</project> </project>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="KtLint plugin">
<ktlintMode>MANUAL</ktlintMode>
<formatOnSave>false</formatOnSave>
</component>
<component name="com.nbadal.ktlint.KtlintProjectSettings">
<ktlintMode>MANUAL</ktlintMode>
</component>
</project>

View File

@@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.intellij.execution.junit.AbstractAllInDirectoryConfigurationProducer" />
<option value="com.intellij.execution.junit.AllInPackageConfigurationProducer" />
<option value="com.intellij.execution.junit.PatternConfigurationProducer" />
<option value="com.intellij.execution.junit.TestInClassConfigurationProducer" />
<option value="com.intellij.execution.junit.UniqueIdConfigurationProducer" />
<option value="com.intellij.execution.junit.testDiscovery.JUnitTestDiscoveryConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinJUnitRunConfigurationProducer" />
<option value="org.jetbrains.kotlin.idea.junit.KotlinPatternConfigurationProducer" />
</set>
</option>
</component>
</project>

View File

@@ -1,17 +1,17 @@
# MIUI 原生通知图标 # MIUI 原生通知图标
[![GitHub license](https://img.shields.io/github/license/fankes/MIUINativeNotifyIcon?color=blue&style=flat-square)](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/LICENSE) [![GitHub license](https://img.shields.io/github/license/fankes/MIUINativeNotifyIcon?color=blue)](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/LICENSE)
[![GitHub CI](https://img.shields.io/github/actions/workflow/status/fankes/MIUINativeNotifyIcon/commit_ci.yml?label=CI%20builds&style=flat-square)](https://github.com/fankes/MIUINativeNotifyIcon/actions/workflows/commit_ci.yml) [![GitHub CI](https://img.shields.io/github/actions/workflow/status/fankes/MIUINativeNotifyIcon/commit_ci.yml?label=CI%20builds)](https://github.com/fankes/MIUINativeNotifyIcon/actions/workflows/commit_ci.yml)
[![GitHub release](https://img.shields.io/github/v/release/fankes/MIUINativeNotifyIcon?display_name=release&logo=github&color=green&style=flat-square)](https://github.com/fankes/MIUINativeNotifyIcon/releases) [![GitHub release](https://img.shields.io/github/v/release/fankes/MIUINativeNotifyIcon?display_name=release&logo=github&color=green)](https://github.com/fankes/MIUINativeNotifyIcon/releases)
![GitHub all releases](https://img.shields.io/github/downloads/fankes/MIUINativeNotifyIcon/total?label=downloads&style=flat-square) ![GitHub all releases](https://img.shields.io/github/downloads/fankes/MIUINativeNotifyIcon/total?label=downloads)
![GitHub all releases](https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.fankes.miui.notify/total?label=LSPosed%20downloads&labelColor=F48FB1&style=flat-square) ![GitHub all releases](https://img.shields.io/github/downloads/Xposed-Modules-Repo/com.fankes.miui.notify/total?label=LSPosed%20downloads&labelColor=F48FB1)
[![Telegram CI](https://img.shields.io/badge/CI%20builds-Telegram-blue.svg?logo=telegram&style=flat-square)](https://t.me/MIUINativeNotifyIcon_CI) [![Telegram CI](https://img.shields.io/badge/CI%20builds-Telegram-blue.svg?logo=telegram)](https://t.me/MIUINativeNotifyIcon_CI)
[![Telegram](https://img.shields.io/badge/discussion-Telegram-blue.svg?logo=telegram&style=flat-square)](https://t.me/XiaofangInternet) [![Telegram](https://img.shields.io/badge/discussion-Telegram-blue.svg?logo=telegram)](https://t.me/XiaofangInternet)
[![QQ](https://img.shields.io/badge/discussion-QQ-blue.svg?logo=tencent-qq&logoColor=red&style=flat-square)](https://qm.qq.com/cgi-bin/qm/qr?k=dp2h5YhWiga9WWb_Oh7kSHmx01X8I8ii&jump_from=webapi&authKey=Za5CaFP0lk7+Zgsk2KpoBD7sSaYbeXbsDgFjiWelOeH4VSionpxFJ7V0qQBSqvFM) [![QQ](https://img.shields.io/badge/discussion-QQ-blue.svg?logo=tencent-qq&logoColor=red)](https://qm.qq.com/cgi-bin/qm/qr?k=dp2h5YhWiga9WWb_Oh7kSHmx01X8I8ii&jump_from=webapi&authKey=Za5CaFP0lk7+Zgsk2KpoBD7sSaYbeXbsDgFjiWelOeH4VSionpxFJ7V0qQBSqvFM)
[![QQ 频道](https://img.shields.io/badge/discussion-QQ%20频道-blue.svg?logo=tencent-qq&logoColor=red&style=flat-square)](https://pd.qq.com/s/44gcy28h) [![QQ 频道](https://img.shields.io/badge/discussion-QQ%20频道-blue.svg?logo=tencent-qq&logoColor=red)](https://pd.qq.com/s/44gcy28h)
<img src="img-src/icon.png" width = "100" height = "100" alt="LOGO"/> <img src="https://github.com/fankes/MIUINativeNotifyIcon/blob/master/img-src/icon.png?raw=true" width = "100" height = "100" alt="LOGO"/>
Fix the native notification bar icon function abandoned by the MIUI development team. Fix the native notification bar icon function abandoned by the MIUI development team.
@@ -43,7 +43,7 @@ This project will not be adapted i18n, please stay tuned for my new projects in
点击下方的链接查看此模块的历史背景与探索历程。 点击下方的链接查看此模块的历史背景与探索历程。
- [EXPLORE_HISTORY](EXPLORE_HISTORY.md) - [EXPLORE_HISTORY](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/EXPLORE_HISTORY.md)
## 贡献通知图标优化名单 ## 贡献通知图标优化名单
@@ -68,31 +68,28 @@ This project will not be adapted i18n, please stay tuned for my new projects in
| <img src="https://github.com/fankes/fankes/assets/37344460/82113d3c-aa7b-4dd1-95c7-cda650065c12" width = "30" height = "30" alt="LOGO"/> | [123 云盘 **(密码62ll)**](https://www.123pan.com/s/5SlUVv-W8DBh.html) | 正式版 (稳定版) | | <img src="https://github.com/fankes/fankes/assets/37344460/82113d3c-aa7b-4dd1-95c7-cda650065c12" width = "30" height = "30" alt="LOGO"/> | [123 云盘 **(密码62ll)**](https://www.123pan.com/s/5SlUVv-W8DBh.html) | 正式版 (稳定版) |
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|-----------| |------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------|-----------|
| <img src="https://github.com/fankes/fankes/assets/37344460/3cd43efd-785e-411d-a5c3-a8c9dc02308a" width = "30" height = "30" alt="LOGO"/> | [酷安应用市场](https://www.coolapk.com/apk/com.fankes.miui.notify) | 正式版 (稳定版) |
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|-----------|
本模块发布地址仅限于上述所列出的地址,从其他非正规渠道下载到的版本或对您造成任何影响均与我们无关。 本模块发布地址仅限于上述所列出的地址,从其他非正规渠道下载到的版本或对您造成任何影响均与我们无关。
## 注意事项 ## 请勿用于非法用途
<h3>1.&nbsp;本软件免费、由兴趣驱动开发,仅供学习交流使用。如果你是从其他非官方渠道付费获得本软件,可能已遭遇欺诈,欢迎向我们举报可疑行为。</h3> - 本模块完全开源免费,如果好用你可以打赏支持开发,但是请不要用于非法用途。
<h3>2.&nbsp;本软件采用 <strong>GNU Affero General Public License (AGPL 3.0)</strong> 许可证。根据该许可证的要求:</h3>
- 任何衍生作品必须采用相同的 AGPL 许可证
- 分发本软件或其修改版本时,必须提供完整的源代码
- 必须保留原始的版权声明及许可证信息
- 不得额外施加限制来限制他人对本软件的自由使用
<h3>3.&nbsp;我们鼓励在遵守 AGPL 3.0 条款的前提下进行自由传播和改进,但请尊重作者署名权,勿冒用原作者名义。</h3>
## 项目推广 ## 项目推广
<!--suppress HtmlDeprecatedAttribute --> 如果你正在寻找一个可以自动管理 Gradle 项目依赖的 Gradle 插件,你可以了解一下 [SweetDependency](https://github.com/HighCapable/SweetDependency) 项目。
<div align="center">
<h2>嘿,还请君留步!👋</h2> 如果你正在寻找一个可以自动生成属性键值的 Gradle 插件,你可以了解一下 [SweetProperty](https://github.com/HighCapable/SweetProperty) 项目。
<h3>这里有 Android 开发工具、UI 设计、Gradle 插件、Xposed 模块和实用软件等相关项目。</h3>
<h3>如果下方的项目能为你提供帮助,不妨为我点个 star 吧!</h3> 本项目同样使用了 **SweetDependency****SweetProperty**
<h3>所有项目免费、开源,遵循对应开源许可协议。</h3>
<h1><a href="https://github.com/fankes/fankes/blob/main/project-promote/README-zh-CN.md">→ 查看更多关于我的项目,请点击这里 ←</a></h1> ## 捐赠支持
</div>
工作不易,无意外情况此项目将继续维护下去,提供更多可能,欢迎打赏。
<img src="https://github.com/fankes/fankes/blob/main/img-src/payment_code.jpg?raw=true" width = "500" alt="Payment Code"/>
## Star History ## Star History
@@ -100,14 +97,14 @@ This project will not be adapted i18n, please stay tuned for my new projects in
## 隐私政策 ## 隐私政策
- [PRIVACY](PRIVACY.md) - [PRIVACY](https://github.com/fankes/MIUINativeNotifyIcon/blob/master/PRIVACY.md)
## 许可证 ## 许可证
- [AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html) - [AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html)
``` ```
Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as it under the terms of the GNU Affero General Public License as
@@ -125,4 +122,4 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
Powered by [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI) Powered by [YukiHookAPI](https://github.com/HighCapable/YukiHookAPI)
版权所有 © 2017 Fankes Studio(qzmmcn@163.com) 版权所有 © 2017-2023 Fankes Studio(qzmmcn@163.com)

1
app/.gitignore vendored
View File

@@ -1,2 +1,3 @@
/build
/src/main/assets/xposed_init /src/main/assets/xposed_init
/src/main/resources/META-INF/yukihookapi_init /src/main/resources/META-INF/yukihookapi_init

View File

@@ -38,6 +38,14 @@ android {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17
} }
kotlinOptions {
jvmTarget = "17"
freeCompilerArgs = listOf(
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}
buildFeatures { buildFeatures {
buildConfig = true buildConfig = true
viewBinding = true viewBinding = true
@@ -50,18 +58,7 @@ androidComponents {
onVariants(selector().all()) { onVariants(selector().all()) {
it.outputs.forEach { output -> it.outputs.forEach { output ->
val currentType = it.buildType val currentType = it.buildType
val currentSuffix = property.github.ci.commit.id.let { suffix -> if (suffix.isNotBlank()) "-$suffix" else "" }
// Workaround for GitHub Actions.
// Why? I don't know, but it works.
// Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
// public inline fun CharSequence.isNotBlank(): Boolean defined in kotlin.text.
@Suppress("UNNECESSARY_SAFE_CALL", "RemoveRedundantCallsOfConversionMethods")
val currentSuffix = property.github.ci.commit.id?.let { suffix ->
// Workaround for GitHub Actions.
// Strongly transfer type to [String].
val sSuffix = suffix.toString()
if (sSuffix.isNotBlank()) "-$sSuffix" else ""
}
val currentVersion = "${output.versionName.get()}$currentSuffix(${output.versionCode.get()})" val currentVersion = "${output.versionName.get()}$currentSuffix(${output.versionCode.get()})"
if (output is com.android.build.api.variant.impl.VariantOutputImpl) if (output is com.android.build.api.variant.impl.VariantOutputImpl)
output.outputFileName.set("${property.project.name}-v$currentVersion-$currentType.apk") output.outputFileName.set("${property.project.name}-v$currentVersion-$currentType.apk")
@@ -73,8 +70,6 @@ dependencies {
compileOnly(de.robv.android.xposed.api) compileOnly(de.robv.android.xposed.api)
implementation(com.highcapable.yukihookapi.api) implementation(com.highcapable.yukihookapi.api)
ksp(com.highcapable.yukihookapi.ksp.xposed) ksp(com.highcapable.yukihookapi.ksp.xposed)
implementation(com.highcapable.kavaref.kavaref.core)
implementation(com.highcapable.kavaref.kavaref.extension)
implementation(com.fankes.projectpromote.project.promote) implementation(com.fankes.projectpromote.project.promote)
implementation(com.github.topjohnwu.libsu.core) implementation(com.github.topjohnwu.libsu.core)
implementation(com.github.duanhong169.drawabletoolbox) implementation(com.github.duanhong169.drawabletoolbox)

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -72,9 +72,6 @@ object ConfigData {
/** 启用通知图标优化 */ /** 启用通知图标优化 */
val ENABLE_NOTIFY_ICON_FIX = PrefsData("_notify_icon_fix", true) val ENABLE_NOTIFY_ICON_FIX = PrefsData("_notify_icon_fix", true)
/** 强制启用焦点通知反色 */
val ENABLE_FOCUS_NOTIFICATION_FIX = PrefsData("_enable_focus_notification_fix", false)
/** 使用占位符修补未适配的通知图标 */ /** 使用占位符修补未适配的通知图标 */
val ENABLE_NOTIFY_ICON_FIX_PLACEHOLDER = PrefsData("_notify_icon_fix_placeholder", false) val ENABLE_NOTIFY_ICON_FIX_PLACEHOLDER = PrefsData("_notify_icon_fix_placeholder", false)
@@ -306,16 +303,6 @@ object ConfigData {
putBoolean(ENABLE_NOTIFY_ICON_FIX, value) putBoolean(ENABLE_NOTIFY_ICON_FIX, value)
} }
/**
* 是否强制启用焦点通知反色
* @return [Boolean]*/
var isEnableFocusNotificationFix
get() = getBoolean(ENABLE_FOCUS_NOTIFICATION_FIX)
set(value) {
putBoolean(ENABLE_FOCUS_NOTIFICATION_FIX, value)
}
/** /**
* 是否使用占位符修补未适配的通知图标 * 是否使用占位符修补未适配的通知图标
* @return [Boolean] * @return [Boolean]

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -32,6 +32,7 @@ import android.content.Intent
import android.content.IntentFilter import android.content.IntentFilter
import android.graphics.Color import android.graphics.Color
import android.graphics.Outline import android.graphics.Outline
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.graphics.drawable.Icon import android.graphics.drawable.Icon
import android.os.Build import android.os.Build
@@ -41,12 +42,9 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.ViewOutlineProvider import android.view.ViewOutlineProvider
import android.widget.ImageView import android.widget.ImageView
import android.widget.RemoteViews
import androidx.core.graphics.drawable.toBitmap import androidx.core.graphics.drawable.toBitmap
import androidx.core.graphics.drawable.toDrawable import androidx.core.graphics.drawable.toDrawable
import androidx.core.graphics.scale
import androidx.core.view.children import androidx.core.view.children
import androidx.core.view.isNotEmpty
import androidx.core.view.isVisible import androidx.core.view.isVisible
import androidx.core.view.setPadding import androidx.core.view.setPadding
import com.fankes.miui.notify.R import com.fankes.miui.notify.R
@@ -77,20 +75,22 @@ import com.fankes.miui.notify.utils.tool.ActivationPromptTool
import com.fankes.miui.notify.utils.tool.BitmapCompatTool import com.fankes.miui.notify.utils.tool.BitmapCompatTool
import com.fankes.miui.notify.utils.tool.IconAdaptationTool import com.fankes.miui.notify.utils.tool.IconAdaptationTool
import com.fankes.miui.notify.utils.tool.SystemUITool import com.fankes.miui.notify.utils.tool.SystemUITool
import com.highcapable.kavaref.KavaRef.Companion.asResolver import com.highcapable.yukihookapi.hook.bean.VariousClass
import com.highcapable.kavaref.KavaRef.Companion.resolve
import com.highcapable.kavaref.condition.MethodCondition
import com.highcapable.kavaref.extension.VariousClass
import com.highcapable.kavaref.extension.classOf
import com.highcapable.kavaref.extension.isSubclassOf
import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker
import com.highcapable.yukihookapi.hook.factory.constructor
import com.highcapable.yukihookapi.hook.factory.current
import com.highcapable.yukihookapi.hook.factory.extends
import com.highcapable.yukihookapi.hook.factory.field
import com.highcapable.yukihookapi.hook.factory.hasMethod
import com.highcapable.yukihookapi.hook.factory.injectModuleAppResources import com.highcapable.yukihookapi.hook.factory.injectModuleAppResources
import com.highcapable.yukihookapi.hook.factory.method
import com.highcapable.yukihookapi.hook.log.YLog import com.highcapable.yukihookapi.hook.log.YLog
import com.highcapable.yukihookapi.hook.param.HookParam
import com.highcapable.yukihookapi.hook.type.android.ContextClass import com.highcapable.yukihookapi.hook.type.android.ContextClass
import com.highcapable.yukihookapi.hook.type.android.NotificationClass import com.highcapable.yukihookapi.hook.type.android.DrawableClass
import com.highcapable.yukihookapi.hook.type.android.RemoteViewsClass import com.highcapable.yukihookapi.hook.type.android.ImageViewClass
import com.highcapable.yukihookapi.hook.type.java.BooleanClass import com.highcapable.yukihookapi.hook.type.android.StatusBarNotificationClass
import com.highcapable.yukihookapi.hook.type.java.BooleanType
import com.highcapable.yukihookapi.hook.type.java.IntType
import top.defaults.drawabletoolbox.DrawableBuilder import top.defaults.drawabletoolbox.DrawableBuilder
/** /**
@@ -113,24 +113,17 @@ object SystemUIHooker : YukiBaseHooker() {
private val NotificationHeaderViewWrapperInjectorClass private val NotificationHeaderViewWrapperInjectorClass
by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.row.wrapper.NotificationHeaderViewWrapperInjector") by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.row.wrapper.NotificationHeaderViewWrapperInjector")
/** MIUI 未确定版本存在的类 */
private val NotificationContentInflaterInjectorClass
by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.row.NotificationContentInflaterInjector")
/** MIUI 未确定版本存在的类 */ /** MIUI 未确定版本存在的类 */
private val SettingsManagerClass by lazyClassOrNull("com.miui.systemui.SettingsManager") private val SettingsManagerClass by lazyClassOrNull("com.miui.systemui.SettingsManager")
/** MIUI 未确定版本存在的类 */
private val MiuiClockClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.views.MiuiClock")
/** MIUI 新版本存在的类 */ /** MIUI 新版本存在的类 */
private val NotificationStatClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.analytics.NotificationStat") private val NotificationStatClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.analytics.NotificationStat")
/** 原生存在的类 */ /** 原生存在的类 */
private val NotificationChildrenContainerClass by lazyClass("${PackageName.SYSTEMUI}.statusbar.notification.stack.NotificationChildrenContainer") private val NotificationChildrenContainerClass by lazyClass("${PackageName.SYSTEMUI}.statusbar.notification.stack.NotificationChildrenContainer")
/** 原生存在的类 (A15 HyperOS 已变成 `interface`) */ /** 原生存在的类 */
private val NotificationIconAreaControllerClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.phone.NotificationIconAreaController") private val NotificationIconAreaControllerClass by lazyClass("${PackageName.SYSTEMUI}.statusbar.phone.NotificationIconAreaController")
/** 原生存在的类 */ /** 原生存在的类 */
private val ContrastColorUtilClass by lazyClass("com.android.internal.util.ContrastColorUtil") private val ContrastColorUtilClass by lazyClass("com.android.internal.util.ContrastColorUtil")
@@ -177,8 +170,7 @@ object SystemUIHooker : YukiBaseHooker() {
private val NotificationUtilClass by lazyClass( private val NotificationUtilClass by lazyClass(
VariousClass( VariousClass(
"${PackageName.SYSTEMUI}.statusbar.notification.NotificationUtil", "${PackageName.SYSTEMUI}.statusbar.notification.NotificationUtil",
"${PackageName.SYSTEMUI}.miui.statusbar.notification.NotificationUtil", "${PackageName.SYSTEMUI}.miui.statusbar.notification.NotificationUtil"
"${PackageName.SYSTEMUI}.statusbar.notification.utils.NotifImageUtil"
) )
) )
@@ -190,12 +182,6 @@ object SystemUIHooker : YukiBaseHooker() {
) )
) )
/** HyperOS 焦点通知的用到的 API */
private val FocusUtilsClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.notification.utils.FocusUtils")
/** HyperOS 焦点通知的用到的 API */
private val FocusedNotifPromptViewClass by lazyClassOrNull("${PackageName.SYSTEMUI}.statusbar.phone.FocusedNotifPromptView")
/** 缓存的通知图标优化数组 */ /** 缓存的通知图标优化数组 */
private var iconDatas = ArrayList<IconDataBean>() private var iconDatas = ArrayList<IconDataBean>()
@@ -208,9 +194,6 @@ object SystemUIHooker : YukiBaseHooker() {
/** 状态栏原始通知图标最大个数限制 */ /** 状态栏原始通知图标最大个数限制 */
private var statusBarMaxStaticIcons = -1 private var statusBarMaxStaticIcons = -1
/** 模块上次设置的通知图标最大个数限制 */
private var moduleLastSetStatusBarMaxStaticIcons = -1
/** 是否已经使用过缓存刷新功能 */ /** 是否已经使用过缓存刷新功能 */
private var isUsingCachingMethod = false private var isUsingCachingMethod = false
@@ -226,26 +209,18 @@ object SystemUIHooker : YukiBaseHooker() {
/** 仅监听一次主题壁纸颜色变化 */ /** 仅监听一次主题壁纸颜色变化 */
private var isWallpaperColorListenerSetUp = false private var isWallpaperColorListenerSetUp = false
/** 用来同步是否需要焦点图标染色 */
private var focusedIcon = false
/** /**
* 获取全局上下文 * 获取全局上下文
* @return [Context] or null * @return [Context] or null
*/ */
private val globalContext private val globalContext
get() = SystemUIApplicationClass?.resolve()?.optional(silent = true) get() = SystemUIApplicationClass?.method { name = "getContext" }?.ignored()?.get()?.invoke<Context?>() ?: appContext
?.firstMethodOrNull { name = "getContext" }
?.invoke<Context?>() ?: appContext
/** /**
* 是否为 MIUI 样式通知栏 - 旧版 - 新版一律返回 false * 是否为 MIUI 样式通知栏 - 旧版 - 新版一律返回 false
* @return [Boolean] * @return [Boolean]
*/ */
private val isShowMiuiStyle private val isShowMiuiStyle get() = NotificationUtilClass.method { name = "showMiuiStyle" }.ignored().get().boolean()
get() = NotificationUtilClass.resolve().optional(silent = true)
.firstMethodOrNull { name = "showMiuiStyle" }
?.invoke<Boolean>() == true
/** /**
* 是否没有单独的 MIUI 通知栏样式 * 是否没有单独的 MIUI 通知栏样式
@@ -309,33 +284,8 @@ object SystemUIHooker : YukiBaseHooker() {
* @param isCustom 是否为通知优化生效图标 * @param isCustom 是否为通知优化生效图标
* @param isGrayscale 是否为灰度图标 * @param isGrayscale 是否为灰度图标
*/ */
@Suppress("DEPRECATION")
private fun loggerDebug(tag: String, context: Context, nf: StatusBarNotification?, isCustom: Boolean, isGrayscale: Boolean) { private fun loggerDebug(tag: String, context: Context, nf: StatusBarNotification?, isCustom: Boolean, isGrayscale: Boolean) {
if (ConfigData.isEnableModuleLog) { if (ConfigData.isEnableModuleLog) YLog.debug(
val focusTicker = nf?.notification?.extras?.getString("miui.focus.ticker")
val focusIconId = nf?.notification?.extras?.getInt("miui.focus.iconId", -1)
val focusRv = nf?.notification?.extras?.getParcelable<RemoteViews?>("miui.focus.rv")
val focusParam = nf?.notification?.extras?.getString("miui.focus.param")
if (focusRv != null)
YLog.debug(
msg = "(Processing $tag with Focus Notification) ↓\n" +
"[Title]: ${nf.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" +
"[Content]: ${nf.notification?.extras?.getString(Notification.EXTRA_TEXT)}\n" +
"[App Name]: ${context.appNameOf(packageName = nf.packageName ?: "")}\n" +
"[Package Name]: ${nf.packageName}\n" +
"[Sender Package Name]: ${nf.compatOpPkgName}\n" +
"[Custom Icon]: $isCustom\n" +
"[Grayscale Icon]: $isGrayscale\n" +
"[From Xmsf]: ${nf.isXmsf}\n" +
"[String]: ${nf.notification}\n" +
"[Focus IconId]: $focusIconId\n" +
"[Focus String]: ${focusParam}\n" +
"[Focus rv String]: ${focusRv}\n" +
"[Focus Ticker String]: ${focusTicker}\n" +
"[Dark Icon Mode]: $isDarkIconMode"
)
else
YLog.debug(
msg = "(Processing $tag) ↓\n" + msg = "(Processing $tag) ↓\n" +
"[Title]: ${nf?.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" + "[Title]: ${nf?.notification?.extras?.getString(Notification.EXTRA_TITLE)}\n" +
"[Content]: ${nf?.notification?.extras?.getString(Notification.EXTRA_TEXT)}\n" + "[Content]: ${nf?.notification?.extras?.getString(Notification.EXTRA_TEXT)}\n" +
@@ -345,11 +295,9 @@ object SystemUIHooker : YukiBaseHooker() {
"[Custom Icon]: $isCustom\n" + "[Custom Icon]: $isCustom\n" +
"[Grayscale Icon]: $isGrayscale\n" + "[Grayscale Icon]: $isGrayscale\n" +
"[From Xmsf]: ${nf?.isXmsf}\n" + "[From Xmsf]: ${nf?.isXmsf}\n" +
"[String]: ${nf?.notification}\n" + "[String]: ${nf?.notification}"
"[Dark Icon Mode]: $isDarkIconMode"
) )
} }
}
/** /**
* - 这个是修复彩色图标的关键核心代码判断 * - 这个是修复彩色图标的关键核心代码判断
@@ -361,18 +309,14 @@ object SystemUIHooker : YukiBaseHooker() {
*/ */
private fun isGrayscaleIcon(context: Context, drawable: Drawable) = private fun isGrayscaleIcon(context: Context, drawable: Drawable) =
if (ConfigData.isEnableColorIconCompat.not()) safeOfFalse { if (ConfigData.isEnableColorIconCompat.not()) safeOfFalse {
ContrastColorUtilClass.resolve() ContrastColorUtilClass.let {
.optional(silent = true) it.method {
.let {
it.firstMethodOrNull {
name = "isGrayscaleIcon" name = "isGrayscaleIcon"
parameters(Drawable::class) param(DrawableClass)
}?.of( }.get(it.method {
it.firstMethodOrNull {
name = "getInstance" name = "getInstance"
parameters(Context::class) param(ContextClass)
}?.invoke(context) }.get().invoke(context)).boolean(drawable)
)?.invokeQuietly<Boolean>(drawable) == true
} }
} else BitmapCompatTool.isGrayscaleDrawable(drawable) } else BitmapCompatTool.isGrayscaleDrawable(drawable)
@@ -381,7 +325,7 @@ object SystemUIHooker : YukiBaseHooker() {
* @return [Drawable] * @return [Drawable]
*/ */
private fun Drawable.rounded(context: Context) = private fun Drawable.rounded(context: Context) =
safeOf(default = this) { toBitmap().round(10.dpFloat(context)).toDrawable(context.resources) } safeOf(default = this) { BitmapDrawable(context.resources, toBitmap().round(10.dpFloat(context))) }
/** /**
* 适配通知栏、状态栏来自系统推送的彩色 APP 图标 * 适配通知栏、状态栏来自系统推送的彩色 APP 图标
@@ -413,10 +357,10 @@ object SystemUIHooker : YukiBaseHooker() {
/** 刷新状态栏小图标 */ /** 刷新状态栏小图标 */
private fun refreshStatusBarIcons() = runInSafe { private fun refreshStatusBarIcons() = runInSafe {
StatusBarIconViewClass.resolve().optional(silent = true).firstFieldOrNull { name = "mNotification" }?.also { result -> StatusBarIconViewClass.field { name = "mNotification" }.also { result ->
notificationIconContainer?.children?.forEach { notificationIconContainer?.children?.forEach {
/** 得到通知实例 */ /** 得到通知实例 */
val nf = result.of(it).get<StatusBarNotification>() ?: return val nf = result.get(it).cast<StatusBarNotification>() ?: return
/** 刷新状态栏图标 */ /** 刷新状态栏图标 */
compatStatusIcon(it.context, nf, nf.notification.smallIcon.loadDrawable(it.context)).also { pair -> compatStatusIcon(it.context, nf, nf.notification.smallIcon.loadDrawable(it.context)).also { pair ->
pair.first.let { e -> (it as? ImageView?)?.setImageDrawable(e) } pair.first.let { e -> (it as? ImageView?)?.setImageDrawable(e) }
@@ -428,13 +372,14 @@ object SystemUIHooker : YukiBaseHooker() {
/** 刷新通知小图标 */ /** 刷新通知小图标 */
private fun refreshNotificationIcons() = runInSafe { private fun refreshNotificationIcons() = runInSafe {
val updateNotificationMethodName = "updateNotificationsOnDensityOrFontScaleChanged" val updateNotificationMethodName = "updateNotificationsOnDensityOrFontScaleChanged"
val result = notificationPresenter?.asResolver()?.optional(silent = true)?.firstMethodOrNull { if (StatusBarNotificationPresenterClass.hasMethod { name = updateNotificationMethodName })
notificationPresenter?.current(ignored = true)?.method {
name = updateNotificationMethodName name = updateNotificationMethodName
emptyParameters() emptyParam()
}?.invoke() }?.call()
if (result == null) settingsManager?.asResolver()?.optional(silent = true)?.apply { else settingsManager?.current {
firstFieldOrNull { name = "notifStyle" }?.set(-100) field { name = "notifStyle" }.set(-100)
firstMethodOrNull { name = "onNotifStyleChanged" }?.invoke() method { name = "onNotifStyleChanged" }.call()
} }
} }
@@ -477,12 +422,8 @@ object SystemUIHooker : YukiBaseHooker() {
/** 判断是否不是灰度图标 */ /** 判断是否不是灰度图标 */
val isGrayscaleIcon = notifyInstance.isXmsf.not() && isGrayscaleIcon(context, iconDrawable) val isGrayscaleIcon = notifyInstance.isXmsf.not() && isGrayscaleIcon(context, iconDrawable)
/** 读取通知是否附加包名,如果没有则使用通知包名 */
val extras = notifyInstance.notification.extras
val pkgname = extras.getString("app_package")?.takeIf { it.isNotBlank() } ?: notifyInstance.nfPkgName
/** 目标彩色通知 APP 图标 */ /** 目标彩色通知 APP 图标 */
val customTriple = compatCustomIcon(context, isGrayscaleIcon, pkgname) val customTriple = compatCustomIcon(context, isGrayscaleIcon, notifyInstance.nfPkgName)
/** 是否为通知优化生效图标 */ /** 是否为通知优化生效图标 */
val isCustom = customTriple.first != null && customTriple.third.not() val isCustom = customTriple.first != null && customTriple.third.not()
@@ -580,13 +521,9 @@ object SystemUIHooker : YukiBaseHooker() {
/** 自定义默认小图标 */ /** 自定义默认小图标 */
var customIcon: Drawable? = null var customIcon: Drawable? = null
/** 读取通知是否附加包名,如果没有则使用通知包名 */
val extras = notifyInstance.notification.extras
val pkgname = extras.getString("app_package")?.takeIf { it.isNotBlank() } ?: notifyInstance.nfPkgName
/** 自定义默认小图标颜色 */ /** 自定义默认小图标颜色 */
var customIconColor = 0 var customIconColor = 0
compatCustomIcon(context, isGrayscaleIcon, pkgname).also { compatCustomIcon(context, isGrayscaleIcon, notifyInstance.nfPkgName).also {
/** 不处理占位符图标 */ /** 不处理占位符图标 */
if (it.third) return@also if (it.third) return@also
customIcon = it.first customIcon = it.first
@@ -657,7 +594,7 @@ object SystemUIHooker : YukiBaseHooker() {
*/ */
private fun ImageView.isGrayscaleIcon(): Boolean { private fun ImageView.isGrayscaleIcon(): Boolean {
/** 获取 [StatusBarNotification] 实例 */ /** 获取 [StatusBarNotification] 实例 */
val notifyInstance = asResolver().optional().firstFieldOrNull { name = "mNotification" }?.get<StatusBarNotification>() ?: return false val notifyInstance = current().field { name = "mNotification" }.cast<StatusBarNotification>() ?: return false
/** 获取通知小图标 */ /** 获取通知小图标 */
val iconDrawable = notifyInstance.notification?.smallIcon?.loadDrawable(context) ?: return false val iconDrawable = notifyInstance.notification?.smallIcon?.loadDrawable(context) ?: return false
@@ -681,7 +618,7 @@ object SystemUIHooker : YukiBaseHooker() {
* @param animColor 动画过渡颜色 * @param animColor 动画过渡颜色
*/ */
private fun updateStatusBarIconsColor(container: ViewGroup, isDarkIconMode: Boolean = this.isDarkIconMode, animColor: Int? = null) { private fun updateStatusBarIconsColor(container: ViewGroup, isDarkIconMode: Boolean = this.isDarkIconMode, animColor: Int? = null) {
if (container.isNotEmpty()) container.children.forEach { iconView -> if (container.childCount > 0) container.children.forEach { iconView ->
if (iconView !is ImageView) return@forEach if (iconView !is ImageView) return@forEach
updateStatusBarIconColor(iconView, isDarkIconMode, animColor) updateStatusBarIconColor(iconView, isDarkIconMode, animColor)
} }
@@ -711,53 +648,27 @@ object SystemUIHooker : YukiBaseHooker() {
* @param container 当前 [NotificationIconContainerClass] 的实例 * @param container 当前 [NotificationIconContainerClass] 的实例
*/ */
private fun updateStatusBarIconsAlpha(container: ViewGroup) { private fun updateStatusBarIconsAlpha(container: ViewGroup) {
val iconStatesMap = container.asResolver().optional().firstFieldOrNull { name = "mIconStates" }?.get<HashMap<View, Any>>() val iconStatesMap = container.current().field { name = "mIconStates" }.cast<HashMap<View, Any>>()
if (container.isNotEmpty()) container.children.forEach { iconView -> if (container.childCount > 0) container.children.forEach { iconView ->
if (iconView !is ImageView) return@forEach if (iconView !is ImageView) return@forEach
val iconAlpha = if (iconView.isGrayscaleIcon()) statusBarIconAlpha else 1f val iconAlpha = if (iconView.isGrayscaleIcon()) statusBarIconAlpha else 1f
iconView.alpha = iconAlpha iconView.alpha = iconAlpha
iconStatesMap?.get(iconView)?.asResolver()?.optional()?.firstFieldOrNull { iconStatesMap?.get(iconView)?.current()?.field { name { it == "alpha" || it == "mAlpha" }; superClass() }?.set(iconAlpha)
name { it == "alpha" || it == "mAlpha" }
superclass()
}?.set(iconAlpha)
} }
} }
/** /**
* Hook 状态栏通知图标最大数量 * Hook 状态栏通知图标最大数量
* @param fieldName 最大通知图标数量 的变量名
* @param instance 被 Hook 的 Method 的实例 * @param instance 被 Hook 的 Method 的实例
*/ */
private fun hookStatusBarMaxStaticIcons(instance: Any) { private fun hookStatusBarMaxStaticIcons(fieldName: String, instance: Any) {
val maxStaticIconsResolver = NotificationIconContainerClass.resolve().optional().firstFieldOrNull { val maxStaticIconsField = NotificationIconContainerClass.field { name = fieldName }.get(instance)
name { if (statusBarMaxStaticIcons == -1) statusBarMaxStaticIcons = maxStaticIconsField.int()
/** 旧版名称 */
val oldVersion = it == "mMaxStaticIcons"
/** 旧版名称 */
val oldVersion2 = it == "MAX_STATIC_ICONS"
/** 新版本名称 */
val newVersion = it == "mMaxIcons"
oldVersion || oldVersion2 || newVersion
}
}?.of(instance) ?: return
if (statusBarMaxStaticIcons == -1 ||
/** 系统设置内修改,模块同步更新 */
moduleLastSetStatusBarMaxStaticIcons != maxStaticIconsResolver.get<Int>()) {
statusBarMaxStaticIcons = maxStaticIconsResolver.get<Int>() ?: return
}
if (!ConfigData.isEnableLiftedStatusIconCount) {
maxStaticIconsResolver.set(statusBarMaxStaticIcons)
return
}
/** 解除状态栏通知图标个数限制 */ /** 解除状态栏通知图标个数限制 */
if (isShowNotificationIcons) { if (isShowNotificationIcons && ConfigData.isEnableLiftedStatusIconCount)
moduleLastSetStatusBarMaxStaticIcons = ConfigData.liftedStatusIconCount.let { if (it in 0..100) it else 5 } maxStaticIconsField.set(ConfigData.liftedStatusIconCount.let { if (it in 0..100) it else 5 })
maxStaticIconsResolver.set(moduleLastSetStatusBarMaxStaticIcons) else maxStaticIconsField.set(if (isShowNotificationIcons) statusBarMaxStaticIcons else 0)
} else {
maxStaticIconsResolver.set(0)
moduleLastSetStatusBarMaxStaticIcons = 0
}
} }
/** /**
@@ -769,8 +680,8 @@ object SystemUIHooker : YukiBaseHooker() {
if (isNotHasAbsoluteMiuiStyle && isShowMiuiStyle) return if (isNotHasAbsoluteMiuiStyle && isShowMiuiStyle) return
/** 获取小图标 */ /** 获取小图标 */
val iconImageView = NotificationHeaderViewWrapperClass.resolve().optional() val iconImageView = NotificationHeaderViewWrapperClass
.firstFieldOrNull { name = "mIcon" }?.of(wrapper)?.get<ImageView>() ?: return .field { name = "mIcon" }.get(wrapper).cast<ImageView>() ?: return
/** 获取 [ExpandableNotificationRowClass] */ /** 获取 [ExpandableNotificationRowClass] */
val rowPair = wrapper.getRowPair() val rowPair = wrapper.getRowPair()
@@ -803,15 +714,16 @@ object SystemUIHooker : YukiBaseHooker() {
* 从父类中得到 mRow 变量 - [ExpandableNotificationRowClass] * 从父类中得到 mRow 变量 - [ExpandableNotificationRowClass]
* 获取其中的得到通知方法 * 获取其中的得到通知方法
*/ */
val row = NotificationViewWrapperClass.resolve().optional().firstFieldOrNull { val row = NotificationViewWrapperClass.field {
name = "mRow" name = "mRow"
}?.of(this)?.get()?.also { }.get(this).any()?.also {
isExpanded = ExpandableNotificationRowClass.resolve().optional().firstMethodOrNull { isExpanded = ExpandableNotificationRowClass.method {
name = "isExpanded" name = "isExpanded"
parameters(Boolean::class) param(BooleanType)
returnType = Boolean::class returnType = BooleanType
}?.of(it)?.invoke<Boolean>(false) == true }.get(it).boolean(false)
}; return isExpanded to row }
return Pair(isExpanded, row)
} }
/** /**
@@ -819,18 +731,15 @@ object SystemUIHooker : YukiBaseHooker() {
* @return [StatusBarNotification] or null * @return [StatusBarNotification] or null
*/ */
private fun Any?.getSbn() = private fun Any?.getSbn() =
ExpandableNotificationRowClass.resolve() ExpandableNotificationRowClass
.optional(silent = true) .method { name = "getEntry" }
.firstFieldOrNull { .get(this).call()
name = "mEntry" ?.current(ignored = true)
}?.of(this)?.get()?.asResolver() ?.field { name = "mSbn" }
?.optional(silent = true) ?.cast<StatusBarNotification>()
?.firstFieldOrNull { name = "mSbn" } ?: ExpandableNotificationRowClass
?.get<StatusBarNotification>() .method { name = "getStatusBarNotification" }
?: ExpandableNotificationRowClass.resolve() .get(this).invoke<StatusBarNotification>()
.optional(silent = true)
.firstMethodOrNull { name = "getStatusBarNotification" }
?.of(this)?.invoke<StatusBarNotification>()
/** /**
* 根据当前 [ImageView] 的父布局克隆一个新的 [ImageView] * 根据当前 [ImageView] 的父布局克隆一个新的 [ImageView]
@@ -860,11 +769,7 @@ object SystemUIHooker : YukiBaseHooker() {
private fun registerLifecycle() { private fun registerLifecycle() {
onAppLifecycle { onAppLifecycle {
/** 解锁后重新刷新状态栏图标防止系统重新设置它 */ /** 解锁后重新刷新状态栏图标防止系统重新设置它 */
registerReceiver(Intent.ACTION_USER_PRESENT) { _, _ -> registerReceiver(Intent.ACTION_USER_PRESENT) { _, _ -> if (isUsingCachingMethod) refreshStatusBarIcons() }
if (isUsingCachingMethod) refreshStatusBarIcons()
/** 每次解锁时都对通知栏的图标进行刷新以响应 [RemoteViews] 阶段的图标改变 */
refreshNotificationIcons()
}
/** 注册定时监听 */ /** 注册定时监听 */
registerReceiver(Intent.ACTION_TIME_TICK) { context, _ -> registerReceiver(Intent.ACTION_TIME_TICK) { context, _ ->
if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify && ConfigData.isEnableNotifyIconFixAuto) if (ConfigData.isEnableNotifyIconFix && ConfigData.isEnableNotifyIconFixNotify && ConfigData.isEnableNotifyIconFixAuto)
@@ -933,48 +838,25 @@ object SystemUIHooker : YukiBaseHooker() {
/** 注入 MIUI 自己增加的一个工具类 */ /** 注入 MIUI 自己增加的一个工具类 */
NotificationUtilClass.apply { NotificationUtilClass.apply {
/** 强制回写系统的状态栏图标样式为原生 */ /** 强制回写系统的状态栏图标样式为原生 */
resolve().optional().method { method {
name { it == "shouldSubstituteSmallIcon" || it == "shouldSubstituteSmallIconForStatusBarNotification" } name { it == "shouldSubstituteSmallIcon" || it == "shouldSubstituteSmallIconForStatusBarNotification" }
parameters { it.first() isSubclassOf StatusBarNotification::class } param { it[0] extends StatusBarNotificationClass }
}.hookAll().replaceToFalse() }.hookAll().replaceToFalse()
var isUseLegacy = false var isUseLegacy = false
/** /** 强制回写系统的状态栏图标样式为原生 */
* 强制修改 getCustomAppIcon 获取的图标为 smallIcon method {
* 部分系统没有 "getCustomAppIcon" 这个方法 - 所以直接忽略
*/
resolve().optional(silent = true).firstMethodOrNull {
name = "getCustomAppIcon"
parameters(Notification::class, Context::class)
}?.hook()?.after {
val nf = args().first().cast<Notification>()
val context = args(index = 1).cast<Context>()
val iconBitmap = nf?.smallIcon?.loadDrawable(context)?.toBitmap()
result = if (context != null && iconBitmap != null && !iconBitmap.isRecycled)
iconBitmap.toDrawable(context.resources)
else null
}
/**
* 强制回写系统的状态栏图标样式为原生
* 部分系统没有 "getSmallIcon" 这个方法 - 所以直接忽略
*/
val getSmallIconCondition1 = MethodCondition<Any>().apply {
name = "getSmallIcon" name = "getSmallIcon"
parameters { it[0] isSubclassOf StatusBarNotification::class && it[1] == classOf<Int>() } param { it[0] extends StatusBarNotificationClass && it[1] == IntType }
} }.remedys {
val getSmallIconCondition2 = MethodCondition<Any>().apply { method {
name = "getSmallIcon" name = "getSmallIcon"
parameters(ExpandedNotificationClass) param(ExpandedNotificationClass)
} }
val getSmallIconCondition3 = MethodCondition<Any>().apply { method {
name = "getSmallIcon" name = "getSmallIcon"
parameters { it[0] == classOf<Context>() && it[1] isSubclassOf StatusBarNotification::class } param(ContextClass, ExpandedNotificationClass)
} }.onFind { isUseLegacy = true }
val getSmallIconResolver = resolve().optional(silent = true) }.hook().after {
val getSmallIcon = getSmallIconResolver.firstMethodOrNull(getSmallIconCondition1)
?: getSmallIconResolver.firstMethodOrNull(getSmallIconCondition2)
?: getSmallIconResolver.firstMethodOrNull(getSmallIconCondition3)
?.also { isUseLegacy = true }
getSmallIcon?.hook()?.after {
(globalContext ?: args().first().cast())?.also { context -> (globalContext ?: args().first().cast())?.also { context ->
val expandedNf = args(if (isUseLegacy) 1 else 0).cast<StatusBarNotification?>() val expandedNf = args(if (isUseLegacy) 1 else 0).cast<StatusBarNotification?>()
/** Hook 状态栏小图标 */ /** Hook 状态栏小图标 */
@@ -986,90 +868,29 @@ object SystemUIHooker : YukiBaseHooker() {
} }
} }
} }
/** 焦点通知深色模式切换点 */
FocusedNotifPromptViewClass?.resolve()?.optional()?.apply {
firstMethodOrNull {
name = "onDarkChanged"
parameters(ArrayList::class, Float::class, Int::class, Int::class, Int::class, Boolean::class)
}?.hook()?.after {
val isDark = args(index = 1).float()
val mIcon = firstFieldOrNull { name = "mIcon" }?.of(instance)?.get()
if (ConfigData.isEnableModuleLog)
YLog.debug("FocusedNotifPromptView DEBUG $isDark $mIcon")
if (focusedIcon || ConfigData.isEnableFocusNotificationFix)
mIcon?.asResolver()?.optional()?.firstMethodOrNull {
name = "setColorFilter"
superclass()
}?.invoke(if (isDark <= 0.5f) Color.WHITE else Color.BLACK)
}
}
/** 去他妈的焦点通知彩色图标 */
FocusUtilsClass?.resolve()?.optional()?.apply {
fun HookParam.hookTickerDarkIcon(isDark: Boolean) {
(globalContext ?: args().first().cast())?.also { context ->
val expandedNf = args().first().cast<StatusBarNotification?>()
val small = expandedNf?.notification?.smallIcon
/** Hook 状态栏小图标 */
compatStatusIcon(
context = context,
nf = expandedNf,
iconDrawable = small?.loadDrawable(context)
).also { pair ->
focusedIcon = pair.second
val originalBitmap = pair.first?.toBitmap()
val bitmap = originalBitmap?.scale(50, 50)
result = Icon.createWithBitmap(bitmap).apply {
if (pair.second || ConfigData.isEnableFocusNotificationFix)
setTint(if (isDark) Color.BLACK else Color.WHITE)
}
}
}
}
firstMethodOrNull {
name = "getStatusBarTickerDarkIcon"
parameters {
(it.first() == classOf<StatusBarNotification>() ||
it.first() == ExpandedNotificationClass) && it.size == 1
}
}?.hook()?.after { hookTickerDarkIcon(isDark = true) }
firstMethodOrNull {
name = "getStatusBarTickerIcon"
parameters {
(it.first() == classOf<StatusBarNotification>() ||
it.first() == ExpandedNotificationClass) && it.size == 1
}
}?.hook()?.after { hookTickerDarkIcon(isDark = false) }
}
/** 注入状态栏通知图标实例 */ /** 注入状态栏通知图标实例 */
StatusBarIconViewClass.resolve().optional().firstMethodOrNull { StatusBarIconViewClass.method {
name = "updateIconColor" name = "updateIconColor"
emptyParameters() emptyParam()
}?.hook()?.after { }.ignored().hook().after {
val iconView = instance<ImageView>() val iconView = instance<ImageView>()
val expandedNf = iconView.asResolver().optional().firstFieldOrNull { name = "mNotification" }?.get<StatusBarNotification>() val expandedNf = iconView.current().field { name = "mNotification" }.cast<StatusBarNotification>()
/** Hook 状态栏小图标 */ /** Hook 状态栏小图标 */
compatStatusIcon( compatStatusIcon(
context = iconView.context, context = iconView.context,
nf = expandedNf, nf = expandedNf,
iconDrawable = expandedNf?.notification?.smallIcon?.loadDrawable(iconView.context) iconDrawable = expandedNf?.notification?.smallIcon?.loadDrawable(iconView.context)
).also { pair -> ).also { pair -> iconView.setImageDrawable(pair.first) }
if (pair.second)
result = iconView.setImageDrawable(pair.first?.toBitmap()?.toDrawable(iconView.resources))
}
updateStatusBarIconColor(iconView) updateStatusBarIconColor(iconView)
} }
/** /** 注入状态栏通知图标容器管理实例 */
* 注入状态栏通知图标容器管理实例 NotificationIconAreaControllerClass.apply {
* 在 Android 15 中,这个类被移除变成了 `interface`,所以判断并跳过 Hook 行为
*/
val isPlaceholder = NotificationIconAreaControllerClass?.isInterface == true
if (!isPlaceholder) NotificationIconAreaControllerClass?.resolve()?.optional()?.apply {
/** Hook 深色图标模式改变 */ /** Hook 深色图标模式改变 */
firstMethodOrNull { method {
name = "onDarkChanged" name = "onDarkChanged"
parameterCount { it > 0 } paramCount { it > 0 }
}?.hook()?.after { }.hook().after {
firstFieldOrNull { name = "mNotificationIcons" }?.of(instance)?.get<ViewGroup>()?.also { field { name = "mNotificationIcons" }.get(instance).cast<ViewGroup>()?.also {
/** 重新设置通知图标容器实例 */ /** 重新设置通知图标容器实例 */
notificationIconContainer = it notificationIconContainer = it
when (args(index = 1).float()) { when (args(index = 1).float()) {
@@ -1089,7 +910,7 @@ object SystemUIHooker : YukiBaseHooker() {
method { method {
name { it == "updateNotificationIcons" || it.startsWith("onChanged") } name { it == "updateNotificationIcons" || it.startsWith("onChanged") }
}.hookAll().after { }.hookAll().after {
firstFieldOrNull { name = "mNotificationIcons" }?.of(instance)?.get<ViewGroup>()?.also { field { name = "mNotificationIcons" }.get(instance).cast<ViewGroup>()?.also {
/** 重新设置通知图标容器实例 */ /** 重新设置通知图标容器实例 */
notificationIconContainer = it notificationIconContainer = it
updateStatusBarIconsColor(it) updateStatusBarIconsColor(it)
@@ -1097,76 +918,35 @@ object SystemUIHooker : YukiBaseHooker() {
delayedRun { updateStatusBarIconsColor(it) } delayedRun { updateStatusBarIconsColor(it) }
} }
} }
} else MiuiClockClass?.resolve()?.optional()?.apply {
firstMethodOrNull {
name = "onDarkChanged"
parameterCount { it > 4 }
}?.hook()?.after {
notificationIconContainer?.let {
when (args(index = 1).float()) {
1.0f -> {
isDarkIconMode = true
updateStatusBarIconsColor(it, isDarkIconMode = true)
}
0.0f -> {
isDarkIconMode = false
updateStatusBarIconsColor(it, isDarkIconMode = false)
}
else -> updateStatusBarIconsColor(it, isDarkIconMode = false, args(index = 2).int())
}
}
}
} }
/** 注入状态栏通知图标实例 */ /** 注入状态栏通知图标实例 */
StatusBarIconViewClass.resolve().optional().apply { StatusBarIconViewClass.method {
firstMethodOrNull {
name = "setNotification" name = "setNotification"
parameters { param(StatusBarNotificationClass)
(it.first() == classOf<StatusBarNotification>() || }.remedys {
it.first() == ExpandedNotificationClass) && it.size == 1 method {
name = "setNotification"
param(ExpandedNotificationClass)
} }
}?.hook()?.after { }.hook().after {
/** 注册壁纸颜色监听 */ /** 注册壁纸颜色监听 */
if (args().first().any() != null) instance<ImageView>().also { registerWallpaperColorChanged(it) } if (args().first().any() != null) instance<ImageView>().also { registerWallpaperColorChanged(it) }
} }
/** Hook 深色图标模式改变 */
if (isPlaceholder) firstMethodOrNull {
name = "onDarkChanged"
parameterCount { it > 4 }
}?.hook()?.after {
val self = instance<ImageView>()
when (args(index = 1).float()) {
1.0f -> {
isDarkIconMode = true
updateStatusBarIconColor(self, isDarkIconMode = true)
}
0.0f -> {
isDarkIconMode = false
updateStatusBarIconColor(self, isDarkIconMode = false)
}
else -> updateStatusBarIconColor(self, isDarkIconMode = false, args(index = 2).int())
}
}
}
/** 注入设置管理器实例 */ /** 注入设置管理器实例 */
SettingsManagerClass?.resolve()?.optional()?.constructor {}?.hookAll()?.after { settingsManager = instance } SettingsManagerClass?.constructor()?.hookAll()?.after { settingsManager = instance }
/** 注入通知控制器实例 */ /** 注入通知控制器实例 */
StatusBarNotificationPresenterClass.resolve().optional().constructor {}.hookAll().after { notificationPresenter = instance } StatusBarNotificationPresenterClass.constructor().hookAll().after { notificationPresenter = instance }
/** 注入状态栏通知图标容器实例 */ /** 注入状态栏通知图标容器实例 */
NotificationIconContainerClass.apply { NotificationIconContainerClass.apply {
resolve().optional().firstMethodOrNull { method {
name = "applyIconStates" name = "applyIconStates"
}?.hook()?.after { updateStatusBarIconsAlpha(instance()) } }.hook().after { updateStatusBarIconsAlpha(instance()) }
resolve().optional().firstMethodOrNull { method {
name = "resetViewStates" name = "resetViewStates"
}?.hook()?.after { }.hook().after { updateStatusBarIconsAlpha(instance()) }
updateStatusBarIconsAlpha(instance()) method {
/** HyperOS 系统设置修改通知图标个数触发此方法 */
hookStatusBarMaxStaticIcons(instance)
}
resolve().optional().firstMethodOrNull {
name { it == "calculateIconTranslations" || it == "calculateIconXTranslations" } name { it == "calculateIconTranslations" || it == "calculateIconXTranslations" }
}?.hook()?.after { }.hook().after {
/** 缓存实例 */ /** 缓存实例 */
notificationIconContainer = instance<ViewGroup>() notificationIconContainer = instance<ViewGroup>()
/** 修复部分开发版状态栏图标只能显示一个的问题 */ /** 修复部分开发版状态栏图标只能显示一个的问题 */
@@ -1175,39 +955,39 @@ object SystemUIHooker : YukiBaseHooker() {
instance<ViewGroup>().layoutParams.width = 9999 instance<ViewGroup>().layoutParams.width = 9999
} }
} }
/** 旧版方法 (A13 MIUI) - 新版不存在 */ /** 旧版方法 A13MIUI - 新版不存在 */
resolve().optional(silent = true).firstMethodOrNull { method {
name = "updateState" name = "updateState"
}?.hook()?.before { hookStatusBarMaxStaticIcons(instance) } }.ignored().hook().before { hookStatusBarMaxStaticIcons("MAX_STATIC_ICONS", instance) }
/** 新版方法 (A14 MIUI14 / A14 HyperOS) - 旧版不存在 */ /** 新版方法 (A14 MIUI14 / A14 HyperOS) - 旧版不存在 */
resolve().optional(silent = true).firstMethodOrNull { method {
name = "onMeasure" name = "onMeasure"
}?.hook()?.before { hookStatusBarMaxStaticIcons(instance) } }.ignored().hook().before { hookStatusBarMaxStaticIcons("mMaxStaticIcons", instance) }
/** 旧版方法 - 新版不存在 */ /** 旧版方法 - 新版不存在 */
resolve().optional(silent = true).firstMethodOrNull { method {
name = "setMaxStaticIcons" name = "setMaxStaticIcons"
parameters(Int::class) param(IntType)
}?.hook()?.before { isShowNotificationIcons = args().first().int() > 0 } }.ignored().hook().before { isShowNotificationIcons = args().first().int() > 0 }
/** 版方法 - 新版 (A15 HyperOS) 不存在 */ /** 版方法 - 旧版不存在 */
resolve().optional(silent = true).firstMethodOrNull { method {
name = "miuiShowNotificationIcons" name = "miuiShowNotificationIcons"
parameters(Boolean::class) param(BooleanType)
}?.hook()?.before { isShowNotificationIcons = args().first().boolean() } }.ignored().hook().before { isShowNotificationIcons = args().first().boolean() }
} }
/** 注入原生通知包装纸实例 */ /** 注入原生通知包装纸实例 */
NotificationHeaderViewWrapperClass.resolve().optional().apply { NotificationHeaderViewWrapperClass.apply {
firstMethodOrNull { method {
name { it == "resolveHeaderViews" || it == "handleHeaderViews" || it == "resolveViews" } name { it == "resolveHeaderViews" || it == "handleHeaderViews" || it == "resolveViews" }
}?.hook()?.after { hookNotificationViewWrapper(instance) } }.hook().after { hookNotificationViewWrapper(instance) }
firstMethodOrNull { method {
name = "onContentUpdated" name = "onContentUpdated"
}?.hook()?.after { hookNotificationViewWrapper(instance) } }.hook().after { hookNotificationViewWrapper(instance) }
} }
/** 修改 MIUI 风格通知栏的通知图标 */ /** 修改 MIUI 风格通知栏的通知图标 */
MiuiNotificationViewWrapperClass?.resolve()?.optional()?.apply { MiuiNotificationViewWrapperClass?.apply {
constructor {}.hookAll().after { constructor().hook().after {
val nf = instance.getRowPair().second.getSbn() ?: return@after val nf = instance.getRowPair().second.getSbn() ?: return@after
firstFieldOrNull { name = "mAppIcon" }?.of(instance)?.get<ImageView>()?.clone { field { name = "mAppIcon" }.get(instance).cast<ImageView>()?.clone {
if (ConfigData.isEnableReplaceMiuiStyleNotifyIcon || ConfigData.isEnableNotifyIconForceAppIcon) if (ConfigData.isEnableReplaceMiuiStyleNotifyIcon || ConfigData.isEnableNotifyIconForceAppIcon)
compatNotifyIcon(context, nf, iconView = this, isUseMaterial3Style = true, isMiuiPanel = true) compatNotifyIcon(context, nf, iconView = this, isUseMaterial3Style = true, isMiuiPanel = true)
else setImageDrawable(nf.miuiAppIcon?.loadDrawable(context) ?: context.appIconOf(nf.packageName)) else setImageDrawable(nf.miuiAppIcon?.loadDrawable(context) ?: context.appIconOf(nf.packageName))
@@ -1215,16 +995,16 @@ object SystemUIHooker : YukiBaseHooker() {
} }
} }
/** 修改 MIUI 风格通知栏的通知图标 - 折叠通知 */ /** 修改 MIUI 风格通知栏的通知图标 - 折叠通知 */
MiuiNotificationChildrenContainerClass?.resolve()?.optional()?.apply { MiuiNotificationChildrenContainerClass?.apply {
/** 替换通知小图标 */ /** 替换通知小图标 */
firstMethodOrNull { method {
name = "updateAppIcon" name = "updateAppIcon"
parameters(Boolean::class) param(BooleanType)
}?.hook()?.after { }.hook().after {
firstFieldOrNull { name = "mAppIcon" }?.of(instance)?.get<ImageView>()?.apply { field { name = "mAppIcon" }.get(instance).cast<ImageView>()?.apply {
val nf = NotificationChildrenContainerClass.resolve().optional().firstFieldOrNull { val nf = NotificationChildrenContainerClass.field {
name = "mContainingNotification" name = "mContainingNotification"
}?.of(instance)?.get()?.getSbn() ?: return@after }.get(instance).any()?.getSbn() ?: return@after
if (ConfigData.isEnableReplaceMiuiStyleNotifyIcon || ConfigData.isEnableNotifyIconForceAppIcon) if (ConfigData.isEnableReplaceMiuiStyleNotifyIcon || ConfigData.isEnableNotifyIconForceAppIcon)
compatNotifyIcon(context, nf, iconView = this, isUseMaterial3Style = true, isMiuiPanel = true) compatNotifyIcon(context, nf, iconView = this, isUseMaterial3Style = true, isMiuiPanel = true)
else setImageDrawable(nf.miuiAppIcon?.loadDrawable(context) ?: context.appIconOf(nf.packageName)) else setImageDrawable(nf.miuiAppIcon?.loadDrawable(context) ?: context.appIconOf(nf.packageName))
@@ -1232,29 +1012,21 @@ object SystemUIHooker : YukiBaseHooker() {
} }
} }
/** 干掉下拉通知图标自动设置回 APP 图标的方法 */ /** 干掉下拉通知图标自动设置回 APP 图标的方法 */
NotificationHeaderViewWrapperInjectorClass?.resolve()?.optional(silent = true)?.apply { NotificationHeaderViewWrapperInjectorClass?.apply {
firstMethodOrNull { method {
name = "setAppIcon" name = "setAppIcon"
parameters(Context::class, ImageView::class, ExpandedNotificationClass) param(ContextClass, ImageViewClass, ExpandedNotificationClass)
}?.hook()?.intercept() }.remedys {
firstMethodOrNull { method {
name = "setAppIcon" name = "setAppIcon"
parameters(ImageView::class, ExpandedNotificationClass) param(ImageViewClass, ExpandedNotificationClass)
}?.hook()?.intercept() }
firstMethodOrNull { }.ignored().hook().intercept()
name = "resetIconBgAndPaddings" method {
parameters(ImageView::class, ExpandedNotificationClass) name = "resetIconBgAndPaddings"
}?.hook()?.intercept() param(ImageViewClass, ExpandedNotificationClass)
}.ignored().hook().intercept()
} }
NotificationContentInflaterInjectorClass?.resolve()?.optional()?.firstMethodOrNull {
name = "handleAppIcon"
/**
* MIUI 14 ([RemoteViewsClass], [NotificationClass])
* HyperOS ([RemoteViewsClass], [NotificationClass], [ContextClass])
* HyperOS 2.0 ([RemoteViewsClass], [NotificationClass], [ContextClass], [BooleanClass])
*/
parameterCount { it in 2..4 }
}?.hook()?.intercept()
/** /**
* 尝试修复从 MIUI 14 开始出现的一个崩溃问题 * 尝试修复从 MIUI 14 开始出现的一个崩溃问题
* 由于模块注入推送的通知没有对 [StatusBarNotification] 设置 TAG 会导致其空指针 * 由于模块注入推送的通知没有对 [StatusBarNotification] 设置 TAG 会导致其空指针
@@ -1266,14 +1038,14 @@ object SystemUIHooker : YukiBaseHooker() {
* } * }
* ``` * ```
*/ */
NotificationStatClass?.resolve()?.optional(silent = true)?.firstMethodOrNull { NotificationStatClass?.method {
name = "isUnimportantEntry" name = "isUnimportantEntry"
parameterCount = 1 paramCount = 1
}?.hook()?.replaceAny { }?.ignored()?.hook()?.replaceAny {
args().first().any()?.asResolver()?.optional()?.firstMethodOrNull { args().first().current(ignored = true).method {
name = "getSbn" name = "getSbn"
superclass() superClass()
}?.invoke<StatusBarNotification>()?.let { sbn -> }.invoke<StatusBarNotification>()?.let { sbn ->
sbn.packageName == PackageName.SYSTEMUI && sbn.tag == "UNIMPORTANT" sbn.packageName == PackageName.SYSTEMUI && sbn.tag == "UNIMPORTANT"
} ?: false } ?: false
} }

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -114,7 +114,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
showDialog { showDialog {
title = "不支持的系统版本" title = "不支持的系统版本"
msg = (if (miSystemVersion.isNotBlank()) msg = (if (miSystemVersion.isNotBlank())
"此模块目前支持 MIUI 11~14 和 HyperOS 1.0~2.0 系统,你的系统版本为 $miSystemVersion,暂不支持。\n\n" + "此模块目前支持 MIUI 11~14 和 HyperOS 1.0 系统,你的系统版本为 $miSystemVersion,暂不支持。\n\n" +
"如果你的系统版本识别有误,请检查是否有相关插件修改了系统版本。\n\n" "如果你的系统版本识别有误,请检查是否有相关插件修改了系统版本。\n\n"
else "无法获取系统版本,请检查你是否修改了系统参数或使用非官方系统。\n\n") + "若有其它疑问,你可以点击下方按钮前往项目地址进行反馈。" else "无法获取系统版本,请检查你是否修改了系统参数或使用非官方系统。\n\n") + "若有其它疑问,你可以点击下方按钮前往项目地址进行反馈。"
confirmButton(text = "前往项目地址") { confirmButton(text = "前往项目地址") {
@@ -241,9 +241,6 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
binding.miuiNotifyIconReplacementSwitch.bind(ConfigData.ENABLE_REPLACE_MIUI_STYLE_NOTIFY_ICON) { binding.miuiNotifyIconReplacementSwitch.bind(ConfigData.ENABLE_REPLACE_MIUI_STYLE_NOTIFY_ICON) {
onChanged { SystemUITool.refreshSystemUI(context = this@MainActivity) } onChanged { SystemUITool.refreshSystemUI(context = this@MainActivity) }
} }
binding.miuiFocusNotifyIconFixSwitch.bind(ConfigData.ENABLE_FOCUS_NOTIFICATION_FIX) {
onChanged { SystemUITool.refreshSystemUI(context = this@MainActivity) }
}
binding.notifyIconForceSystemColorSwitch.bind(ConfigData.ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR) { binding.notifyIconForceSystemColorSwitch.bind(ConfigData.ENABLE_NOTIFY_ICON_FORCE_SYSTEM_COLOR) {
isAutoApplyChanges = false isAutoApplyChanges = false
onChanged { onChanged {

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -20,20 +20,20 @@
* *
* This file is created by fankes on 2022/1/30. * This file is created by fankes on 2022/1/30.
*/ */
@file:Suppress("UNCHECKED_CAST")
package com.fankes.miui.notify.ui.activity.base package com.fankes.miui.notify.ui.activity.base
import android.os.Build
import android.os.Bundle import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.res.ResourcesCompat import androidx.core.content.res.ResourcesCompat
import androidx.core.view.WindowCompat import androidx.core.view.WindowCompat
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
import com.fankes.miui.notify.R import com.fankes.miui.notify.R
import com.fankes.miui.notify.utils.factory.isNotSystemInDarkMode import com.fankes.miui.notify.utils.factory.isNotSystemInDarkMode
import com.highcapable.kavaref.KavaRef.Companion.resolve import com.highcapable.yukihookapi.hook.factory.current
import com.highcapable.kavaref.extension.genericSuperclassTypeArguments import com.highcapable.yukihookapi.hook.factory.method
import com.highcapable.kavaref.extension.toClassOrNull import com.highcapable.yukihookapi.hook.type.android.LayoutInflaterClass
abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() { abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
@@ -49,12 +49,10 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
isMainThreadRunning = true isMainThreadRunning = true
val bindingClass = javaClass.genericSuperclassTypeArguments().firstOrNull()?.toClassOrNull() binding = current().generic()?.argument()?.method {
binding = bindingClass?.resolve()?.optional()?.firstMethodOrNull {
name = "inflate" name = "inflate"
parameters(LayoutInflater::class) param(LayoutInflaterClass)
}?.invoke<VB>(layoutInflater) ?: error("binding failed") }?.get()?.invoke<VB>(layoutInflater) ?: error("binding failed")
if (Build.VERSION.SDK_INT >= 35) binding.root.fitsSystemWindows = true
setContentView(binding.root) setContentView(binding.root)
/** 隐藏系统的标题栏 */ /** 隐藏系统的标题栏 */
supportActionBar?.hide() supportActionBar?.hide()
@@ -63,7 +61,6 @@ abstract class BaseActivity<VB : ViewBinding> : AppCompatActivity() {
isAppearanceLightStatusBars = isNotSystemInDarkMode isAppearanceLightStatusBars = isNotSystemInDarkMode
isAppearanceLightNavigationBars = isNotSystemInDarkMode isAppearanceLightNavigationBars = isNotSystemInDarkMode
} }
@Suppress("DEPRECATION")
ResourcesCompat.getColor(resources, R.color.colorThemeBackground, null).also { ResourcesCompat.getColor(resources, R.color.colorThemeBackground, null).also {
window?.statusBarColor = it window?.statusBarColor = it
window?.navigationBarColor = it window?.navigationBarColor = it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -64,7 +64,6 @@ class BaseAdapterCreater(val context: Context) {
* 绑定 [BaseAdapter] 到 [ListView] * 绑定 [BaseAdapter] 到 [ListView]
* @param bindViews 回调 - ([VB] 每项,[Int] 下标) * @param bindViews 回调 - ([VB] 每项,[Int] 下标)
*/ */
@Suppress("DEPRECATION")
inline fun <reified VB : ViewBinding> onBindViews(crossinline bindViews: (binding: VB, position: Int) -> Unit) { inline fun <reified VB : ViewBinding> onBindViews(crossinline bindViews: (binding: VB, position: Int) -> Unit) {
baseAdapter = object : BaseAdapter() { baseAdapter = object : BaseAdapter() {
override fun getCount() = listDataCallback?.let { it() }?.size ?: 0 override fun getCount() = listDataCallback?.let { it() }?.size ?: 0

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -68,7 +68,6 @@ inline fun Context.showDialog(initiate: DialogBuilder<*>.() -> Unit) = DialogBui
* @param context 实例 * @param context 实例
* @param bindingClass [ViewBinding] 的 [Class] 实例 or null * @param bindingClass [ViewBinding] 的 [Class] 实例 or null
*/ */
@Suppress("DEPRECATION")
class DialogBuilder<VB : ViewBinding>(val context: Context, private val bindingClass: Class<*>? = null) { class DialogBuilder<VB : ViewBinding>(val context: Context, private val bindingClass: Class<*>? = null) {
/** 实例对象 */ /** 实例对象 */

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -63,8 +63,6 @@ import androidx.core.app.NotificationManagerCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.core.content.pm.PackageInfoCompat import androidx.core.content.pm.PackageInfoCompat
import androidx.core.content.res.ResourcesCompat import androidx.core.content.res.ResourcesCompat
import androidx.core.graphics.createBitmap
import androidx.core.net.toUri
import com.fankes.miui.notify.wrapper.BuildConfigWrapper import com.fankes.miui.notify.wrapper.BuildConfigWrapper
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
import com.highcapable.yukihookapi.hook.factory.hasClass import com.highcapable.yukihookapi.hook.factory.hasClass
@@ -150,7 +148,6 @@ val isNotMiSystem get() = !isMiSystem
* 当前设备是否是 MIUI 定制 Android 系统 * 当前设备是否是 MIUI 定制 Android 系统
* @return [Boolean] 是否符合条件 * @return [Boolean] 是否符合条件
*/ */
@Suppress("DEPRECATION")
val isMIUI by lazy { "android.miui.R".hasClass() } val isMIUI by lazy { "android.miui.R".hasClass() }
/** /**
@@ -178,7 +175,7 @@ inline val isNotMIOS get() = !isMIOS
val isSupportMiSystemVersion val isSupportMiSystemVersion
get() = when { get() = when {
isMIOS -> when (miosVersion) { isMIOS -> when (miosVersion) {
"1.0", "1.1", "2.0" , "3.0"-> true "1.0" -> true
else -> false else -> false
} }
isMIUI -> when (miuiVersion) { isMIUI -> when (miuiVersion) {
@@ -200,8 +197,6 @@ inline val isNotSupportMiSystemVersion get() = !isSupportMiSystemVersion
*/ */
val androidVersionCodeName val androidVersionCodeName
get() = when (Build.VERSION.SDK_INT) { get() = when (Build.VERSION.SDK_INT) {
36 -> "W"
35 -> "V"
34 -> "U" 34 -> "U"
33 -> "T" 33 -> "T"
32 -> "S_V2" 32 -> "S_V2"
@@ -545,7 +540,7 @@ val String.bitmap: Bitmap get() = unbase64.bitmap
* @return [Bitmap] 圆角后的位图 - 失败会返回处理之前的位图 * @return [Bitmap] 圆角后的位图 - 失败会返回处理之前的位图
*/ */
fun Bitmap.round(radius: Float): Bitmap = safeOf(default = this) { fun Bitmap.round(radius: Float): Bitmap = safeOf(default = this) {
createBitmap(width, height).also { out -> Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888).also { out ->
Canvas(out).also { canvas -> Canvas(out).also { canvas ->
Paint().also { paint -> Paint().also { paint ->
paint.isAntiAlias = true paint.isAntiAlias = true
@@ -565,7 +560,6 @@ fun Bitmap.round(radius: Float): Bitmap = safeOf(default = this) {
* @param default 默认值 * @param default 默认值
* @return [String] * @return [String]
*/ */
@Suppress("DEPRECATION")
fun findPropString(key: String, default: String = "") = safeOf(default) { fun findPropString(key: String, default: String = "") = safeOf(default) {
"android.os.SystemProperties".toClassOrNull()?.method { "android.os.SystemProperties".toClassOrNull()?.method {
name = "get" name = "get"
@@ -639,7 +633,7 @@ fun Context.openBrowser(url: String, packageName: String = "") = runCatching {
startActivity(Intent().apply { startActivity(Intent().apply {
if (packageName.isNotBlank()) setPackage(packageName) if (packageName.isNotBlank()) setPackage(packageName)
action = Intent.ACTION_VIEW action = Intent.ACTION_VIEW
data = url.toUri() data = Uri.parse(url)
/** 防止顶栈一样重叠在自己的 APP 中 */ /** 防止顶栈一样重叠在自己的 APP 中 */
flags = Intent.FLAG_ACTIVITY_NEW_TASK flags = Intent.FLAG_ACTIVITY_NEW_TASK
}) })

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -31,7 +31,6 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.drawable.Icon import android.graphics.drawable.Icon
import android.os.Build import android.os.Build
import android.os.Bundle
import androidx.core.graphics.drawable.toBitmap import androidx.core.graphics.drawable.toBitmap
import com.fankes.miui.notify.R import com.fankes.miui.notify.R
import com.fankes.miui.notify.utils.factory.appIconOf import com.fankes.miui.notify.utils.factory.appIconOf
@@ -69,9 +68,7 @@ object ActivationPromptTool {
setColor(0xFFE06818.toInt()) setColor(0xFFE06818.toInt())
setAutoCancel(true) setAutoCancel(true)
setSmallIcon(Icon.createWithResource(MODULE_PACKAGE_NAME, R.drawable.ic_notify_update)) setSmallIcon(Icon.createWithResource(MODULE_PACKAGE_NAME, R.drawable.ic_notify_update))
setExtras(Bundle().apply { setLargeIcon(context.appIconOf(packageName)?.toBitmap())
putParcelable("miui.appIcon", Icon.createWithBitmap(context.appIconOf(MODULE_PACKAGE_NAME)?.toBitmap()))
})
setContentIntent( setContentIntent(
PendingIntent.getActivity( PendingIntent.getActivity(
context, packageName.hashCode(), context, packageName.hashCode(),

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -32,7 +32,6 @@ import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.graphics.drawable.VectorDrawable import android.graphics.drawable.VectorDrawable
import android.util.ArrayMap import android.util.ArrayMap
import androidx.core.graphics.createBitmap
import androidx.core.graphics.drawable.toBitmap import androidx.core.graphics.drawable.toBitmap
import com.fankes.miui.notify.utils.factory.safeOfFalse import com.fankes.miui.notify.utils.factory.safeOfFalse
import kotlin.math.abs import kotlin.math.abs
@@ -78,7 +77,7 @@ object BitmapCompatTool {
var width = bitmap.width var width = bitmap.width
if (height > 64 || width > 64) { if (height > 64 || width > 64) {
if (tempCompactBitmap == null) { if (tempCompactBitmap == null) {
tempCompactBitmap = createBitmap(64, 64) tempCompactBitmap = Bitmap.createBitmap(64, 64, Bitmap.Config.ARGB_8888)
.also { tempCompactBitmapCanvas = Canvas(it) } .also { tempCompactBitmapCanvas = Canvas(it) }
tempCompactBitmapPaint = Paint(Paint.FILTER_BITMAP_FLAG).apply { isFilterBitmap = true } tempCompactBitmapPaint = Paint(Paint.FILTER_BITMAP_FLAG).apply { isFilterBitmap = true }
} }
@@ -92,12 +91,11 @@ object BitmapCompatTool {
val size = height * width val size = height * width
ensureBufferSize(size) ensureBufferSize(size)
tempCompactBitmap?.getPixels(tempBuffer, 0, width, 0, 0, width, height) tempCompactBitmap?.getPixels(tempBuffer, 0, width, 0, 0, width, height)
for (i in 0 until size) { for (i in 0 until size)
if (isGrayscaleColor(tempBuffer[i]).not()) { if (isGrayscaleColor(tempBuffer[i]).not()) {
cachedBitmapGrayscales[bitmap.generationId] = false cachedBitmapGrayscales[bitmap.generationId] = false
return@let false return@let false
} }
}
cachedBitmapGrayscales[bitmap.generationId] = true cachedBitmapGrayscales[bitmap.generationId] = true
true true
} }

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -31,7 +31,6 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.graphics.drawable.Icon import android.graphics.drawable.Icon
import android.os.Build import android.os.Build
import android.os.Bundle
import androidx.core.graphics.drawable.toBitmap import androidx.core.graphics.drawable.toBitmap
import com.fankes.miui.notify.R import com.fankes.miui.notify.R
import com.fankes.miui.notify.hook.HookEntry import com.fankes.miui.notify.hook.HookEntry
@@ -81,9 +80,7 @@ object IconAdaptationTool {
setColor(0xFF2993F0.toInt()) setColor(0xFF2993F0.toInt())
setAutoCancel(true) setAutoCancel(true)
setSmallIcon(Icon.createWithResource(MODULE_PACKAGE_NAME, R.drawable.ic_unsupported)) setSmallIcon(Icon.createWithResource(MODULE_PACKAGE_NAME, R.drawable.ic_unsupported))
setExtras(Bundle().apply { setLargeIcon(context.appIconOf(packageName)?.toBitmap())
putParcelable("miui.appIcon", Icon.createWithBitmap(context.appIconOf(MODULE_PACKAGE_NAME)?.toBitmap()))
})
setContentIntent( setContentIntent(
PendingIntent.getActivity( PendingIntent.getActivity(
context, packageName.hashCode(), context, packageName.hashCode(),

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it
@@ -83,7 +83,7 @@ object IconRuleManagerTool {
private const val SYNC_DIRECT_URL = "https://raw.githubusercontent.com/fankes/AndroidNotifyIconAdapt/main" private const val SYNC_DIRECT_URL = "https://raw.githubusercontent.com/fankes/AndroidNotifyIconAdapt/main"
/** 同步地址 - GitHub Raw (代理 - GitHub Proxy) */ /** 同步地址 - GitHub Raw (代理 - GitHub Proxy) */
private const val SYNC_PROXY_1_URL = "https://ghp.ci/$SYNC_DIRECT_URL" private const val SYNC_PROXY_1_URL = "https://ghproxy.com/$SYNC_DIRECT_URL"
/** 同步地址 - GitHub Raw (代理 - 7ED Services) */ /** 同步地址 - GitHub Raw (代理 - 7ED Services) */
private const val SYNC_PROXY_2_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main" private const val SYNC_PROXY_2_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main"
@@ -248,7 +248,7 @@ object IconRuleManagerTool {
notifyRefresh(context) notifyRefresh(context)
callback() callback()
} }
else -> (if (context is AppCompatActivity) context.snake(msg = "列表数据已是最新") else Unit) else -> (if (context is AppCompatActivity) context.snake(msg = "列表数据已是最新"))
} }
} }
context is AppCompatActivity -> context is AppCompatActivity ->
@@ -298,7 +298,7 @@ object IconRuleManagerTool {
notifyRefresh(context) notifyRefresh(context)
callback() callback()
} }
else -> (if (context is AppCompatActivity) context.snake(msg = "列表数据已是最新") else Unit) else -> (if (context is AppCompatActivity) context.snake(msg = "列表数据已是最新"))
} }
context is AppCompatActivity -> context is AppCompatActivity ->
context.showDialog { context.showDialog {

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1,6 +1,6 @@
/* /*
* MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team. * MIUINativeNotifyIcon - Fix the native notification bar icon function abandoned by the MIUI development team.
* Copyright (C) 2017 Fankes Studio(qzmmcn@163.com) * Copyright (C) 2017-2023 Fankes Studio(qzmmcn@163.com)
* https://github.com/fankes/MIUINativeNotifyIcon * https://github.com/fankes/MIUINativeNotifyIcon
* *
* This software is non-free but opensource software: you can redistribute it * This software is non-free but opensource software: you can redistribute it

View File

@@ -1105,34 +1105,6 @@
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/miui_focus_notify_icon_fix_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.fankes.miui.notify.ui.widget.MaterialSwitch
android:id="@+id/miui_focus_notify_icon_fix_switch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="是否强制启用焦点通知反色"
android:textColor="@color/colorTextGray"
android:textSize="15sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="0.6"
android:lineSpacingExtra="6dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="是否强制启用焦点通知反色,由于无法准确判断反色,所以给了个强制开关。(默认关闭)"
android:textColor="@color/colorTextDark"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/notify_icon_fix_notify_item" android:id="@+id/notify_icon_fix_notify_item"
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -1485,35 +1457,6 @@
android:textColor="@color/colorTextGray" android:textColor="@color/colorTextGray"
android:textSize="11sp" /> android:textSize="11sp" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_permotion_round"
android:gravity="center|start"
android:orientation="horizontal"
android:padding="10dp">
<ImageView
android:layout_width="35dp"
android:layout_height="35dp"
android:layout_marginEnd="10dp"
android:src="@mipmap/ic_kavaref" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:ellipsize="end"
android:lineSpacingExtra="6dp"
android:maxLines="2"
android:text="此模块使用 KavaRef 强力驱动。\n了解更多 https://github.com/HighCapable/KavaRef"
android:textColor="@color/colorTextGray"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
</LinearLayout> </LinearLayout>

View File

@@ -2,5 +2,4 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> <adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/> <background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/> <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon> </adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -1,21 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins { plugins {
autowire(libs.plugins.android.application) apply false autowire(libs.plugins.android.application) apply false
autowire(libs.plugins.kotlin.android) apply false autowire(libs.plugins.kotlin.android) apply false
autowire(libs.plugins.kotlin.ksp) apply false autowire(libs.plugins.kotlin.ksp) apply false
} }
allprojects {
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_17
freeCompilerArgs.addAll(
"-Xno-param-assertions",
"-Xno-call-assertions",
"-Xno-receiver-assertions"
)
}
}
}

View File

@@ -3,11 +3,12 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true android.useAndroidX=true
android.nonTransitiveRClass=true android.nonTransitiveRClass=true
kotlin.code.style=official kotlin.code.style=official
kotlin.incremental.useClasspathSnapshot=true
# Project Configuration # Project Configuration
project.name=MIUINativeNotifyIcon project.name=MIUINativeNotifyIcon
project.android.compileSdk=36 project.android.compileSdk=34
project.android.minSdk=28 project.android.minSdk=28
project.android.targetSdk=36 project.android.targetSdk=34
project.app.packageName=com.fankes.miui.notify project.app.packageName=com.fankes.miui.notify
project.app.versionName="2.110" project.app.versionName="2.110"
project.app.versionCode=42 project.app.versionCode=42

View File

@@ -22,18 +22,18 @@ repositories:
plugins: plugins:
com.android.application: com.android.application:
alias: android-application alias: android-application
version: 8.13.0 version: 8.1.2
org.jetbrains.kotlin.android: org.jetbrains.kotlin.android:
alias: kotlin-android alias: kotlin-android
version: 2.2.10 version: 1.9.10
com.google.devtools.ksp: com.google.devtools.ksp:
alias: kotlin-ksp alias: kotlin-ksp
version: 2.2.10-2.0.2 version: 1.9.10-1.0.13
libraries: libraries:
com.fankes.projectpromote: com.fankes.projectpromote:
project-promote: project-promote:
version: 1.0.1 version: 1.0.0
repositories: repositories:
fankes-maven-releases fankes-maven-releases
de.robv.android.xposed: de.robv.android.xposed:
@@ -43,42 +43,36 @@ libraries:
rovo89-xposed-api rovo89-xposed-api
com.highcapable.yukihookapi: com.highcapable.yukihookapi:
api: api:
version: 1.3.0 version: 1.2.0
ksp-xposed: ksp-xposed:
version-ref: <this>::api version-ref: <this>::api
com.highcapable.kavaref:
kavaref-core:
version: 1.0.1
kavaref-extension:
version: 1.0.1
com.github.topjohnwu.libsu: com.github.topjohnwu.libsu:
core: core:
version: 5.2.2 version: 5.2.1
auto-update: false
com.github.duanhong169: com.github.duanhong169:
drawabletoolbox: drawabletoolbox:
version: 1.0.7 version: 1.0.7
com.squareup.okhttp3: com.squareup.okhttp3:
okhttp: okhttp:
version: 5.1.0 version: 5.0.0-alpha.11
androidx.core: androidx.core:
core-ktx: core-ktx:
version: 1.17.0 version: 1.12.0
androidx.appcompat: androidx.appcompat:
appcompat: appcompat:
version: 1.7.1 version: 1.6.1
com.google.android.material: com.google.android.material:
material: material:
version: 1.13.0 version: 1.10.0
androidx.constraintlayout: androidx.constraintlayout:
constraintlayout: constraintlayout:
version: 2.2.1 version: 2.1.4
androidx.test.ext: androidx.test.ext:
junit: junit:
version: 1.3.0 version: 1.1.5
androidx.test.espresso: androidx.test.espresso:
espresso-core: espresso-core:
version: 3.7.0 version: 3.5.1
junit: junit:
junit: junit:
version: 4.13.2 version: 4.13.2

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -6,8 +6,8 @@ pluginManagement {
} }
} }
plugins { plugins {
id("com.highcapable.sweetdependency") version "1.0.4" id("com.highcapable.sweetdependency") version "1.0.2"
id("com.highcapable.sweetproperty") version "1.0.8" id("com.highcapable.sweetproperty") version "1.0.3"
} }
sweetProperty { sweetProperty {
global { global {
@@ -15,11 +15,7 @@ sweetProperty {
permanentKeyValues("GITHUB_CI_COMMIT_ID" to "") permanentKeyValues("GITHUB_CI_COMMIT_ID" to "")
generateFrom(ROOT_PROJECT, SYSTEM_ENV) generateFrom(ROOT_PROJECT, SYSTEM_ENV)
} }
sourcesCode { sourcesCode { includeKeys("GITHUB_CI_COMMIT_ID") }
includeKeys("GITHUB_CI_COMMIT_ID")
// 关闭类型自动转换功能,防止一些特殊 "COMMIT ID" 被生成为数值
isEnableTypeAutoConversion = false
}
} }
rootProject { all { isEnable = false } } rootProject { all { isEnable = false } }
} }