mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 13:23:15 +02:00
Demo mode: one-tap Start/Stop demo curfew via the companion notification (CurfewDemoReceiver) and curfew-demo-on/off CLI, driving the curfew_force_on file so the full stack can be exercised any time with a guaranteed off switch. Net stopgap: Android netd reasserts the whole filter table ~1-4x/5s, wiping the custom FOCUS_CURFEW_NET chain; un-waited iptables calls also lost the xtables lock race and left partial chains. Add an iptw -w lock-wait helper, a cached UID list, and a 1s watchdog that re-pins the chain when netd flushes it, plus heartbeat/rebuild logging. Proper netd/eBPF firewall tracked as follow-up. Verified live on the BL9000 (Android 13): demo on/off engages and fully restores all layers; chain now full (24 rules) and near-continuous (~98% steady state) vs intermittent before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
73 lines
2.7 KiB
XML
73 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
package="com.kuhy.focusstatus">
|
|
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
|
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
|
|
|
<application
|
|
android:label="Focus Status"
|
|
android:icon="@android:drawable/ic_menu_compass"
|
|
android:allowBackup="false"
|
|
android:hasFragileUserData="false"
|
|
android:usesCleartextTraffic="false">
|
|
|
|
<activity
|
|
android:name=".LaunchActivity"
|
|
android:exported="true"
|
|
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
android:excludeFromRecents="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.MAIN" />
|
|
<category android:name="android.intent.category.LAUNCHER" />
|
|
</intent-filter>
|
|
</activity>
|
|
|
|
<service
|
|
android:name=".StatusService"
|
|
android:exported="false"
|
|
android:foregroundServiceType="specialUse">
|
|
<property
|
|
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
|
|
android:value="Persistent status of focus/home-mode daemon on rooted device" />
|
|
</service>
|
|
|
|
<receiver
|
|
android:name=".RecheckReceiver"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="com.kuhy.focusstatus.RECHECK" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".CurfewToggleReceiver"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="com.kuhy.focusstatus.CURFEW_TOGGLE" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".CurfewDemoReceiver"
|
|
android:exported="false">
|
|
<intent-filter>
|
|
<action android:name="com.kuhy.focusstatus.CURFEW_DEMO" />
|
|
</intent-filter>
|
|
</receiver>
|
|
|
|
<receiver
|
|
android:name=".BootReceiver"
|
|
android:exported="true"
|
|
android:enabled="true">
|
|
<intent-filter>
|
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
|
<action android:name="android.intent.action.LOCKED_BOOT_COMPLETED" />
|
|
</intent-filter>
|
|
</receiver>
|
|
</application>
|
|
</manifest>
|