android config change and bugfix

This commit is contained in:
DASHU
2025-07-01 11:57:11 +08:00
parent 0c0f80b788
commit dcd9615607
3 changed files with 16 additions and 2 deletions

View File

@@ -12,7 +12,8 @@
android:theme="@style/LaunchTheme" android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"> android:windowSoftInputMode="adjustResize"
android:requestLegacyExternalStorage="true">
<!-- Specifies an Android theme to apply to this Activity as soon as <!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues while the Flutter UI initializes. After that, this theme continues
@@ -24,6 +25,8 @@
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/>
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
@@ -45,6 +48,10 @@
<meta-data <meta-data
android:name="flutterEmbedding" android:name="flutterEmbedding"
android:value="2" /> android:value="2" />
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="@xml/device_filter" />
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"
android:resource="@xml/device_filter" />
<provider <provider
android:name="com.github.haorendashu.nowser.NowserSignerProvider" android:name="com.github.haorendashu.nowser.NowserSignerProvider"
@@ -75,4 +82,6 @@
<data android:mimeType="text/plain"/> <data android:mimeType="text/plain"/>
</intent> </intent>
</queries> </queries>
<uses-feature android:name="android.hardware.usb.host" />
</manifest> </manifest>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- 0x2323 / 0x3434: Nesigner -->
<usb-device vendor-id="8995" product-id="13364" />
</resources>

View File

@@ -41,7 +41,7 @@ class _UserLoginDialog extends CustState<UserLoginDialog> {
@override @override
Future<void> onReady(BuildContext context) async { Future<void> onReady(BuildContext context) async {
if (PlatformUtil.isPC()) { if (PlatformUtil.isPC() || PlatformUtil.isAndroid()) {
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
checkNesigner(); checkNesigner();
}); });