ShizuStore

Blocker

lihenggui

2.0.5839 · GitHub

Download APK
Software management Android 6.0+ 6 months ago Apache-2.0
110 ShizuStore
62k GitHub
2.4k Stars
9 MB Size
Detected trackers (2)
Google CrashLytics Crash reporting
Google Firebase Analytics Analytics

Matched by Exodus Privacy code signatures. Not a complete list.

More about this app

Enable/disable Android components such as activities, services, receivers, and providers

中文README

Blocker

release download translation follow license

Blocker is a component controller for Android applications that currently supports using PackageManager and Intent Firewall to manage the state of components. For bloated applications, many components within the application are redundant. Blocker provides a convenient control button to manage the corresponding components, enabling the disabling of unnecessary functions and saving application runtime resources.
Blocker can be seamlessly switched between these controllers, and for application rules, you can export and import them. Additionally, it is compatible with backup files generated by MyAndroidTools, and you can effortlessly convert them to Intent Firewall rules. The application also has the potential to be extended in the future.

Get it on F-Droid Get it on Google Play

Advantages

  1. Lightweight, don't burden the system
  2. Easy to use
  3. Supports multiple control types

Introduction to different component controllers

Package Manager

The Android system provides a tool called PackageManager, which is used for managing installed applications or obtaining information about them. One of its methods, setComponentEnabledSetting(ComponentName, int, int), allows an application to control the state of its own components. If attempting to use this method to control components in other applications, a signature permission is required, or the call will fail.
Fortunately, Android provides another tool called pm that allows users to control component states in command-line mode. However, the pm tool requires root permission to run. The following command can be used to disable a specific package or component:

pm disable [PackageName/ComponentName]

Whether using PackageManager in the code or pm in command-line mode, the configurations will be written to /data/system/users/0/package_restrictions.xml.

Intent Firewall Mode

Intent Firewall was introduced in Android 4.4.2 (API 19) and is still effective in the latest Android systems. It is integrated into the Android Framework to filter the intents sent by applications or systems.

What Intent Firewall can do

Each intent sent by an application is filtered by the Intent Firewall, with rules stored in XML files. The Intent Firewall updates rules immediately if changes occur in the configuration file.

Limitations of Intent Firewall

Only system applications can read and write the directory where the configuration file is stored, and third-party applications do not have permission to access it.

Differences between Intent Firewall and Package Manager

Intent Firewall, indeed it is a firewall, it has no impact on component status. The application detects the component is on, but it just cannot start the component.

For the components disabled by PackageManager, if an application starts it, an exception will be thrown. Developers can catch this exception to know whether the component is disabled or not, so they could re-enable this component. That's the reason why the components will be enabled unexpectedly. If you are using an Intent Firewall controller, there will be no problems.

References

Intent Firewall

Shizuku/Sui Mode

Shizuku is an application developed by Rikka, RikkaApps/Shizuku

Starting from Android O, if we install a Test-Only application, users could use pm command to control the command status. We could modify the install package to set it into Test-Only mode, using APIs provided by Shizuku to control the component status.

Tutorial for modifying APKs (Chinese Only) [实验性功能] [开发者向]如何免Root控制应用程序组件

Please note: For normal applications, the Shell permission in Shizuku mode is not sufficient to change the switch status of components. In other words, unmodified APKs do not support non-root modification. If you want to use Shizuku to modify the component status of normal applications, please start Shizuku with Root privileges.
Implementation of this restriction in AOSP: frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java

Screenshot tests

Blocker uses Roborazzi to do screenshot tests of certain screens and components. To run these tests, run the verifyRoborazziFossDebug or recordRoborazziFossDebug tasks. Note that screenshots are recorded on CI, using Linux, and other platforms might generate slightly different images, making the tests fail.

Architecture

The architecture of the Blocker app is based on the architecture described in Now in Android, and it also adheres to the official architecture guidance.
For information on modularization, please refer to this article: Modularization Learning Journey.

UI

The app was designed using Material 3 guidelines. Learn more about the design process and obtain the design files in Figma. Huge thanks to our UI designer: @COPtimer
The Screens and UI elements are built entirely using Jetpack Compose.

The app has two themes:

  • Dynamic color - uses colors based on the user's current color theme (if supported)
  • Default theme - uses predefined colors when dynamic color is not supported

