Switch from Asuka to MyGo, keeping the API client and the feature set: - servers: saved servers, passwordless and password login, proxy, self-signed certificates, per-server device tokens (Keystore), connect form, instance list sheet with switch/disconnect - sessions: virtualized list, search, new session, rename/archive/delete, running indicator, event stream keeps it live - chat: pushed window with system back bar, streaming Markdown via ui/markdown, reasoning and tool rows with image previews, footer menu (read aloud via a Kotlin TTS plugin, copy, fork), user message menu (copy, revert, fork), context usage ring and detail sheet, attachments (photos/files via the document picker), permissions - release builds allow plain http:// LAN servers (Go's net/http dials directly, no cleartext manifest needed) - a local fork of MyGo (third_party/mygo) lowers the Android host's minSdk to 24 (Android 7.0); Go 1.27.4 via mise Version 0.3.0.
52 lines
1.5 KiB
Go
52 lines
1.5 KiB
Go
package webview2
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
var (
|
|
advapi32 = syscall.NewLazyDLL("advapi32.dll") // a KnownDLL
|
|
procRegOpenKeyExW = advapi32.NewProc("RegOpenKeyExW")
|
|
procRegQueryValueExW = advapi32.NewProc("RegQueryValueExW")
|
|
procRegCloseKey = advapi32.NewProc("RegCloseKey")
|
|
)
|
|
|
|
const (
|
|
hkeyCurrentUser = 0x80000001
|
|
hkeyLocalMachine = 0x80000002
|
|
keyQueryValue = 0x0001
|
|
keyWow6432Key = 0x0200
|
|
)
|
|
|
|
// regString reads a string value from the 32-bit view of the registry,
|
|
// where EdgeUpdate records its clients.
|
|
func regString(machine bool, path, name string) string {
|
|
root := uintptr(hkeyCurrentUser)
|
|
if machine {
|
|
root = hkeyLocalMachine
|
|
}
|
|
p, err := syscall.UTF16PtrFromString(path)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
n, err := syscall.UTF16PtrFromString(name)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
var key uintptr
|
|
if r, _, _ := procRegOpenKeyExW.Call(root, uintptr(unsafe.Pointer(p)), 0, keyQueryValue|keyWow6432Key, uintptr(unsafe.Pointer(&key))); r != 0 {
|
|
return ""
|
|
}
|
|
defer procRegCloseKey.Call(key)
|
|
var typ, size uint32
|
|
if r, _, _ := procRegQueryValueExW.Call(key, uintptr(unsafe.Pointer(n)), 0, uintptr(unsafe.Pointer(&typ)), 0, uintptr(unsafe.Pointer(&size))); r != 0 || size == 0 {
|
|
return ""
|
|
}
|
|
buf := make([]uint16, size/2+1)
|
|
if r, _, _ := procRegQueryValueExW.Call(key, uintptr(unsafe.Pointer(n)), 0, uintptr(unsafe.Pointer(&typ)), uintptr(unsafe.Pointer(&buf[0])), uintptr(unsafe.Pointer(&size))); r != 0 {
|
|
return ""
|
|
}
|
|
return syscall.UTF16ToString(buf)
|
|
}
|