Initial import of Brizzi HCE project
This commit is contained in:
56
references/hce-debug-playbook.md
Normal file
56
references/hce-debug-playbook.md
Normal file
@ -0,0 +1,56 @@
|
||||
# BRIZZI HCE Debug Playbook
|
||||
|
||||
Tujuan: verifikasi alur HCE pada reader/terminal nyata atau emulator NFC test tool.
|
||||
|
||||
## 1) Jalankan Aplikasi
|
||||
|
||||
- Build & install APK.
|
||||
- Hubungkan device yang akan dipakai sebagai kartu HCE (Android phone).
|
||||
- Pastikan NFC aktif.
|
||||
|
||||
## 2) Aktifkan logcat untuk HCE
|
||||
|
||||
Jalankan:
|
||||
|
||||
```bash
|
||||
adb logcat -s BrizziHce:* *:S
|
||||
```
|
||||
|
||||
Jika aplikasi tidak berjalan sebagai debug build, gunakan:
|
||||
|
||||
```bash
|
||||
adb logcat -v time | rg "BrizziHce"
|
||||
```
|
||||
|
||||
## 3) Kasus uji minimum
|
||||
|
||||
1. Arahkan reader ke perangkat.
|
||||
2. Perhatikan urutan awal:
|
||||
- `HOST_APDU_SERVICE` muncul (select AID).
|
||||
- `APDU recv: ...` kemudian `APDU out=...`.
|
||||
3. Uji flow:
|
||||
- `SELECT AID 3` -> harus ter-respon sukses.
|
||||
- `SELECT AID 1` -> harus sukses.
|
||||
- `GET_CARD_INFO`, `GET_BALANCE`, dll sesuai mode.
|
||||
4. Setelah sesi selesai/berubah reader, pastikan `onDeactivated` terpicu.
|
||||
5. Jika transaksi sudah mulai dan gagal, kirim `ABORT_TRANSACTION` untuk memastikan state cleared.
|
||||
|
||||
## 4) Catatan troubleshooting cepat
|
||||
|
||||
- Jika service tidak terpicu:
|
||||
- Cek apakah AID di `res/xml/apdu_service.xml` sesuai request reader.
|
||||
- Jika banyak status 6985:
|
||||
- Reader memanggil command di AID3 tanpa autentikasi.
|
||||
- Pastikan urutan `SELECT AID3` + `GET KEY` + challenge/authenticate.
|
||||
- Jika banyak status 6A82:
|
||||
- Command tidak dikenal/length tidak cocok; log hex raw untuk koreksi parser.
|
||||
|
||||
## 5) Template log capture
|
||||
|
||||
Contoh pattern yang diambil dari logcat:
|
||||
|
||||
- `APDU recv: 12 bytes | CLA=90 INS=BD P1=00 ...`
|
||||
- `APDU out=...`
|
||||
- `HCE deactivated: X`
|
||||
|
||||
Simpan log per sesi agar mudah dibandingkan dengan trace reader real.
|
||||
Reference in New Issue
Block a user