Skip to content

feat: Android app (wireless debugging, Shizuku or root) - #675

Merged
Zel9278 merged 7 commits into
mainfrom
feat/android-app
Oct 9, 2026
Merged

Zel9278 merged 7 commits into
mainfrom
feat/android-app

Conversation

@Zel9278

@Zel9278 Zel9278 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

内容

pcsc-rs を動かす Android アプリ(android/)。動かし方は3つから選ぶ。

動かし方 仕組み
ワイヤレスデバッグ アプリ自身がこのスマホの adbd に接続する(libadb-android、Apache-2.0)。初回はペアリング(コードは通知に入力、ポートは mDNS で探す)。接続したら自分に WRITE_SECURE_SETTINGS を付けて、以後はワイヤレスデバッグを自分でオンにできる
Shizuku Shizuku の UserService(shell ユーザー)でコマンドを実行する
root su を1本開けっぱなしにして使う
  • APK の中に aarch64-linux-android のクライアントを libpcsc.so として入れる(useLegacyPackaging で展開させる)
  • 動かし方は scripts/android-adb.sh と同じ。/data/local/tmp/pcsc-rs にコピーして、端末から切り離したループで常駐させる
  • 画面(Compose、日本語と英語)でできること:
    • 動かし方を選ぶ
    • PASS・名前・サーバーを設定する(adb 版の .env があれば読み込む)
    • 開始・停止、状態と接続、バージョン、ログを見る
    • 再起動後の自動開始(ワイヤレスデバッグは自分でオンにして、終わったら戻す)
  • 自動更新はクライアント自身が行う。APK を更新したときだけ、APK 内のクライアントでコピーし直す
  • CI: Android クライアントを APK に入れて assembleRelease。署名用の secrets があれば署名して、リリースに pcsc-rs-<tag>-android.apk を添付する

レビューでの修正

  • リリースのときに build.yml へ署名用の secrets を渡す(secrets: inherit)。PR のビルドはリリース鍵で署名しない。署名のステップはトレースしない
  • root モードは su 2000(shell の権限)で動かす。root で動かすと、shell ユーザーが書き換えられるファイルを root で実行することになり、あとで別の方式から止められなかった
  • 再起動後の自動開始(ワイヤレスデバッグ)は、USB デバッグがオフならワイヤレスデバッグをオフに戻さない(戻すと adbd が止まり、init がクライアントも kill する)。USB デバッグがオフなら画面で注意する
  • 通知がオフのときは、ペアリングを始める前にそう伝える
  • Shizuku のエラーでアプリが落ちない。起動時の自動開始でも設定の値を確かめる。同梱のクライアントのコピーに失敗したら開始を止める

確認

  • 実機(SH-M28、Android 16)で Shizuku から開始・状態・ログ
  • 署名用の secrets を設定(CI の APK がリリース鍵で署名されることを確認)
  • ワイヤレスデバッグのペアリング(実機ではまだ)
  • root モード(root 化した端末が手元に無い)

🤖 Generated with Claude Code

@Zel9278 Zel9278 changed the title feat: Android app that runs the client with root or Shizuku feat: Android app (wireless debugging, Shizuku or root) Oct 9, 2026
Zel9278 and others added 7 commits October 9, 2026 23:14
android/ is a small Compose app with the aarch64-linux-android client
inside (libpcsc.so). It runs the client the way scripts/android-adb.sh
does: copied to /data/local/tmp/pcsc-rs and kept running by a detached
loop, through su or a Shizuku user service (shell user). It keeps PASS,
the name and the server, reads them from an earlier adb install, shows
the state and the log, and can start the client after a restart.

The build workflow puts the Android client into the APK, signs it when
the signing secrets are there, and attaches it to releases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…of Shizuku

The app pairs with wireless debugging itself (the code is typed into a
notification, found with mDNS) and runs commands over its own adbd
connection as the shell user (libadb-android, Apache-2.0). Once
connected it grants itself WRITE_SECURE_SETTINGS, so it can switch
wireless debugging on by itself: for the Start button and to start the
client after a restart (switching it back off afterwards).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wireless debugging needs Wi-Fi to connect; Shizuku, once started, keeps
working without it. The app now offers wireless debugging, Shizuku and
root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Release builds call build.yml without the Android signing secrets, so
  no APK would be attached: pass them (secrets: inherit). Pull requests
  are no longer signed with the release key, and the signing step does
  not trace. The post-release step no longer pastes the commit message
  into a printf format.
- Root mode runs as the shell user (su 2000). It ran the client as root
  from files the shell user could replace, and switching to wireless
  debugging or Shizuku afterwards could not stop it.
- Start on boot over wireless debugging leaves it on when USB debugging
  is off: switching it off stops adbd, and init kills the client with it.
  The screen warns when USB debugging is off.
- Pairing says so when notifications are blocked, instead of opening
  Settings with nowhere to type the code.
- Shizuku errors (service died, bind timeout) no longer crash the app;
  start on boot skips settings the screen would reject; a failed copy of
  the bundled client stops the start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Zel9278
Zel9278 marked this pull request as ready for review October 9, 2026 14:21
@Zel9278
Zel9278 merged commit 0438d26 into main Oct 9, 2026
10 checks passed
@Zel9278
Zel9278 deleted the feat/android-app branch October 9, 2026 14:21
@github-actions github-actions Bot mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant