Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

Shevery:现代 Android 资源管理器的技术分析

项目背景与痛点

在移动设备日益普及的今天,高效的资源管理工具对用户来说至关重要。Shevery 通过结合最新的 Jetpack Compose,Material 3 兼容性增强等功能,为用户提供了流畅且美观的使用体验。特别是在 Jetpack Compose 逐步取代传统 View 系统的趋势下,Shevery 成为了一个关键的转型工具。通过集成当前的最佳开发实践,Shevery 不仅提供了功能上的满足,还为开发者探索新技术提供了平台。

核心技术揭秘

技术栈

Shevery 采用了 Jetpack Compose、Material 3 以及一系列现代化的 Android 开发库。它设计了一个现代化、响应式的 UI 层,通过可组合的界面组件实现更加灵活的应用开发结构。

技术架构图
graph TD A[用户交互] --> B{"系统拦截"} B -->|"导航操作"| C[Jetpack Compose渲染器] C --> D[Material 3组件] B -->|"系统配置"| E[兼容层] F[SQLite数据库] --> G[数据管理] H[文件管理模块] --> I[资源索引] B -->|"文件操作"| H C --> J[资源展示] G --> K[数据流] K --> L[异步数据请求] L --> F

设计模式与数据流

Shevery 主要采用了 MVVM 模式进行架构设计。整体的数据流始于用户交互,通过 Jetpack Compose 进行高效渲染,并结合 Material 3 提供视觉上的现代化升级。底层的数据管理模块通过 SQLite 数据库确保了数据的可靠性和持久存储,而文件管理模块则处理所有文件相关的功能,确保应用的文件操作能力显著增强。

功能亮点与差异

Shevery 除了提供现代化的 UI 体验之外,其最大的亮点在于优化的文件管理功能和兼容性提升。Jetpack Compose 的引入让 Shevery 在动画和界面动态效果上突破传统,提供更加流畅的操作体验。同时,与 Material 3 的深度结合为用户带来了符合当前设计趋势的视觉效果。

相比于同类竞品,Shevery 尤其在性能优化和文件搜索功能上下了极大功夫,使其在日常使用中更具优势。这不仅适合日常用户使用,还为开发者提供了丰富的插件扩展接口,以支持更多自定义场景。

应用场景与落地建议

对于希望使用最新 UI 框架的 Android 开发者来说,Shevery 无疑是一个理想的选择。此外,该应用在处理大型文件系统的管理问题上也非常高效,非常适合那些需要强大文件操作能力的复杂应用。

但在生产环境中,开发者需要注意以下几点:

  1. 数据库优化:由于 SQLite 的嵌套操作可能会影响整体性能,请确保复杂查询得到了充分优化。
  2. 同步机制:在异步数据请求的过程中,务必保证数据的一致性和有效性以避免数据丢失或破坏。
  3. 兼容性:虽然 Shevery 通过 Material 3 提升了兼容性,但仍需在不同 Android 版本中进行测试以确保稳定。

综合评价

优势

  • 现代化 UI:结合 Jetpack Compose 和 Material 3 提供了卓越的视觉体验。
  • 性能与可靠性:基于 SQLite 的数据存储和文件管理功能高效且可靠。
  • 插件扩展性:提供丰富的自定义接口,支持开发者构建更多的插件扩展。

局限

  • 优化空间:在大型文件系统和复杂查询场景下,数据同步和操作稳定性的优化仍有提升空间。
  • 分层复杂性:MVVM 架构和 Jetpack Compose 的集成虽然强大,但初学者可能需要更多适应时间。

总体而言,Shevery 作为一款现代化的 Android 资源管理工具,在许多关键功能上都达到了行业领先水平。尤其对于希望探索最新 Android 开发趋势的开发者,它无疑是一个值得一试的好工具。

关于

GitHub 原始描述(英文)

Shevery - Modernized Android manager with Jetpack Compose, Material 3, and compatibility enhancements.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
1746
价值分
989
活跃状态
活跃

语言占比

AIDL
C
C++
CMake
CSS
Java
JavaScript
Kotlin
Shell
TypeScript

README

Shevery

Stars Forks Downloads Build Android APK Telegram

English | Русский | Қазақша | Qazaqşa (Latın) | Português | Español | العربية | 简体中文 | 日本語

Fork status

[!IMPORTANT] Side-by-Side Installation Supported: Thanks to its independent package ID (com.hamondev.shevery) and isolated permission namespace, you can now install Shevery directly alongside other Shizuku implementations without uninstalling them first. For legacy apps that explicitly check for moe.shizuku.privileged.api, you can optionally enable Compatibility Stubs in Settings once original Shizuku is removed. Upstream project reference: https://github.com/RikkaApps/Shizuku

Fork additions

  • Jetpack Compose manager UI with Material 3 Expressive components, motion, switches, and rounded icon treatment.
  • Device Owner Management & Integration: Full Device Owner management (app delegation scopes, ownership transfer, DPM-assisted ADB) inspired by and compatible with Dhizuku.
  • Biometric Security & Protection: Master switch to require biometric or device PIN/pattern/password authentication with configurable timeouts and granular action protection.
  • Dhizuku Experimental Support: Dedicated Device-Owner bridging system available inside Laboratory features.
  • Better shell/adb based “Comput” feature with Gemini Explaination, Macros and Commandium AI Command create.
  • Android 16/17 target work with current SDK/build tooling in this fork.
  • ADB Modules screen for installing and managing ZIP modules.
  • Module features: module.prop, banner, enable/disable switch, action.sh, policy-gated service.sh, local WebUI, delete, path checks, size limits, output limits, and last-run logs.
  • Module policy settings: Safe mode, Full access, and background action control.
  • Module Catalog with direct install.

