Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DesktopApp/AndroidNotificationNotifier.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>Resources\icon.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
Expand Down
16 changes: 7 additions & 9 deletions DesktopApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ private void StartApp()
var settings = JsonSerializer.Deserialize<Settings>(json);
if (settings == null)
{
throw new Exception("設定ファイルを読み込めませんでした。修正して再起動してください。");
Notify("設定ファイルを読み込めませんでした。修正して再起動してください。");
return;
}
var ep = new IPEndPoint(IPAddress.Any, settings.Port);
server = new TcpListener(ep);
Expand All @@ -49,17 +50,14 @@ private void StartApp()
while (true)
{
using TcpClient client = server.AcceptTcpClient();
var stream = client.GetStream();
int i;
while ((i = stream.Read(buff, 0, buff.Length)) != 0)
{
var message = Encoding.UTF8.GetString(buff);
Notify(message);
}
using StreamReader reader = new (client.GetStream(), Encoding.UTF8);
var message = reader.ReadToEnd();
Notify(message);
Array.Clear(buff, 0, buff.Length);
client.Close();
}
}
catch (Exception e)
catch (SocketException e)
{
Notify($"エラー: {e.Message}");
}
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,18 @@ android.apkをインストールします。
5. 完了
通知対象タブに選択したアプリが表示されます。
後は通知が来るのを待つだけ。
&nbsp;<img src="https://github.com/ptkNktq/AndroidNotificationNotifier/assets/7608826/c34f58fa-43b9-4c40-9f11-64b1d9b77efd" width="320px">
&nbsp;<img src="https://github.com/ptkNktq/AndroidNotificationNotifier/assets/7608826/c34f58fa-43b9-4c40-9f11-64b1d9b77efd" width="320px">

### プライバシーポリシー
- アプリ内で取得したデータを第三者に送信することはありません。
- ただし、バックアップの際はその一部(アプリのパッケージ名等)が利用端末のストレージに保存されます。
###### 権限の説明
- インターネット接続
- 設定のバックアップを保存/復元するためのに必要です。
- インストール済みアプリの取得
- 通知対象のアプリを選択するための必要です。
- 通知へのアクセス
- PCに通知内容を通知するために、通知へアクセスする必要があります。

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