Skip to content

Commit 79d245e

Browse files
committed
Fix networking, add permission to android
1 parent 1be539a commit 79d245e

File tree

8 files changed

+22
-16
lines changed

8 files changed

+22
-16
lines changed

api/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: setonix_api
22
description: The Linwood Setonix API
3-
version: 0.2.0
3+
version: 0.1.1
44
publish_to: none
55
# repository: https://github.com/my_org/my_repo
66

app/AppImageBuilder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ AppDir:
1414
id: dev.linwood.setonix
1515
name: Linwood Setonix
1616
icon: dev.linwood.setonix
17-
version: 0.2.0
17+
version: 0.1.1
1818
exec: setonix
1919
exec_args: $@
2020
apt:

app/android/app/src/main/AndroidManifest.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
while the Flutter UI initializes. After that, this theme continues
1818
to determine the Window background behind the Flutter UI. -->
1919
<meta-data
20-
android:name="io.flutter.embedding.android.NormalTheme"
21-
android:resource="@style/NormalTheme"
22-
/>
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
2323
<intent-filter>
24-
<action android:name="android.intent.action.MAIN"/>
25-
<category android:name="android.intent.category.LAUNCHER"/>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
2626
</intent-filter>
2727
</activity>
2828
<!-- Don't delete the meta-data below.
@@ -38,8 +38,10 @@
3838
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
3939
<queries>
4040
<intent>
41-
<action android:name="android.intent.action.PROCESS_TEXT"/>
42-
<data android:mimeType="text/plain"/>
41+
<action android:name="android.intent.action.PROCESS_TEXT" />
42+
<data android:mimeType="text/plain" />
4343
</intent>
4444
</queries>
45-
</manifest>
45+
<uses-permission android:name="android.permission.INTERNET" />
46+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
47+
</manifest>

app/lib/services/network.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ class NetworkService {
2121

2222
Future<void> init() async {
2323
if (!kIsWeb) {
24-
_server = (await RawDatagramSocket.bind(
25-
InternetAddress.anyIPv4, kBroadcastPort))
26-
..broadcastEnabled = true;
24+
try {
25+
_server = (await RawDatagramSocket.bind(
26+
InternetAddress.anyIPv4, kBroadcastPort))
27+
..broadcastEnabled = true;
28+
} catch (_) {}
2729
}
2830
_fetchServers().listen((event) {
2931
_servers.add(event);

app/linux/debian/DEBIAN/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: linwood-setonix
2-
Version: 0.2.0
2+
Version: 0.1.1
33
Section: base
44
Priority: optional
55
Homepage: https://github.com/LinwoodDev/Setonix

app/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ packages:
983983
path: "../api"
984984
relative: true
985985
source: path
986-
version: "0.2.0"
986+
version: "0.1.1"
987987
share_plus:
988988
dependency: transitive
989989
description:

app/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: Play games without internet
1111
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212
# Read more about iOS versioning at
1313
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14-
version: 0.2.0+2
14+
version: 0.1.1+2
1515
publish_to: none
1616

1717
environment:

metadata/en-US/changelogs/2.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* Add internet permission to android
2+
* Fix app crashing if socket cannot be created

0 commit comments

Comments
 (0)