添加开机自启功能

This commit is contained in:
zxj
2025-08-21 15:45:35 +08:00
parent f055441340
commit 18fbdc9875
4 changed files with 31 additions and 3 deletions
+10
View File
@@ -14,6 +14,7 @@
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name=".MyApp"
@@ -27,6 +28,15 @@
android:theme="@style/Theme.DualScreen"
android:usesCleartextTraffic="true"
tools:targetApi="31">
<!-- 注册BootReceiver,监听开机完成广播 -->
<receiver
android:name=".receiver.BootReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<activity
android:name=".activity.InitActivity"
android:exported="true">