Commit Graph

48 Commits

Author SHA1 Message Date
349445219b Android: reliable build script; GUI: fix list not drawn until first tap.
scripts/build.sh (documented in README) builds, manifest-patches
( MANAGE_EXTERNAL_STORAGE ), signs and installs the APK in one go.
Without the permission the system 'All files access' toggle is grayed
out on Android 11+.

GUI fix: the event loop only checks the 'updated' channel when it is
not blocked in w.Event(), and gioui only emits frames on invalidation
or user input, so the initial list load was never drawn until a tap.
The updater now signals non-blocking and invalidates the window itself;
the animation ticker gets the same wake-up treatment.
2026-08-24 09:23:41 -04:00
4c337ff06d Guard the JNI fragment registration against the null detach view.
Gio's GioView.onDestroyView signals detach with ViewEvent{View: 0};
handleEvent already filters these, but add defense in depth so any
caller forwarding the event unfiltered cannot drive the JNI path
(GetObjectClass on a null ref aborts the process, the recents-wipe
SIGABRT). Completes the intent of PR #1, whose handleEvent guard is
already in master from the migration commit.

Fixes: recents-wipe crash defense (PR #1 superseded).
2026-08-21 15:29:24 -04:00
dc7661e226 Android: launch the 'All files access' settings screen at startup.
MANAGE_EXTERNAL_STORAGE (needed to read the store at
/storage/emulated/0/...) cannot be requested with a runtime
permission dialog; the user must toggle it in system settings.
Port the mechanism from the pad app:

- Permissions.java: a Fragment registered at window attach that
  launches Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION
  (per-app settings screen) when Environment.isExternalStorageManager()
  is false on API 30+ (runtime READ_EXTERNAL_STORAGE request on
  older APIs). The guard means the screen appears only until the
  user grants it.
- The compiled classes ship in PgpConnect.jar's directory jar
  (Permissions.jar); gogio picks *.jar up from the package dir and
  dexes them. go:generate now rebuilds it.
- jni_android.c/h: registerPermissionsFragment(), mirroring
  registerFragment() for PgpConnect.
- Impl wiring: call it from the AndroidViewEvent handler right
  after InitPgp.

Verified on the x86_64 emulator: with the appop denied the system
settings screen opens automatically on launch; after granting it,
launch is clean and list + OpenKeychain decryption from
/sdcard/Pass work end to end.
2026-08-21 14:44:38 -04:00
4b74367a55 GUI: fix invisible text on Linux, tiny button hit-areas, missing labels.
Found by running and debugging the Linux build on a virtual display:

- impl_linux.go: set fontSize (16, like Darwin). It was only defined
  for the Android and Darwin builds, so on Linux every label and
  button was rendered at size zero (all text invisible).
- ui.go: extend the Button click area to the full button width, not
  just the label width. Short labels (e.g. a few characters in a
  full-width list row) had a tiny tap target that was easy to miss.
- main.go: set Color: black on the insert-page buttons (<, >, generate,
  @, #). A zero-value NRGBA has A=0 (transparent), so their labels
  were invisible even though the buttons worked.
- main.go: gofmt (modern operator spacing).
2026-08-21 13:48:14 -04:00
e7218b1efd Complete the Gio v0.10.2 GUI migration (working on Android).
- Event loop: call w.Event() and FrameEvent.Frame() on the same
  goroutine; no channel bridge (the bridge broke frame rendering).
- clip: use clip.UniformRRect(...).Push(gtx.Ops) / Pop() for real
  clipping in layoutRRect (old .Add(ops) painted unclipped).
- Window clear color is white in v0.10.2.
- Fonts: always provide gofont; on Android use
  WithCollection(gofont.Collection()).
- Button labels: explicitly set Color (zero-value NRGBA has A=0,
  i.e. transparent, so labels were invisible).
- Filter: detect changes by comparing the editor text, since
  material.Editor.Layout consumes the editor's input events
  internally and a later FilterEd.Update(gtx) never sees them.
- idPage: persist the manually entered ID with store.SetID (on
  Android nativeIdentities is unimplemented, so there are no id
  buttons to click).
- Use U+2026 (gofont) instead of U+22EE (not in gofont) for the
  menu button.
- Split getConfDir/noidLabelText out into impl_linux.go for the
  Linux build.
2026-08-21 13:00:35 -04:00
af1b878308 passgo package: modernize for go 1.24; reset store.Empty in GetStore.
- Update to //go:build tags, gofmt, and the android-35 javac template
  in //go:generate.
- GetStore: reset store.Empty when the store directory exists (it was
  only set true when the dir was missing, so a reconfigured store kept
  the stale 'Empty' state and showed the configure button).
- Rebuild PgpConnect.jar (android-35).
2026-08-21 13:00:04 -04:00
edb38a6b85 Bump dependencies: gioui.org v0.10.2, fsnotify v1.8.0, go 1.24.
fsnotify v1.4.x's inotify_poller uses the legacy epoll_wait(2) syscall,
which is blocked by seccomp on x86_64 Android emulators (SIGSYS crash on
launch). v1.8.0 uses blocking reads on the inotify fd instead.

Also drop the unused git.wow.st/gmp/jni dependency.
2026-08-21 12:59:51 -04:00
54c2c00455 Add 'X' button to password filter. 2020-09-17 20:18:20 -04:00
db1c958073 Add filter to password list view. 2020-09-08 13:14:09 -04:00
ec0b64f5f5 Migrating to new Gio version (non-working version). 2020-08-31 17:03:07 -04:00
3163a75b93 Update to latest Gio release. Install a system font on Darwin to
get access to Unicode glyphs.
2019-12-18 14:01:05 -05:00
4d6a8fd86a Documentation. 2019-11-26 13:31:21 -05:00
94cfbbeb41 Update Gio version. Working Android implementation. 2019-11-26 13:24:03 -05:00
4fc504b89a Restructure for automatic Fragment registration by Gio. 2019-11-21 18:18:47 -05:00
23df75fd15 Add permissions request, comment out debug print statements. 2019-11-20 16:44:28 -05:00
a1d9ffa6c6 Improve handling of missing user-IDs. 2019-11-20 15:48:56 -05:00
47ffd8f160 fixup 2019-11-20 15:00:53 -05:00
8aacb243d2 Implement Clip on Android. 2019-11-20 14:56:11 -05:00
ea9b4b3861 Add cmd/passgo-gui files updated for Android implementation. 2019-11-20 14:30:43 -05:00
8611bfb5e0 Cleanups in Android implementation. 2019-11-20 13:53:40 -05:00
46c76ed065 Start of Android implementation. 2019-11-20 11:52:19 -05:00
b0abb36e64 Improve handling of SelButtons. Reset password insertion page as
appropriate.
2019-10-03 17:34:04 -04:00
e275ad6607 Add functionality to randomly generate passwords on the insert
page.
2019-10-01 18:22:38 -04:00
bf1709dc4c Convert to git.wow.st/gmp/clip for Darwin clipboard. 2019-10-01 13:54:35 -04:00
5402aba41b Add go.mod and pin to compatible version of Gio. 2019-09-24 10:18:01 -04:00
c3d32f79a7 Use app.DataDir() to get config directory on Android. Use an
Inset to stay inside the OS window insets.
2019-09-19 17:28:15 -04:00
cdce91e0ba Fix build tags. 2019-09-10 14:50:56 -04:00
443cfa9919 Refactor platform-dependent code. 2019-09-10 12:28:20 -04:00
12b57d263f go fmt 2019-09-10 11:36:03 -04:00
2c4c708b3a Re-arrange platform-dependent code. 2019-09-10 11:31:57 -04:00
09859ca0a9 Compatibility with gpg 2.0 -- call out to gpg commands (on Darwin)
if go openpgp is not compatibile with the local gpg installation.
2019-09-10 08:45:59 -04:00
44cab96fff Add a window title and run go fmt. 2019-09-06 21:14:06 -04:00
dd18765a80 Fine grained animation delays. 2019-09-06 16:55:14 -04:00
a6dc5cbe18 More efficient animation. 2019-09-06 15:14:37 -04:00
df840dd0ab Tweaked docs. 2019-09-06 13:47:42 -04:00
b9e9373b04 Fix animation code. Retry GPG agent password prompt and clear
cache if the passphrase does not work.
2019-09-06 13:46:13 -04:00
666d127584 Don't forget to close the config file. Put the custom UI widgets
in a separate source file.
2019-09-06 12:16:08 -04:00
9ead860d17 Add a back button to the passphrase entry page. Clear the clipboard
after 45 seconds.
2019-09-06 11:55:31 -04:00
59a15849f3 Add password prompt code to GUI. 2019-09-06 11:43:14 -04:00
d9316afe6b Update docs. 2019-09-06 11:06:04 -04:00
94c1d57933 Fix bug due to rewriten layout.List() (updated Gio version). 2019-09-06 10:59:18 -04:00
7b3d59a581 Add back button to configuration page. 2019-09-06 10:52:27 -04:00
e40e98aa25 Run go fmt. 2019-09-06 10:46:23 -04:00
e108a9b7a7 Add configuration file and UI, and animated overlay when passwords
are copied to the clipboard.
2019-09-06 10:45:18 -04:00
28ccd6d107 Rename to passgo and run go fmt. 2019-09-05 06:41:39 -04:00
fc7a4c272e Improve comments, tweak default password prompt function. 2019-09-04 22:44:47 -04:00
9c711e9022 Add README.md. 2019-09-04 22:37:42 -04:00
e8a4ad031b Initial commit 2019-09-04 22:19:39 -04:00