300 Commits
Author SHA1 Message Date
IcedTangerine fe8c0c7ea1 Merge pull request #74 from creamlike1024/fix/pcsc-t0
fix(pcsc): connect with T=0, as lpac does
2026-11-28 13:41:28 +08:00
creamlike1024 8680e37046 fix(pcsc): connect with T=0, as lpac does
Asking for T=0|T=1 makes some readers fail the protocol negotiation
with T=0-only cards: macOS's CCID driver answers
SCARD_W_UNRESPONSIVE_CARD, while T=0 alone connects. lpac, which 0.8.x
used, has always connected with T=0.

Fixes #73
2026-11-28 13:24:29 +08:00
IcedTangerine 7190dc990b Merge pull request #72 from creamlike1024/feat/linux-arm64
ci: build Linux arm64 packages on GitHub's arm64 runner (#51)
2026-11-27 12:03:09 +08:00
creamlike1024 84a8ab5e2f ci: build Linux arm64 packages on GitHub's arm64 runner (#51)
A build-linux-arm64 job on ubuntu-26.04-arm builds libeuicc and the
app natively, links the runner's arm64 libpcsclite, runs the tests on
arm64 and uploads the .tar.gz, .deb, .rpm and PKGBUILD; the release
waits for it.

Each architecture's PKGBUILD now ships under its own name,
PKGBUILD-x86_64 and PKGBUILD-aarch64 (makepkg -si -p ...), in the flat
release. Both use the amd64 job's icons, which are byte for byte the
ones the arm64 build makes, and the release checks every source of
each PKGBUILD against the files it ships.
2026-11-27 11:53:08 +08:00
IcedTangerine 19d26ca0d0 Merge pull request #70 from creamlike1024/feat/go-ccid
Android Support
2026-11-27 00:52:01 +08:00
creamlike1024 d276de5ae7 build: find cJSON's license in libeuicc's build directory, where it moved 2026-11-27 00:04:54 +08:00
creamlike1024 2b10556ff8 Update README 2026-11-26 23:32:32 +08:00
creamlike1024 421a2441fa ci: sign only tag builds' APKs with the release key, from the environment release 2026-11-26 23:15:05 +08:00
creamlike1024 803db7572b fix: name the refresh shortcut only on desktop, as ⌘R or Ctrl+R 2026-11-26 23:04:22 +08:00
creamlike1024 a399883859 build: leave go-ccid out of desktop builds 2026-11-25 21:30:22 +08:00
creamlike1024 e32fe16567 feat(android): show a CI's certificate in a page of its own, and chevrons on Settings' rows 2026-11-25 21:30:22 +08:00
creamlike1024 97944ce6c5 fix(android): fit the certificate and Add eSIM dialogs' buttons on phones 2026-11-25 21:30:22 +08:00
creamlike1024 1627475ce9 perf(android): redraw only the windows on screen 2026-11-25 21:30:22 +08:00
creamlike1024 61366f2f26 fix(android): keep a dialog on the tab it opened on 2026-11-25 21:30:22 +08:00
creamlike1024 194fa34476 build: update go-ccid to v0.1.0 2026-11-25 21:30:22 +08:00
creamlike1024 80b9528608 fix: draw the Settings icon as a gear, not a sun 2026-11-25 00:28:37 +08:00
creamlike1024 2ee82bbdde build: build libeuicc outside the directory the linker searches 2026-11-24 15:22:49 +08:00
creamlike1024 614dcfc97b fix(android): say the windows' titles in the language chosen 2026-11-24 15:22:49 +08:00
creamlike1024 0e7b949ad6 feat(android): show only the stage under way while an eSIM downloads 2026-11-24 14:45:55 +08:00
creamlike1024 49c6627a23 fix(android): fit the About page and download stages on a phone, and keep floating controls clear of the bars 2026-11-24 14:27:24 +08:00
creamlike1024 caad0df80e fix(android): fit long inputs on a phone: activation code, IMEI, ISD-R AID 2026-11-24 12:47:31 +08:00
creamlike1024 651ec2b04b fix(android): keep the add button off the eSIM rows, and room for their names 2026-11-24 12:47:31 +08:00
creamlike1024 e812fbc57d feat(android): scan an activation code's QR code with the camera
On phones the download offers the system's camera and photo picker
(mygo's imagepicker plugin, which needs no permission) in place of
opening an image file. The photo is read off the main thread and
removed once read, as it holds the activation code.

On a phone, an error of taking the code (no QR code, an empty
clipboard) shows in a toast: the form's end, where desktops show it, is
out of sight below the buttons.

Choosing a photo works on a Redmi 7A (Android 16). The camera does not
open there yet: imagepicker.Capture reports no camera app on Android 11
and later, as the plugin's resolveActivity cannot see the camera app
without a <queries> entry, an issue of mygo's.
2026-11-23 15:49:09 +08:00
creamlike1024 c621c24dbe feat: read QR codes in camera photos
A phone's photo is twelve megapixels or more, which the QR reader took
slowly and could miss. Images are now scaled down in gray to 1600 pixels
at most first (a JPEG's Y plane, as it is), and a code not found is
looked for again with TRY_HARDER, then at 800 pixels. Screenshots and
images already small are read as they are.
2026-11-23 15:48:49 +08:00
creamlike1024 4094447839 docs: Android in the README: readers, building, signing 2026-11-23 15:28:23 +08:00
creamlike1024 2b880b0e60 ci: build the Android APK, signed with the upload key when given
A build-android job builds the arm64 APK beside the other platforms and
ships it with releases. It signs it with the upload key of the secrets
ANDROID_KEYSTORE_BASE64, ANDROID_KEY_ALIAS, ANDROID_KEYSTORE_PASSWORD
and ANDROID_KEY_PASSWORD when they are set, and else warns that the
debug key signed it.

scripts/with-version.sh puts the key in mygo.json for the build, as
EASYLPAC_ANDROID_KEYSTORE and EASYLPAC_ANDROID_KEY_ALIAS name it, which
local builds use too; mygo reads the passwords from the environment.
Checked with a throwaway key, which apksigner found on the APK. The
tests also run with -tags phone, and the checkouts take go-ccid.
2026-11-23 15:28:23 +08:00
creamlike1024 9dd722e87f feat: explain PC/SC errors of a card or reader gone
PC/SC's errors of no card or a card removed, a reader unknown or
unavailable, and an unresponsive card are told by the same kinds as the
USB CCID backend's, which the interface explains in words.
2026-11-23 15:23:17 +08:00
creamlike1024 8df7938976 build: update go-ccid, which aborts a command whose context ends 2026-11-23 15:20:42 +08:00
creamlike1024 e9dd43aadc build: update go-ccid, whose transfers are URBs the kernel keeps 2026-11-23 15:05:04 +08:00
creamlike1024 8f75423a1b feat(android): explain reader errors, and a phone's way to a QR code
The USB CCID backend now tells four failures apart by kind
(transport.ErrAccessDenied, ErrDeviceGone, ErrNoCard, ErrCardMute):
USB access the user denied, the reader unplugged before or during an
operation, no card in the reader, and a card that does not answer. The
interface explains them in words rather than showing usbfs's or
go-ccid's error, which the log keeps. libeuicc already passes the
transport's error on, which a test now holds it to.

On phones the download's hint offers to open a picture of the QR code
instead of dropping one, and the copy the system's picker gives the app
is removed once read, as it holds the activation code.
2026-11-23 14:57:46 +08:00
creamlike1024 8e03683f5b fix: list go-ccid among the licenses on the About page
go-ccid (MIT) is linked into every build, the USB CCID backend's or not,
and releases ship its license, but the About page did not name it.
2026-11-23 14:57:46 +08:00
creamlike1024 ba2816ad9d feat(android): lay the pages out for phones
On phones the pages fit a narrow window:

- The card's tiles go two by two, labels go above their values, and the
  buttons of EUICCInfo2 under its title.
- Notifications are a list of rows a tap checks, which a long press
  offers to send or remove, rather than a table chosen with modifier
  keys.
- Settings offer no choice of PC/SC or modem, name USB readers by their
  product rather than their device path, and turn PPS on or off.
- Dialogs fit the window, the download one scrolling where it is taller,
  and none brings the keyboard up as it opens.
- Deleting the eSIM in use says why it can't, as phones' menus show
  neither tooltips nor which items are disabled.
- The log is exported through the system's picker (Dialog.SaveCopy).
- The floating button hides while a dialog is open.

The tabs' refresh buttons are set once the tabs exist: before, the bar
they go in was not there yet and they did not show.

Reader settings now follow the backend in use rather than PC/SC's alone.
Desktop windows draw the same: 256 frames compared pixel for pixel.
Tested on a Redmi 7A with the demo card, a download included.
2026-11-23 14:19:14 +08:00
creamlike1024 3f26bec249 feat(android): a phone frame with tabs
Phones show the system's bar of tabs: eSIMs, notifications, card and
settings, a window each. The log and About are pushed over the settings
tab, which the system's back takes away. The tabs that show the card
refresh from a button in their bar and by pulling their content down;
the eSIMs tab adds one from a floating button, and the notifications
tab counts them on its badge. The pages are still the desktop's.

The app's dispatch now redraws every window, and only the window in
front shows toasts and dialogs, so that a tab behind takes none. The
demo uses the phone frame too, and the read-only reader test it
replaces is gone.

Desktop windows draw the same: 256 frames compared pixel for pixel. The
phone frame builds on desktops with -tags phone, for its tests at
360x720. Tested on a Redmi 7A with the demo card.
2026-11-23 13:55:47 +08:00
creamlike1024 e1498ff012 Merge remote-tracking branch 'origin/master' into feat/go-ccid 2026-11-23 13:00:05 +08:00
creamlike1024 debd2c3e8b fix: switch profiles without refresh, power off the card on close
Since the libeuicc rewrite (0.9.0) enabling and disabling a profile
requested a refresh, where lpac, and so EasyLPAC before it, does not.
Behind a card reader some eUICCs refuse such an enable with
commandError (7), which SGP.22 v3 requires while CAT is not
initialised. Switch without refresh on every backend again.

Without refresh the device has to activate the card again, so PC/SC
now powers the card off on close, as lpac does, instead of leaving it
powered. This makes each card session slower (about 0.3 s on an ACS
ACR38U). Modem users may have to restart the modem after a switch.

Refs #68
v0.9.3
2026-11-23 00:17:15 +08:00
creamlike1024 1965fc6ed4 refactor: move the desktop frame out of gui.go
desktop.go holds the frame of desktop windows: the sidebar, the floating
header, the task pill and the shortcuts. gui.go keeps what an interface
for phones shares with it, with the page body, the dialogs, the notices,
the device's state and a task's text as functions of their own.

Desktop windows draw the same: 256 frames of 32 states, light and dark,
with and without vibrancy, at two sizes, are identical pixel for pixel.
2026-11-22 23:30:39 +08:00
creamlike1024 76d210ce48 build(android): add the Android build script and version codes
scripts/build-android.sh builds the arm64 APK and AAB with a JDK 17,
and build-libeuicc.sh builds for Android with the NDK.

mygo took a snapshot such as 0.9.2.r12.g... to be versionCode 900,
below 0.9.2's 902, which Android refuses as a downgrade.
android-version-code.sh gives a code that grows with the versions of
version.sh, and with-version.sh puts it in mygo.json for the build.
2026-11-22 21:04:02 +08:00
creamlike1024 d0402318dc feat(android): read cards through USB CCID readers
internal/usbhost is a native module in Kotlin that lists the CCID
readers, asks for permission and hands over the connection's file
descriptor; go-ccid speaks to the reader on it through usbfs.

Android offers the ccid backend alone, and until it has an interface
of its own shows a screen that only reads the card, with the
identifiers obscured. Desktops keep their backends and interface.

Read on a Redmi 7A (Android 16) with an ACR38U-CCID: the results match
PC/SC's, and a PPS takes a refresh from 3.04 to 1.32 seconds. Writing
to a card is untested.
2026-11-22 21:03:48 +08:00
creamlike1024 2ebf1978a3 build: ship go-ccid's source and license with releases
go.mod builds go-ccid from its submodule, which git archive leaves out:
the source tarball, which the LGPL asks for so that libeuicc can be
replaced, did not build. It now holds go-ccid's tree, and the release
its MIT license.
2026-11-22 21:03:27 +08:00
creamlike1024 ba96b14ab1 build: keep desktop libeuicc and PC/SC out of mobile builds
GOOS android and ios also match linux and darwin, so they picked the
desktop libeuicc. Android links third_party/libeuicc/android-<arch>,
and the PC/SC backend is a stub that is never available on phones.
2026-11-22 20:31:24 +08:00
creamlike1024 69860ab8e5 feat: add a USB CCID card backend on go-ccid
internal/transport/ccidusb reaches USB CCID readers without PC/SC,
through go-ccid: the readers of usbfs on Linux, and on Android those
of a Source the app provides. go.mod builds go-ccid from the submodule
in third_party, now at its protocol core, usbfs, T=1 and PPS.

An end-to-end test runs libeuicc over it and a simulated reader at
TPDU level (T=0, T=1) and at extended APDU level. The app does not
offer the backend yet, and it is untested on a real reader.
2026-11-22 20:31:08 +08:00
creamlike1024 c133a107fa refactor: share the logical channel APDUs between card backends
transport.OpenChannel and CloseChannel hold the MANAGE CHANNEL and
SELECT sequence that the PC/SC backend had, for the other raw APDU
backends to use. The APDUs and errors of PC/SC are unchanged.
2026-11-22 20:30:56 +08:00
creamlike1024 1db0fc7fea build: add go-ccid as a submodule in third_party
go-ccid is the pure Go CCID reader driver that the Android build will
use for USB readers, developed as its own MIT-licensed library.
2026-11-22 00:34:03 +08:00
creamlike1024 54fc1c7dc2 ci: tag releases vx.y.z, as mygo's updater expects
mygo's updater takes a release's tag to be tagPrefix + version, and
tagPrefix cannot be empty (it defaults to "v"): the update archives,
the prerelease channel and delta updates are found by v<version>.
Release tags are therefore vx.y.z[-pre] from now on, and only those
trigger a release build. scripts/version.sh drops the "v" (the
version stays 0.9.3) and still counts the older tags without it, as
0.9.2; EASYLPAC_VERSION also takes a tag name. The READMEs show the
new tags.
2026-11-21 23:48:47 +08:00
creamlike1024 e9c2b889f3 ci: take the version from git tags, build every push
The version is no longer kept by hand in mygo.json, which now says
0.0.0-dev. scripts/version.sh computes it from the git tags: a release
tag x.y.z[-pre] is the version, a later commit a snapshot such as
0.9.2.r12.ga4e79e0 (with .dirty for uncommitted changes), which sorts
after its tag and before the next release for dpkg, rpm and pacman,
and is the pkgver of an Arch -git package as it is. The snapshot has
no "+", which mygo turns into "~" for dpkg. EASYLPAC_VERSION overrides
it. scripts/with-version.sh writes the version into mygo.json for one
command and restores the file; the build scripts and CI build through
it.

The release workflow becomes build.yaml: pushes to master and
release/**, pull requests and manual runs are tested and built, with
the packages as artifacts; a pushed release tag also publishes the
GitHub Release (a pre-release for x.y.z-*). Other tags no longer
trigger it. The READMEs describe the versions and the release steps.
2026-11-21 23:44:47 +08:00
creamlike1024 cb36fe502b build: upgrade mygo to v0.10.0, add RPM/PKGBUILD, drop WebView2
- Upgrade github.com/egoist/mygo from v0.8.3 to v0.10.0 and pin the
  same CLI version in the build scripts and the release workflow.
- Linux: give linux.depends per package format, so the RPM and the
  PKGBUILD that mygo now writes keep the pcsc-lite dependencies (mygo
  has no mapping for libpcsclite1/pcscd and dropped them), and upload
  the .rpm, the PKGBUILD and its icons with the release.
- Windows: build with mygo_nowebview; every window is native UI, so
  the app needs no WebView2 Runtime (about 370 KB smaller).
2026-11-21 23:44:33 +08:00
creamlike1024 a4e79e0847 bump to version 0.9.2 0.9.2 2026-11-10 19:26:04 +08:00
creamlike1024 ca3b2add25 feat: add theme and i18n setting 2026-11-10 19:17:03 +08:00
creamlike1024 f1ad19980c ci: Set PIC explicitly in libeuicc build 0.9.1 2026-11-10 14:08:24 +08:00
creamlike1024 89062ef6ae feat: Disable LTO in libeuicc build 2026-11-10 13:54:03 +08:00