Skip to content

Commit 8384063

Browse files
authored
Merge pull request #105 from ptkNktq/develop
🎉 Release
2 parents 9fd2ab9 + 9e16ef4 commit 8384063

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

DesktopApp/AndroidNotificationNotifier.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<Nullable>enable</Nullable>
77
<UseWPF>true</UseWPF>
88
<UseWindowsForms>true</UseWindowsForms>
9+
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
910
</PropertyGroup>
1011

1112
<ItemGroup>

DesktopApp/App.xaml.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ private void StartApp()
4040
var settings = JsonSerializer.Deserialize<Settings>(json);
4141
if (settings == null)
4242
{
43-
throw new Exception("設定ファイルを読み込めませんでした。修正して再起動してください。");
43+
Notify("設定ファイルを読み込めませんでした。修正して再起動してください。");
44+
return;
4445
}
4546
var ep = new IPEndPoint(IPAddress.Any, settings.Port);
4647
server = new TcpListener(ep);
@@ -49,17 +50,14 @@ private void StartApp()
4950
while (true)
5051
{
5152
using TcpClient client = server.AcceptTcpClient();
52-
var stream = client.GetStream();
53-
int i;
54-
while ((i = stream.Read(buff, 0, buff.Length)) != 0)
55-
{
56-
var message = Encoding.UTF8.GetString(buff);
57-
Notify(message);
58-
}
53+
using StreamReader reader = new (client.GetStream(), Encoding.UTF8);
54+
var message = reader.ReadToEnd();
55+
Notify(message);
56+
Array.Clear(buff, 0, buff.Length);
5957
client.Close();
6058
}
6159
}
62-
catch (Exception e)
60+
catch (SocketException e)
6361
{
6462
Notify($"エラー: {e.Message}");
6563
}

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ android.apkをインストールします。
3535
5. 完了
3636
通知対象タブに選択したアプリが表示されます。
3737
後は通知が来るのを待つだけ。
38-
&nbsp;<img src="https://github.com/ptkNktq/AndroidNotificationNotifier/assets/7608826/c34f58fa-43b9-4c40-9f11-64b1d9b77efd" width="320px">
38+
&nbsp;<img src="https://github.com/ptkNktq/AndroidNotificationNotifier/assets/7608826/c34f58fa-43b9-4c40-9f11-64b1d9b77efd" width="320px">
39+
40+
### プライバシーポリシー
41+
- アプリ内で取得したデータを第三者に送信することはありません。
42+
- ただし、バックアップの際はその一部(アプリのパッケージ名等)が利用端末のストレージに保存されます。
43+
###### 権限の説明
44+
- インターネット接続
45+
- 設定のバックアップを保存/復元するためのに必要です。
46+
- インストール済みアプリの取得
47+
- 通知対象のアプリを選択するための必要です。
48+
- 通知へのアクセス
49+
- PCに通知内容を通知するために、通知へアクセスする必要があります。
3950

4051
### 著作権
4152
このアプリのアイコンで使用しているAndroid robot(通称ドロイド君)の著作権はGoogleに帰属します。

0 commit comments

Comments
 (0)