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
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
- 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).