Documentation

Background

When developing apps that requires root, the most common method is to run some commands in the su shell. For example, there is an app that uses the pm enable/disable command to enable/disable components.

This method has very big disadvantages:

  1. Extremely slow (Multiple process creation)
  2. Needs to process texts (Super unreliable)
  3. The possibility is limited to available commands
  4. Even if ADB has sufficient permissions, the app requires root privileges to run

Shizuku uses a completely different way. See detailed description below.

User guide & Download

https://shizuku.rikka.app/

Screenshots

Click to open Screenshots

Main Screen

Comput Console

ADB Modules

Settings

How does Shevery works?

First, we need to talk about how app use system APIs. For example, if the app wants to get installed apps, we all know we should use PackageManager#getInstalledPackages(). This is actually an interprocess communication (IPC) process of the app process and system server process, just the Android framework did the inner works for us.

Android uses binder to do this type of IPC. Binder allows the server-side to learn the uid and pid of the client-side, so that the system server can check if the app has the permission to do the operation.

Usually, if there is a “manager” (e.g., PackageManager) for apps to use, there should be a “service” (e.g., PackageManagerService) in the system server process. We can simply think if the app holds the binder of the “service”, it can communicate with the “service”. The app process will receive binders of system services on start.

Shizuku guides users to run a process, Shizuku server, with root or ADB first. When the app starts, the binder to Shizuku server will also be sent to the app.

The most important feature Shevery provides is something like be a middle man to receive requests from the app, sent them to the system server, and send back the results. You can see the transactRemote method in rikka.shizuku.server.ShizukuService class, and moe.shizuku.api.ShizukuBinderWrapper class for the detail.

So, we reached our goal, to use system APIs with higher permission. And to the app, it is almost identical to the use of system APIs directly.

Developer guide

API & sample

https://github.com/RikkaApps/Shizuku-API

Migrating from pre-v11

Existing applications still works, of course.

https://github.com/RikkaApps/Shizuku-API#migration-guide-for-existing-applications-use-shizuku-pre-v11

Attention

  1. ADB permissions are limited

    ADB has limited permissions and different on various system versions. You can see permissions granted to ADB here.

    Before calling the API, you can use ShizukuService#getUid to check if Shizuku is running user ADB, or use ShizukuService#checkPermission to check if the server has sufficient permissions.

  2. Hidden API limitation from Android 9

    As of Android 9, the usage of the hidden APIs is limited for normal apps. Please use other methods (such as https://github.com/LSPosed/AndroidHiddenApiBypass).

  3. Android 8.0 & ADB

    At present, the way Shizuku service gets the app process is to combine IActivityManager#registerProcessObserver and IActivityManager#registerUidObserver (26+) to ensure that the app process will be sent when the app starts. However, on API 26, ADB lacks permissions to use registerUidObserver, so if you need to use Shizuku in a process that might not be started by an Activity, it is recommended to trigger the send binder by starting a transparent activity.

  4. Direct use of transactRemote requires attention

    • The API may be different under different Android versions, please be sure to check it carefully. Also, the android.app.IActivityManager has the aidl form in API 26 and later, and android.app.IActivityManager$Stub exists only on API 26.

    • SystemServiceHelper.getTransactionCode may not get the correct transaction code, such as android.content.pm.IPackageManager$Stub.TRANSACTION_getInstalledPackages does not exist on API 25 and there is android.content.pm.IPackageManager$Stub.TRANSACTION_getInstalledPackages_47 (this situation has been dealt with, but it is not excluded that there may be other circumstances). This problem is not encountered with the ShizukuBinderWrapper method.

Developing Shizuku itself

Build

  • Clone with git clone --recurse-submodules
  • Run gradle task :manager:assembleDebug or :manager:assembleRelease

The :manager:assembleDebug task generates a debuggable server. You can attach a debugger to shizuku_server to debug the server. Be aware that, in Android Studio, “Run/Debug configurations” - “Always install with package manager” should be checked, so that the server will use the latest code.

CI builds

Every push to main, dev and nightly, and every pull request, runs the Build Android APK workflow. Each run always uploads both artifacts — there is no debug-or-release choice:

Artifact Gradle task Description
shevery-debug :manager:assembleDebug Debuggable APK for testing; the server can be debugged with an attached debugger
shevery-release :manager:assembleRelease Release APK, signed with the release keystore when the secrets are configured, otherwise it falls back to debug signing

The release artifact is signature-verified with apksigner in every run. Fork pull requests build both variants with a generated keystore, so untrusted code never touches the release signing key.

How “Start(via Dhizuku)” works?

  • First, you need to start Shevery by PC/OTG or Wireless Debugging.
  • Next, start Dhizuku.
    • Do not start Shevery via Dhizuku first.

License

All code files in this project are licensed under Apache 2.0

Credits

And…

Now, you can publish your ADB module! Follow this steps:

  • Create your module.
  • Create GH Repository for this module.
  • Add topic “shevery-modules”
  • Add sources and Release with module.
Caution 注意

Free App Notice

Shevery is a completely free app. Do not pay any third-party file managers or cloud services to download this application.

For fresh builds/CI of Shevery, go to Actions — every run attaches both a shevery-debug and a shevery-release APK artifact. But this APKs are unstable and can contain some bugs. If you found bugs on latest CI, you can report about it in Issues.

评论

暂无评论