diff --git a/PgpConnect.jar b/PgpConnect.jar index f41371c..91a741f 100644 Binary files a/PgpConnect.jar and b/PgpConnect.jar differ diff --git a/impl_android.go b/impl_android.go index f33fcd5..aac5da8 100644 --- a/impl_android.go +++ b/impl_android.go @@ -1,6 +1,8 @@ -//+build android +//go:build android +// +build android + //go:generate mkdir -p classes -//go:generate javac -bootclasspath $ANDROID_HOME/platforms/android-29/android.jar -classpath openpgp-api.jar -d classes PgpConnect.java Foo.java +//go:generate javac -nowarn -classpath $ANDROID_HOME/platforms/android-35/android.jar:openpgp-api.jar -d classes PgpConnect.java //go:generate jar cf PgpConnect.jar -C classes . //go:generate rm -rf classes @@ -15,8 +17,8 @@ import "C" import ( "fmt" "io/ioutil" - "path" "log" + "path" "strings" "sync" "unsafe" @@ -27,10 +29,10 @@ import ( ) var ( - jvm uintptr + jvm uintptr waitch chan struct{} //w *app.Window - pgp PGP + pgp PGP installCompleteOnce sync.Once ) @@ -64,7 +66,7 @@ func connect() { <-waitch } -//Clip copies a string to the clipboard +// Clip copies a string to the clipboard func Clip(x string) { pgp.Clip(x) } diff --git a/impl_darwin.go b/impl_darwin.go index 708df3c..ca68407 100644 --- a/impl_darwin.go +++ b/impl_darwin.go @@ -1,4 +1,5 @@ -//+build darwin +//go:build darwin +// +build darwin package passgo @@ -119,7 +120,7 @@ func init() { setAgentInfo() } -//Clip copies a string to the clipboard +// Clip copies a string to the clipboard func Clip(x string) { clip.Set(x) } diff --git a/impl_linux.go b/impl_linux.go index f5600f3..0695b2d 100644 --- a/impl_linux.go +++ b/impl_linux.go @@ -1,4 +1,5 @@ -//+build !android,linux +//go:build !android && linux +// +build !android,linux package passgo @@ -7,7 +8,7 @@ import ( "os/exec" ) -//Clip copies a string to the clipboard +// Clip copies a string to the clipboard func Clip(x string) { b := bytes.NewBuffer([]byte(x)) cmd := exec.Command("xclip") diff --git a/impl_shared.go b/impl_shared.go index 4ec07a9..0ea463e 100644 --- a/impl_shared.go +++ b/impl_shared.go @@ -1,4 +1,5 @@ -//+build darwin !android,linux +//go:build darwin || (!android && linux) +// +build darwin !android,linux package passgo diff --git a/jni_android.go b/jni_android.go index 33cffc5..beed4d3 100644 --- a/jni_android.go +++ b/jni_android.go @@ -13,11 +13,12 @@ import ( "fmt" "log" "runtime" - "unsafe" "sync" + "unsafe" ) var theJVM *C.JavaVM + type JNIEnv = C.JNIEnv func SetJVM(jvm uintptr) { @@ -33,8 +34,8 @@ type PGP C.jobject var ( fragChans map[int]chan string - chmux sync.Mutex - chint int + chmux sync.Mutex + chint int ) func (p PGP) GetId() (string, error) { diff --git a/main.go b/main.go index 73281ee..d092bc6 100644 --- a/main.go +++ b/main.go @@ -49,6 +49,8 @@ func GetStore(store *Store) error { } if _, err := os.Stat(store.Dir); os.IsNotExist(err) { store.Empty = true + } else { + store.Empty = false } id, err := ioutil.ReadFile(path.Join(store.Dir, ".gpg-id")) if err != nil {