Each theme also supports dark mode.

Translation Contributions

Default string resources for the Blocker app are located here:

app-compose/src/main/res/values/strings.xml
core/[module]/src/main/res/values/strings.xml
sync/[module]/src/main/res/values/strings.xml
feature/[module]/src/main/res/values/strings.xml

Translate each and place them in the respective locations ([module]/src/main/res/values-[lang]/strings.xml).

Alternatively, you can use Weblate to translate this project. (Thanks @SanmerDev for providing the service)

Frequently Asked Questions

  1. When clicking the button in Shizuku mode, the component state cannot be controlled, and an error pops up: SecurityException: Shell cannot change component state for 'xx' to state 'xx'.
  • The Shell permission of Shizuku cannot disable unmodified application components. Please restart Shizuku with Root privileges or try modifying the APK.
  1. What's the difference between the foss version and the market version?
  • You can view the detailed changes in #619 Build & Check F-Droid version. The foss version eliminates closed-source libraries such as Firebase and GMS. Conversely, the market version integrates Firebase Crashlytics and Firebase Analytics services, enabling the developer to receive crash reports and usage data. This feedback makes it easier for developers to address issues or adjust features based on their usage. The version available on Google Play is the market version. If you prefer not to use analytics services, you can download the foss version from the GitHub release page or F-Droid.
Close

How Shizuku is used

Can enable or disable apps and components, clear cache and data, uninstall, force stop and manage services via `IPackageManager` and `IActivityManager` through Shizuku.

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

Through Shizuku, Blocker applies system level app and component changes that normal app permissions cannot perform.

  • Toggle app components: turn activities, services, receivers and providers on or off from detail and search screens using system package controls through Shizuku.
  • Enable or disable apps: turn whole apps on or off from the app list using system package controls through Shizuku.
  • Clear cache and data: wipe the cache or user data for a selected app using system package controls through Shizuku.
  • Uninstall apps: remove selected user or system apps using the system package installer through Shizuku.
  • Force stop apps: immediately stop a selected app using system activity controls through Shizuku.
  • See running apps: show which apps are currently running by reading the running process list through Shizuku.
  • Manage running services: show running services and start or stop a selected service using system activity controls through Shizuku.

Android APIs or commands used

  • IPackageManager.setComponentEnabledSetting
  • IPackageManager.setApplicationEnabledSetting
  • IPackageManager.deleteApplicationCacheFiles
  • IPackageManager.clearApplicationUserData
  • IPackageInstaller.uninstall
  • IActivityManager.forceStopPackage
  • IActivityManager.getRunningAppProcesses
  • IActivityManager.getServices
  • IActivityManager.startService
  • IActivityManager.stopService

Notable details

When clearing cache or data while Shizuku is running with shell identity, Blocker opens the system app details screen for that app instead of clearing directly, so the user completes the action there.

Close

Changelog

What's new for version 2.0.5839

What's Changed

Full Changelog: https://github.com/lihenggui/blocker/compare/v2.0.5753...v2.0.5839

Close

Permissions

15 permissions requested

  • android.permission.INTERNET
  • android.permission.FOREGROUND_SERVICE
  • android.permission.POST_NOTIFICATIONS
  • android.permission.FOREGROUND_SERVICE_DATA_SYNC
  • android.permission.ACCESS_NETWORK_STATE
  • moe.shizuku.manager.permission.API_V23
  • moe.shizuku.manager.permission.API
  • android.permission.QUERY_ALL_PACKAGES
  • android.permission.WAKE_LOCK
  • com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE
  • com.google.android.gms.permission.AD_ID
  • android.permission.ACCESS_ADSERVICES_ATTRIBUTION
  • android.permission.ACCESS_ADSERVICES_AD_ID
  • android.permission.RECEIVE_BOOT_COMPLETED
  • com.merxury.blocker.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
Close

Sources

3 sources

2.0.5839 Universal GitHub · com.merxury.blocker
Selected Download
2.0.6339 arm64-v8a,armeabi-v7a,x86,x86_64 F-Droid · com.merxury.blocker · com.merxury.blocker
Download
2.0.6339 F-Droid · com.merxury.blocker · com.merxury.blocker
Download