anubis-android-app-manager
Android app manager with VPN integration that freezes/unfreezes app groups based on VPN connection state using Shizuku's pm disable-user
What this skill does
# Anubis Android App Manager
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
Anubis is an Android app manager that uses Shizuku to completely disable (`pm disable-user`) app groups based on VPN connection state. Unlike sandboxing solutions (Island, Shelter), disabled apps cannot run code, access network interfaces, or detect VPN presence at all.
## Core Concepts
| Group Policy | Behavior |
|---|---|
| **Local** | Frozen when VPN is active; runs without VPN |
| **VPN Only** | Frozen when VPN is inactive; runs through VPN |
| **Launch with VPN** | Never frozen; launching triggers VPN activation |
## Requirements
- Android 10+ (API 29)
- [Shizuku](https://shizuku.rikka.app/) installed and running
- At least one VPN client installed
## Setup
1. Install and start Shizuku (via ADB or Wireless Debugging):
```bash
adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/start.sh
```
2. Install Anubis APK
3. Grant Shizuku permission when prompted
4. Grant VPN permission when prompted (needed for dummy VPN disconnect)
5. Go to **Apps** tab → assign apps to groups
6. Select VPN client in **Settings**
7. Toggle stealth mode on **Home** screen
## Building
```bash
git clone https://github.com/sogonov/anubis
cd anubis
# Debug build
./gradlew assembleDebug
# Release build (requires signing config)
./gradlew assembleRelease
```
Create `signing.properties` in project root for release builds:
```properties
storeFile=release.keystore
storePassword=${KEYSTORE_PASSWORD}
keyAlias=${KEY_ALIAS}
keyPassword=${KEY_PASSWORD}
```
## Tech Stack
- Kotlin + Jetpack Compose (Material 3)
- Shizuku API 13.1.5 (AIDL UserService pattern)
- Room database with TypeConverters for app groups
- `ConnectivityManager` NetworkCallback for VPN state monitoring
- `ShortcutManager` for pinned shortcuts
## Project Structure
```
app/src/main/java/
├── data/
│ ├── AppGroup.kt # Room entity: group name, policy, package list
│ ├── AppGroupDao.kt # DAO: CRUD for app groups
│ └── AppDatabase.kt # Room database setup
├── service/
│ ├── ShizukuService.kt # AIDL UserService: pm/am shell commands
│ ├── VpnStateMonitor.kt # ConnectivityManager NetworkCallback
│ └── FreezeManager.kt # Orchestrates freeze/unfreeze logic
├── vpn/
│ ├── VpnClient.kt # Enum: SEPARATE, TOGGLE, MANUAL
│ └── VpnClientRegistry.kt # Known clients + custom client support
└── ui/
├── HomeScreen.kt # Launcher grid, VPN toggle
├── AppsScreen.kt # Group assignment UI
└── SettingsScreen.kt # VPN client selection
```
## Room Database: App Groups
```kotlin
@Entity(tableName = "app_groups")
data class AppGroup(
@PrimaryKey(autoGenerate = true) val id: Int = 0,
val name: String,
val policy: GroupPolicy,
val packages: List<String> // stored via TypeConverter
)
enum class GroupPolicy {
LOCAL, // frozen when VPN active
VPN_ONLY, // frozen when VPN inactive
LAUNCH_WITH_VPN // never frozen, VPN triggered on launch
}
```
```kotlin
@Dao
interface AppGroupDao {
@Query("SELECT * FROM app_groups")
fun getAllGroups(): Flow<List<AppGroup>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertGroup(group: AppGroup)
@Delete
suspend fun deleteGroup(group: AppGroup)
@Update
suspend fun updateGroup(group: AppGroup)
}
```
## Shizuku Integration (AIDL UserService Pattern)
Define the AIDL interface:
```kotlin
// IShizukuService.aidl
interface IShizukuService {
String executeCommand(String command);
void destroy();
}
```
Implement the UserService:
```kotlin
class ShizukuUserService : IShizukuService.Stub() {
override fun executeCommand(command: String): String {
return try {
val process = Runtime.getRuntime().exec(arrayOf("sh", "-c", command))
process.inputStream.bufferedReader().readText()
} catch (e: Exception) {
"ERROR: ${e.message}"
}
}
override fun destroy() {
exitProcess(0)
}
}
```
Bind to the UserService:
```kotlin
class FreezeManager(private val context: Context) {
private var service: IShizukuService? = null
private val serviceConnection = object : ServiceConnection {
override fun onServiceConnected(name: ComponentName, binder: IBinder) {
service = IShizukuService.Stub.asInterface(binder)
}
override fun onServiceDisconnected(name: ComponentName) {
service = null
}
}
private val userServiceArgs = Shizuku.UserServiceArgs(
ComponentName(context, ShizukuUserService::class.java)
).processNameSuffix("service").debuggable(false).version(1)
fun bindService() {
if (Shizuku.checkSelfPermission() == PackageManager.PERMISSION_GRANTED) {
Shizuku.bindUserService(userServiceArgs, serviceConnection)
}
}
fun unbindService() {
Shizuku.unbindUserService(userServiceArgs, serviceConnection, true)
}
suspend fun freezePackage(packageName: String) {
service?.executeCommand("pm disable-user --user 0 $packageName")
}
suspend fun unfreezePackage(packageName: String) {
service?.executeCommand("pm enable --user 0 $packageName")
}
}
```
## VPN State Monitoring
```kotlin
class VpnStateMonitor(private val context: Context) {
private val connectivityManager =
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
private val _isVpnActive = MutableStateFlow(false)
val isVpnActive: StateFlow<Boolean> = _isVpnActive.asStateFlow()
private val networkCallback = object : ConnectivityManager.NetworkCallback() {
override fun onAvailable(network: Network) {
val capabilities = connectivityManager.getNetworkCapabilities(network)
if (capabilities?.hasTransport(NetworkCapabilities.TRANSPORT_VPN) == true) {
_isVpnActive.value = true
}
}
override fun onLost(network: Network) {
// Re-check if any VPN network remains
val hasVpn = connectivityManager.allNetworks.any { net ->
connectivityManager.getNetworkCapabilities(net)
?.hasTransport(NetworkCapabilities.TRANSPORT_VPN) == true
}
_isVpnActive.value = hasVpn
}
}
fun startMonitoring() {
val request = NetworkRequest.Builder()
.addTransportType(NetworkCapabilities.TRANSPORT_VPN)
.build()
connectivityManager.registerNetworkCallback(request, networkCallback)
}
fun stopMonitoring() {
connectivityManager.unregisterNetworkCallback(networkCallback)
}
}
```
## VPN Client Control
```kotlin
enum class VpnControlMethod { SEPARATE, TOGGLE, MANUAL }
data class VpnClientConfig(
val packageName: String,
val method: VpnControlMethod,
val startAction: String? = null,
val stopAction: String? = null,
val toggleAction: String? = null,
val receiverClass: String? = null
)
val KNOWN_VPN_CLIENTS = mapOf(
"com.v2ray.ang" to VpnClientConfig(
packageName = "com.v2ray.ang",
method = VpnControlMethod.TOGGLE,
toggleAction = "com.v2ray.ang.action.widget.click",
receiverClass = "com.v2ray.ang.receiver.WidgetProvider"
),
"moe.nb4a" to VpnClientConfig(
packageName = "moe.nb4a",
method = VpnControlMethod.SEPARATE,
startAction = "moe.nb4a.ui.QuickEnable",
stopAction = "moe.nb4a.ui.QuickDisable"
),
"com.happproxy" to VpnClientConfig(
packageName = "com.happproxy",
method = VpnControlMethod.TOGGLE,
toggleAction = "com.happproxy.action.widget.click",
receiverClass = "com.happproxy.receiver.WidgetProvider"
)
)
```
Start/stop VPN via shell:
```kotlin
suspend fun startVpn(config: VpnClientConfig) {
when (config.method) {
VpnControlMethod.TOGGLE, VpnControlMethod.SRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.