Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
8a74ba7f36 | ||
|
9dc732ec7b | ||
|
1f30a2d41f | ||
|
42cab1ae20 | ||
|
be3756cf2c | ||
|
03865ded52 | ||
|
0d6b0ed33a | ||
|
1d12cf2443 | ||
|
c4c041d169 | ||
|
4c2a1c3688 | ||
|
1a69d05b71 | ||
|
3e242189eb | ||
|
ccc17cca70 | ||
|
840fff178c | ||
|
1ba689f8b8 | ||
|
b89b59aacf |
@ -3,8 +3,8 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.github.howeyc.crocgui"
|
||||
android:versionCode="9"
|
||||
android:versionName="1.5.0">
|
||||
android:versionCode="16"
|
||||
android:versionName="1.8.2">
|
||||
|
||||
<application android:label="Croc">
|
||||
<activity android:name="org.golang.app.GoNativeActivity"
|
||||
|
4
Makefile
@ -2,8 +2,8 @@
|
||||
|
||||
all: crocgui.apk crocgui
|
||||
|
||||
crocgui.apk: main.go send.go recv.go settings.go about.go AndroidManifest.xml
|
||||
ANDROID_HOME=~/android ./fyne-uri-name/fyne package -os android -appID com.github.howeyc.crocgui -icon metadata/en-US/images/icon.png
|
||||
crocgui.apk: main.go send.go recv.go settings.go about.go AndroidManifest.xml fdroid-build.sh
|
||||
ANDROID_HOME=~/android bash fdroid-build.sh test
|
||||
|
||||
crocgui: main.go send.go recv.go settings.go about.go
|
||||
go build
|
||||
|
@ -9,3 +9,4 @@ Mobile Screenshot:
|
||||
|
||||
[<img width=200 alt="mobile screenshot 1" src="metadata/en-US/images/phoneScreenshots/1.png?raw=true">](metadata/en-US/images/phoneScreenshots/1.png?raw=true)
|
||||
[<img width=200 alt="mobile screenshot 2" src="metadata/en-US/images/phoneScreenshots/2.png?raw=true">](metadata/en-US/images/phoneScreenshots/2.png?raw=true)
|
||||
[<img width=200 alt="mobile screenshot 3" src="metadata/en-US/images/phoneScreenshots/3.png?raw=true">](metadata/en-US/images/phoneScreenshots/3.png?raw=true)
|
||||
|
6
about.go
@ -5,7 +5,6 @@ import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@ -14,11 +13,6 @@ import (
|
||||
"fyne.io/fyne/v2/widget"
|
||||
)
|
||||
|
||||
func parseURL(s string) *url.URL {
|
||||
link, _ := url.Parse(s)
|
||||
return link
|
||||
}
|
||||
|
||||
//go:embed metadata/en-US/full_description.txt
|
||||
var longdesc string
|
||||
|
||||
|
@ -1,21 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
curl -Lso go.tar.gz https://golang.org/dl/go1.16.linux-amd64.tar.gz
|
||||
echo "013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2 go.tar.gz" | sha256sum -c -
|
||||
mkdir -p golang
|
||||
tar -C golang -xzf go.tar.gz
|
||||
mkdir -p gopath
|
||||
export GOPATH="$PWD/gopath"
|
||||
export GO_LANG="$PWD/golang/go/bin"
|
||||
export GO_COMPILED="$PWD/bin"
|
||||
curl -Lso go.tar.gz https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
|
||||
echo "951a3c7c6ce4e56ad883f97d9db74d3d6d80d5fec77455c6ada6c1f7ac4776d2 go.tar.gz" | sha256sum -c -
|
||||
mkdir -p gobuild/golang
|
||||
tar -C gobuild/golang -xzf go.tar.gz
|
||||
mkdir -p gobuild/gopath
|
||||
mkdir -p gobuild/gocache
|
||||
export GOPATH="$PWD/gobuild/gopath"
|
||||
export GOCACHE="$PWD/gobuild/gocache"
|
||||
export GO_LANG="$PWD/gobuild/golang/go/bin"
|
||||
export GO_COMPILED="$GOPATH/bin"
|
||||
export PATH="$GO_LANG:$GO_COMPILED:$PATH"
|
||||
export PATH=$(pwd)/go/bin:$PATH
|
||||
go version
|
||||
curl -Lso fyne-uri-name.zip https://github.com/howeyc/fyne/archive/uri-name.zip
|
||||
unzip fyne-uri-name
|
||||
pushd fyne-uri-name
|
||||
go build fyne.io/fyne/v2/cmd/fyne
|
||||
popd
|
||||
./fyne-uri-name/fyne package -os android -release -appID com.github.howeyc.crocgui -icon metadata/en-US/images/icon.png
|
||||
zip -d crocgui.apk "META-INF/*"
|
||||
|
||||
go get fyne.io/fyne/v2/cmd/fyne\@v2.0.3
|
||||
fyne version
|
||||
fyne package -os android -release -appID com.github.howeyc.crocgui -icon metadata/en-US/images/icon.png
|
||||
if [[ $# -eq 0 ]]; then
|
||||
zip -d crocgui.apk "META-INF/*"
|
||||
fi
|
||||
|
7
go.mod
@ -3,8 +3,7 @@ module crocgui
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
fyne.io/fyne/v2 v2.0.0
|
||||
github.com/schollz/croc/v8 v8.6.7
|
||||
fyne.io/fyne/v2 v2.0.3
|
||||
github.com/schollz/croc/v9 v9.1.1
|
||||
github.com/schollz/logger v1.2.0
|
||||
)
|
||||
|
||||
replace fyne.io/fyne/v2 => ./fyne-uri-name
|
||||
|
90
go.sum
@ -1,10 +1,12 @@
|
||||
fyne.io/fyne/v2 v2.0.0 h1:TfsS3bNq5663BpXsoz1OfzyjcaMqqOf9usI8ZKkw4IE=
|
||||
fyne.io/fyne/v2 v2.0.0/go.mod h1:FmobqvPpBW+nG1nDyxZWf1SQLED9g/vXIxiIIVjHazY=
|
||||
fyne.io/fyne/v2 v2.0.3 h1:qzd2uLLrAVrNeqnLY44QZCsMxZwjoo1my+lMzHicMXY=
|
||||
fyne.io/fyne/v2 v2.0.3/go.mod h1:nNpgL7sZkDVLraGtQII2ArNRnnl6kHup/KfQRxIhbvs=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9 h1:1ltqoej5GtaWF8jaiA49HwsZD459jqm9YFz9ZtMFpQA=
|
||||
github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I=
|
||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
|
||||
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
|
||||
github.com/akavel/rsrc v0.8.0 h1:zjWn7ukO9Kc5Q62DOJCcxGpXC18RawVtYAGdz2aLlfw=
|
||||
github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c=
|
||||
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
@ -19,56 +21,62 @@ github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8
|
||||
github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8=
|
||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||
github.com/fyne-io/mobile v0.1.2 h1:0HaXDtOOwyOTn3Umi0uKVCOgJtfX73c6unC4U8i5VZU=
|
||||
github.com/fyne-io/mobile v0.1.2/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||
github.com/fyne-io/mobile v0.1.3-0.20210312180903-f9a21000f5dc h1:A5hFL3tVUfFHhVpjmLGPs8SdVIcSkTRpFMm1Vsio5+k=
|
||||
github.com/fyne-io/mobile v0.1.3-0.20210312180903-f9a21000f5dc/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a h1:3TAJhl8vXyli0tooKB0vd6gLCyBdWL4QEYbDoJpHEZk=
|
||||
github.com/fyne-io/mobile v0.1.3-0.20210412090810-650a3139866a/go.mod h1:/kOrWrZB6sasLbEy2JIvr4arEzQTXBTZGb3Y96yWbHY=
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
|
||||
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3 h1:q521PfSp5/z6/sD9FZZOWj4d1MLmfQW8PkRnI9M6PCE=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200625191551-73d3c3675aa3/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/godbus/dbus/v5 v5.0.3 h1:ZqHaoEF7TBzh4jzPmqVhE/5A1z9of6orkAe5uHoAeME=
|
||||
github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb h1:T6gaWBvRzJjuOrdCtg8fXXjKai2xSDqWTcKFUPuw8Tw=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210410170116-ea3d685f79fb/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/godbus/dbus/v5 v5.0.4 h1:9349emZab16e7zQvpmsbtjc18ykshndd8y2PG3sgJbA=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8=
|
||||
github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw=
|
||||
github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526 h1:NfuKjkj/Xc2z1xZIj+EmNCm5p1nKJPyw3F4E20usXvg=
|
||||
github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc=
|
||||
github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca h1:ozPUX9TKQZVek4lZWYRsQo7uS8vJ+q4OOHvRhHiCLfU=
|
||||
github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE=
|
||||
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
|
||||
github.com/kalafut/imohash v1.0.0 h1:LgCJ+p/BwM2HKpOxFopkeddpzVCfm15EtXMroXD1SYE=
|
||||
github.com/kalafut/imohash v1.0.0/go.mod h1:c3RHT80ZAp5C/aYgQI92ZlrOymqkZnRDprU87kg75HI=
|
||||
github.com/kalafut/imohash v1.0.2 h1:j/cUPa15YvXv7abJlM+kdJIycbBMpmO7WqhPl4YB76I=
|
||||
github.com/kalafut/imohash v1.0.2/go.mod h1:PjHBF0vpo1q7zMqiTn0qwSTQU2wDn5QIe8S8sFQuZS8=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a h1:4djPngMU3ttoFCf6DOgPNQYmxyNmRRmpLg4/uz2TTEg=
|
||||
github.com/lucor/goinfo v0.0.0-20200401173949-526b5363a13a/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=
|
||||
github.com/lucor/goinfo v0.0.0-20210209132455-aee5dbc9b821/go.mod h1:ORP3/rB5IsulLEBwQZCJyyV6niqmI7P4EWSmkug+1Ng=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=
|
||||
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
|
||||
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/schollz/cli/v2 v2.2.1/go.mod h1:My6bfphRLZUhZdlFUK8scAxMWHydE7k4s2ed2Dtnn+s=
|
||||
github.com/schollz/croc/v8 v8.6.7 h1:f9bqaZF8WbYefNjibjaluBoodGHgI/X8YP1PDLeMNXo=
|
||||
github.com/schollz/croc/v8 v8.6.7/go.mod h1:RuVVzLi6P1tnWXhcta7cfyITHHAavaWVOKZrhH4fCSE=
|
||||
github.com/schollz/croc/v9 v9.1.1 h1:yCZrdzdzkHHC+7kRUrqPuHu9iCDQfKOfbogIFK7gNlM=
|
||||
github.com/schollz/croc/v9 v9.1.1/go.mod h1:hP8kIHrhdvZMZ82af1F1zz2fSal82DcRtlrMFMU9zWU=
|
||||
github.com/schollz/logger v1.2.0 h1:5WXfINRs3lEUTCZ7YXhj0uN+qukjizvITLm3Ca2m0Ho=
|
||||
github.com/schollz/logger v1.2.0/go.mod h1:P6F4/dGMGcx8wh+kG1zrNEd4vnNpEBY/mwEMd/vn6AM=
|
||||
github.com/schollz/mnemonicode v1.0.1 h1:LiH5hwADZwjwnfXsaD4xgnMyTAtaKHN+e5AyjRU6WSU=
|
||||
github.com/schollz/mnemonicode v1.0.1/go.mod h1:cl4UAOhUV0mkdjMj/QYaUZbZZdF8BnOqoz8rHMzwboY=
|
||||
github.com/schollz/pake/v2 v2.0.6 h1:+x8vTmj4uPHe7TNBcCjcwDmm9uMeFIEqh34u+5a+CCY=
|
||||
github.com/schollz/pake/v2 v2.0.6/go.mod h1:0NENjRsJxJQQ23Ei2fMSPo/mOtURNk/BWr3Cr9zpJ0w=
|
||||
github.com/schollz/peerdiscovery v1.6.2 h1:EE1mnCuiQXbp8sG0z0qx9xkuU2Eho6LgcwD3LfnNIlQ=
|
||||
github.com/schollz/peerdiscovery v1.6.2/go.mod h1:rvHXqW4PX4F14ehw8CLQSQFsb14YGLAeYYshxZV5fWE=
|
||||
github.com/schollz/progressbar/v3 v3.7.2 h1:0mjLacO6y9vSdcopQ8TEK8AsIWFJXTVU9eJDkoR/MkE=
|
||||
github.com/schollz/progressbar/v3 v3.7.2/go.mod h1:CG/f0JmacksUc6TkZToO7tVq4t03zIQSQUtTd7F9GR4=
|
||||
github.com/schollz/pake/v3 v3.0.1 h1:vEU8obNI2aB+3cVjqBk+WqS61p6biVCAcjYLrc7k56s=
|
||||
github.com/schollz/pake/v3 v3.0.1/go.mod h1:U8udmizi/9pb5OqW+ieb4ebU5wGCqnLhXqYXSJRpeD4=
|
||||
github.com/schollz/peerdiscovery v1.6.3 h1:qoawrl3GBwf8ff3Itb0QkaUGDb2k40NwE24MEgFL4Gc=
|
||||
github.com/schollz/peerdiscovery v1.6.3/go.mod h1:xpt6HDA944jqSLzJMLreYtmhWeS2OW2XW4ZLmCezi00=
|
||||
github.com/schollz/progressbar/v3 v3.7.6 h1:akAvVpTy2IAcePWYndctoBaY9bLE3z4LE1Hn91BJ9g4=
|
||||
github.com/schollz/progressbar/v3 v3.7.6/go.mod h1:Y9mmL2knZj3LUaBDyBEzFdPrymIr08hnlFMZmfxwbx4=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||
@ -87,23 +95,27 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 h1:tZWtuLE+LbUwT4OP1oWBSB9zXA8qmQ5qEm4kV9R72oo=
|
||||
github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094/go.mod h1:KL9+ubr1JZdaKjgAaHr+tCytEncXBa1pR6FjbTsOJnw=
|
||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||
github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk=
|
||||
github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
|
||||
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
|
||||
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc h1:+q90ECDSAQirdykUN6sPEiBXBsp8Csjcca8Oy7bgLTA=
|
||||
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8 h1:6WW6V3x1P/jokJBpRQYUJnMHRP6isStQwCozxnU7XQw=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw=
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d h1:BgJvlyh+UqCUaPlscHJ+PN8GcpfrFdr7NHjd1JL0+Gs=
|
||||
golang.org/x/net v0.0.0-20210415231046-e915ea6b2b7d/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@ -113,25 +125,30 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201113135734-0a15ea8d9b02/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo=
|
||||
golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210223095934-7937bea0104d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c h1:6L+uOeS3OQt/f4eFHXZcTxeZrGCuz+CLElgEBjbcTA4=
|
||||
golang.org/x/sys v0.0.0-20210415045647-66c3f260301c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
|
||||
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72 h1:VqE9gduFZ4dbR7XoL77lHFp0/DyDUBKSXK7CMFkVcV0=
|
||||
golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc=
|
||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190808195139-e713427fea3f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03 h1:XpToik3MpT5iW3iHgNwnh3a8QwugfomvxOlyDnaOils=
|
||||
golang.org/x/tools v0.0.0-20200328031815-3db5fc6bac03/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
@ -140,7 +157,6 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8
|
||||
gopkg.in/tylerb/is.v1 v1.1.2 h1:AB/MANFml2ySf+adwcinvajyHvsYltAOD+rb/8njfSU=
|
||||
gopkg.in/tylerb/is.v1 v1.1.2/go.mod h1:9yQB2tyIhZ5oph6Kk5Sq7cJMd9c5Jpa1p3hr9kxzPqo=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
42
main.go
@ -1,22 +1,57 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
log "github.com/schollz/logger"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
"fyne.io/fyne/v2/canvas"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
)
|
||||
|
||||
//go:embed metadata/en-US/images/featureGraphic.png
|
||||
var textlogobytes []byte
|
||||
|
||||
type logwriter struct {
|
||||
buf bytes.Buffer
|
||||
lastlines []string
|
||||
lastupdate time.Time
|
||||
}
|
||||
|
||||
const LOG_LINES = 20
|
||||
|
||||
func (lw *logwriter) Write(p []byte) (n int, err error) {
|
||||
n, err = lw.buf.Write(p)
|
||||
|
||||
lw.lastlines = append([]string{string(p)}, lw.lastlines...)
|
||||
if len(lw.lastlines) > LOG_LINES {
|
||||
lw.lastlines = lw.lastlines[:LOG_LINES]
|
||||
}
|
||||
|
||||
if time.Since(lw.lastupdate) > time.Second {
|
||||
logbinding.Set(strings.Join(lw.lastlines, ""))
|
||||
lw.lastupdate = time.Now()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
var logoutput logwriter
|
||||
var logbinding binding.String
|
||||
|
||||
func main() {
|
||||
a := app.NewWithID("com.github.howeyc.crocgui")
|
||||
w := a.NewWindow("croc")
|
||||
|
||||
logbinding = binding.NewString()
|
||||
log.SetOutput(&logoutput)
|
||||
|
||||
// Defaults
|
||||
a.Preferences().SetString("relay-address", a.Preferences().StringWithFallback("relay-address", "croc.schollz.com:9009"))
|
||||
a.Preferences().SetString("relay-password", a.Preferences().StringWithFallback("relay-password", "pass123"))
|
||||
@ -26,8 +61,12 @@ func main() {
|
||||
a.Preferences().SetBool("disable-multiplexing", a.Preferences().BoolWithFallback("disable-multiplexing", false))
|
||||
a.Preferences().SetBool("disable-compression", a.Preferences().BoolWithFallback("disable-compression", false))
|
||||
a.Preferences().SetString("theme", a.Preferences().StringWithFallback("theme", "light"))
|
||||
a.Preferences().SetString("debug-level", a.Preferences().StringWithFallback("debug-level", "error"))
|
||||
a.Preferences().SetString("pake-curve", a.Preferences().StringWithFallback("pake-curve", "siec"))
|
||||
a.Preferences().SetString("croc-hash", a.Preferences().StringWithFallback("croc-hash", "xxhash"))
|
||||
|
||||
setTheme(a.Preferences().String("theme"))
|
||||
log.SetLevel(a.Preferences().String("debug-level"))
|
||||
|
||||
textlogores := fyne.NewStaticResource("text-logo", textlogobytes)
|
||||
textlogo := canvas.NewImageFromResource(textlogores)
|
||||
@ -41,5 +80,8 @@ func main() {
|
||||
aboutTabItem(),
|
||||
)))
|
||||
w.Resize(fyne.NewSize(800, 600))
|
||||
|
||||
setDebugObjects()
|
||||
|
||||
w.ShowAndRun()
|
||||
}
|
||||
|
3
metadata/en-US/changelogs/10.txt
Normal file
@ -0,0 +1,3 @@
|
||||
- Settings are scrollable
|
||||
- Add debug logging
|
||||
- Update croc from v8.6.7 to v8.6.12
|
2
metadata/en-US/changelogs/11.txt
Normal file
@ -0,0 +1,2 @@
|
||||
- Add cancel send button
|
||||
- User can change/set send code
|
1
metadata/en-US/changelogs/12.txt
Normal file
@ -0,0 +1 @@
|
||||
- Save dialog has filename
|
1
metadata/en-US/changelogs/13.txt
Normal file
@ -0,0 +1 @@
|
||||
- Fix receive filename dialog
|
2
metadata/en-US/changelogs/14.txt
Normal file
@ -0,0 +1,2 @@
|
||||
- Update to croc cli v9
|
||||
- PAKE Curve setting
|
2
metadata/en-US/changelogs/15.txt
Normal file
@ -0,0 +1,2 @@
|
||||
- Update to croc cli v9
|
||||
- PAKE Curve setting
|
2
metadata/en-US/changelogs/16.txt
Normal file
@ -0,0 +1,2 @@
|
||||
- new icon
|
||||
- croc hash algorithm selection
|
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 119 KiB |
Before Width: | Height: | Size: 176 KiB After Width: | Height: | Size: 112 KiB |
BIN
metadata/en-US/images/phoneScreenshots/3.png
Normal file
After Width: | Height: | Size: 231 KiB |
45
recv.go
@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
@ -12,24 +11,42 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
log "github.com/schollz/logger"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/schollz/croc/v8/src/croc"
|
||||
"github.com/schollz/croc/v9/src/croc"
|
||||
)
|
||||
|
||||
func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
logInfo := widget.NewLabelWithData(logbinding)
|
||||
logInfo.Wrapping = fyne.TextWrapWord
|
||||
|
||||
status := widget.NewLabel("")
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
status.SetText(fmt.Sprint(r))
|
||||
logInfo.SetText(fmt.Sprint(r))
|
||||
}
|
||||
}()
|
||||
|
||||
recvDir, _ := os.MkdirTemp("", "crocgui-recv")
|
||||
|
||||
debugBox := container.NewHBox(widget.NewLabel("Debug log:"), layout.NewSpacer(), widget.NewButton("Export full log", func() {
|
||||
savedialog := dialog.NewFileSave(func(f fyne.URIWriteCloser, e error) {
|
||||
if f != nil {
|
||||
logoutput.buf.WriteTo(f)
|
||||
f.Close()
|
||||
}
|
||||
}, w)
|
||||
savedialog.SetFileName("crocdebuglog.txt")
|
||||
savedialog.Show()
|
||||
}))
|
||||
debugObjects = append(debugObjects, debugBox)
|
||||
|
||||
prog := widget.NewProgressBar()
|
||||
prog.Hide()
|
||||
recvEntry := widget.NewEntry()
|
||||
@ -42,7 +59,7 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
receiver, err := croc.New(croc.Options{
|
||||
IsSender: false,
|
||||
SharedSecret: recvEntry.Text,
|
||||
Debug: false,
|
||||
Debug: crocDebugMode(),
|
||||
RelayAddress: a.Preferences().String("relay-address"),
|
||||
RelayPassword: a.Preferences().String("relay-password"),
|
||||
Stdout: false,
|
||||
@ -51,10 +68,16 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
NoMultiplexing: a.Preferences().Bool("disable-multiplexing"),
|
||||
OnlyLocal: a.Preferences().Bool("force-local"),
|
||||
NoCompress: a.Preferences().Bool("disable-compression"),
|
||||
Curve: a.Preferences().String("pake-curve"),
|
||||
HashAlgorithm: a.Preferences().String("croc-hash"),
|
||||
})
|
||||
if err != nil {
|
||||
log.Println("Receive setup error:", err)
|
||||
log.Error("Receive setup error:", err)
|
||||
return
|
||||
}
|
||||
log.SetLevel(crocDebugLevel())
|
||||
log.Trace("croc receiver created")
|
||||
|
||||
prog.Show()
|
||||
donechan := make(chan bool)
|
||||
var filename string
|
||||
@ -81,7 +104,7 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
}()
|
||||
cderr := os.Chdir(recvDir)
|
||||
if cderr != nil {
|
||||
log.Println("Unable to change to dir:", recvDir, cderr)
|
||||
log.Error("Unable to change to dir:", recvDir, cderr)
|
||||
}
|
||||
status.SetText("")
|
||||
rerr := receiver.Receive()
|
||||
@ -90,7 +113,7 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
prog.SetValue(0)
|
||||
topline.SetText("Enter code to download")
|
||||
if rerr != nil {
|
||||
status.Text = "Receive failed: " + rerr.Error()
|
||||
log.Error("Receive failed: " + rerr.Error())
|
||||
} else {
|
||||
filesReceived := make([]string, len(receivednames))
|
||||
var i int
|
||||
@ -120,18 +143,20 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
ofile = f
|
||||
oerr = e
|
||||
if oerr != nil {
|
||||
status.SetText(oerr.Error())
|
||||
log.Error(oerr.Error())
|
||||
return
|
||||
}
|
||||
ifile, ierr := os.Open(path)
|
||||
if ierr != nil {
|
||||
status.SetText(ierr.Error())
|
||||
log.Error(ierr.Error())
|
||||
return
|
||||
}
|
||||
io.Copy(ofile, ifile)
|
||||
ifile.Close()
|
||||
ofile.Close()
|
||||
os.Remove(path)
|
||||
log.Tracef("saved (%s) to user path %s", path, f.URI().String())
|
||||
log.Tracef("remove internal cache file %s", path)
|
||||
diagwg.Done()
|
||||
}, w)
|
||||
savedialog.SetFileName(filepath.Base(path))
|
||||
@ -144,6 +169,8 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
}),
|
||||
prog,
|
||||
status,
|
||||
debugBox,
|
||||
logInfo,
|
||||
))
|
||||
|
||||
}
|
||||
|
142
send.go
@ -3,37 +3,41 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
log "github.com/schollz/logger"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/dialog"
|
||||
"fyne.io/fyne/v2/layout"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
"github.com/schollz/croc/v8/src/croc"
|
||||
"github.com/schollz/croc/v8/src/utils"
|
||||
"github.com/schollz/croc/v9/src/croc"
|
||||
"github.com/schollz/croc/v9/src/utils"
|
||||
)
|
||||
|
||||
func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
logInfo := widget.NewLabelWithData(logbinding)
|
||||
logInfo.Wrapping = fyne.TextWrapWord
|
||||
|
||||
status := widget.NewLabel("")
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
status.SetText(fmt.Sprint(r))
|
||||
log.Error(fmt.Sprint(r))
|
||||
}
|
||||
}()
|
||||
prog := widget.NewProgressBar()
|
||||
prog.Hide()
|
||||
topline := widget.NewLabel("Pick a file to send")
|
||||
var currentCode string
|
||||
randomCode := utils.GetRandomName()
|
||||
sendEntry := widget.NewEntry()
|
||||
sendEntry.SetText(randomCode)
|
||||
copyCodeButton := widget.NewButtonWithIcon("", theme.ContentCopyIcon(), func() {
|
||||
if currentCode != "" {
|
||||
w.Clipboard().SetContent(currentCode)
|
||||
}
|
||||
w.Clipboard().SetContent(sendEntry.Text)
|
||||
})
|
||||
copyCodeButton.Hide()
|
||||
|
||||
@ -45,30 +49,36 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
addFileButton := widget.NewButtonWithIcon("", theme.FileIcon(), func() {
|
||||
dialog.ShowFileOpen(func(f fyne.URIReadCloser, e error) {
|
||||
if e != nil {
|
||||
log.Errorf("Open dialog error: %s", e.Error())
|
||||
return
|
||||
}
|
||||
if f != nil {
|
||||
nfile, oerr := os.Create(filepath.Join(sendDir, f.URI().Name()))
|
||||
if oerr != nil {
|
||||
status.SetText(fmt.Sprintf("Unable to copy file, error: %s - %s", sendDir, oerr.Error()))
|
||||
log.Errorf("Unable to copy file, error: %s - %s\n", sendDir, oerr.Error())
|
||||
return
|
||||
}
|
||||
io.Copy(nfile, f)
|
||||
nfile.Close()
|
||||
fpath := nfile.Name()
|
||||
log.Tracef("Android URI (%s), copied to internal cache %s", f.URI().String(), nfile.Name())
|
||||
|
||||
_, sterr := os.Stat(fpath)
|
||||
if sterr != nil {
|
||||
status.SetText(fmt.Sprintf("Stat error: %s - %s", fpath, sterr.Error()))
|
||||
log.Errorf("Stat error: %s - %s\n", fpath, sterr.Error())
|
||||
return
|
||||
}
|
||||
labelFile := widget.NewLabel(filepath.Base(fpath))
|
||||
newentry := container.NewHBox(labelFile, layout.NewSpacer(), widget.NewButtonWithIcon("", theme.CancelIcon(), func() {
|
||||
// Can only add/remove if not currently attempting a send
|
||||
if !sendEntry.Disabled() {
|
||||
if fe, ok := fileentries[fpath]; ok {
|
||||
boxholder.Remove(fe)
|
||||
os.Remove(fpath)
|
||||
log.Tracef("Removed file from internal cache: %s", fpath)
|
||||
delete(fileentries, fpath)
|
||||
}
|
||||
}
|
||||
}))
|
||||
fileentries[fpath] = newentry
|
||||
boxholder.Add(newentry)
|
||||
@ -76,22 +86,59 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
}, w)
|
||||
})
|
||||
|
||||
return container.NewTabItemWithIcon("Send", theme.MailSendIcon(),
|
||||
container.NewVBox(
|
||||
container.NewHBox(topline, layout.NewSpacer(), addFileButton),
|
||||
boxholder,
|
||||
widget.NewButtonWithIcon("Send", theme.MailSendIcon(), func() {
|
||||
debugBox := container.NewHBox(widget.NewLabel("Debug log:"), layout.NewSpacer(), widget.NewButton("Export full log", func() {
|
||||
savedialog := dialog.NewFileSave(func(f fyne.URIWriteCloser, e error) {
|
||||
if f != nil {
|
||||
logoutput.buf.WriteTo(f)
|
||||
f.Close()
|
||||
}
|
||||
}, w)
|
||||
savedialog.SetFileName("crocdebuglog.txt")
|
||||
savedialog.Show()
|
||||
}))
|
||||
debugObjects = append(debugObjects, debugBox)
|
||||
|
||||
cancelchan := make(chan bool)
|
||||
activeButtonHolder := container.NewVBox()
|
||||
var cancelButton, sendButton *widget.Button
|
||||
|
||||
resetSender := func() {
|
||||
prog.Hide()
|
||||
prog.SetValue(0)
|
||||
for _, obj := range activeButtonHolder.Objects {
|
||||
activeButtonHolder.Remove(obj)
|
||||
}
|
||||
activeButtonHolder.Add(sendButton)
|
||||
|
||||
for fpath, fe := range fileentries {
|
||||
boxholder.Remove(fe)
|
||||
os.Remove(fpath)
|
||||
log.Tracef("Removed file from internal cache: %s", fpath)
|
||||
delete(fileentries, fpath)
|
||||
}
|
||||
|
||||
topline.SetText("Pick a file to send")
|
||||
addFileButton.Show()
|
||||
if sendEntry.Text == randomCode {
|
||||
randomCode = utils.GetRandomName()
|
||||
sendEntry.SetText(randomCode)
|
||||
}
|
||||
copyCodeButton.Hide()
|
||||
sendEntry.Enable()
|
||||
}
|
||||
|
||||
sendButton = widget.NewButtonWithIcon("Send", theme.MailSendIcon(), func() {
|
||||
// Only send if files selected
|
||||
if len(fileentries) < 1 {
|
||||
log.Error("no files selected")
|
||||
return
|
||||
}
|
||||
|
||||
addFileButton.Hide()
|
||||
randomName := utils.GetRandomName()
|
||||
sender, err := croc.New(croc.Options{
|
||||
IsSender: true,
|
||||
SharedSecret: randomName,
|
||||
Debug: false,
|
||||
SharedSecret: sendEntry.Text,
|
||||
Debug: crocDebugMode(),
|
||||
RelayAddress: a.Preferences().String("relay-address"),
|
||||
RelayPorts: strings.Split(a.Preferences().String("relay-ports"), ","),
|
||||
RelayPassword: a.Preferences().String("relay-password"),
|
||||
@ -101,16 +148,26 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
NoMultiplexing: a.Preferences().Bool("disable-multiplexing"),
|
||||
OnlyLocal: a.Preferences().Bool("force-local"),
|
||||
NoCompress: a.Preferences().Bool("disable-compression"),
|
||||
Curve: a.Preferences().String("pake-curve"),
|
||||
HashAlgorithm: a.Preferences().String("croc-hash"),
|
||||
})
|
||||
if err != nil {
|
||||
status.SetText("croc error: " + err.Error())
|
||||
log.Errorf("croc error: %s\n", err.Error())
|
||||
return
|
||||
}
|
||||
log.SetLevel(crocDebugLevel())
|
||||
log.Trace("croc sender created")
|
||||
|
||||
var filename string
|
||||
status.SetText("Receive Code: " + randomName)
|
||||
currentCode = randomName
|
||||
status.SetText("Receive Code: " + sendEntry.Text)
|
||||
copyCodeButton.Show()
|
||||
prog.Show()
|
||||
|
||||
for _, obj := range activeButtonHolder.Objects {
|
||||
activeButtonHolder.Remove(obj)
|
||||
}
|
||||
activeButtonHolder.Add(cancelButton)
|
||||
|
||||
donechan := make(chan bool)
|
||||
sendnames := make(map[string]int)
|
||||
go func() {
|
||||
@ -138,32 +195,43 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
|
||||
for fpath := range fileentries {
|
||||
filepaths = append(filepaths, fpath)
|
||||
}
|
||||
sendEntry.Disable()
|
||||
serr := sender.Send(croc.TransferOptions{
|
||||
PathToFiles: filepaths,
|
||||
})
|
||||
donechan <- true
|
||||
prog.Hide()
|
||||
prog.SetValue(0)
|
||||
for _, fpath := range filepaths {
|
||||
if fe, ok := fileentries[fpath]; ok {
|
||||
boxholder.Remove(fe)
|
||||
os.Remove(fpath)
|
||||
delete(fileentries, fpath)
|
||||
}
|
||||
}
|
||||
|
||||
topline.SetText("Pick a file to send")
|
||||
addFileButton.Show()
|
||||
if serr != nil {
|
||||
log.Println("Send failed:", serr)
|
||||
log.Errorf("Send failed: %s\n", serr)
|
||||
} else {
|
||||
status.SetText(fmt.Sprintf("Sent file %s", filename))
|
||||
}
|
||||
currentCode = ""
|
||||
copyCodeButton.Hide()
|
||||
resetSender()
|
||||
}()
|
||||
}),
|
||||
go func() {
|
||||
select {
|
||||
case <-cancelchan:
|
||||
donechan <- true
|
||||
status.SetText("Send cancelled.")
|
||||
}
|
||||
resetSender()
|
||||
}()
|
||||
})
|
||||
|
||||
cancelButton = widget.NewButtonWithIcon("Cancel", theme.CancelIcon(), func() {
|
||||
cancelchan <- true
|
||||
})
|
||||
|
||||
activeButtonHolder.Add(sendButton)
|
||||
|
||||
return container.NewTabItemWithIcon("Send", theme.MailSendIcon(),
|
||||
container.NewVBox(
|
||||
container.NewHBox(topline, layout.NewSpacer(), addFileButton),
|
||||
widget.NewForm(&widget.FormItem{Text: "Send Code", Widget: sendEntry}),
|
||||
boxholder,
|
||||
activeButtonHolder,
|
||||
prog,
|
||||
container.NewHBox(status, copyCodeButton),
|
||||
debugBox,
|
||||
logInfo,
|
||||
))
|
||||
}
|
||||
|
71
settings.go
@ -3,6 +3,8 @@ package main
|
||||
import (
|
||||
"crocgui/internal/croctheme"
|
||||
|
||||
log "github.com/schollz/logger"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/data/binding"
|
||||
@ -25,6 +27,32 @@ func setTheme(themeName string) {
|
||||
}
|
||||
}
|
||||
|
||||
func crocDebugMode() bool {
|
||||
switch fyne.CurrentApp().Preferences().String("debug-level") {
|
||||
case "trace", "debug":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func crocDebugLevel() string {
|
||||
return fyne.CurrentApp().Preferences().String("debug-level")
|
||||
}
|
||||
|
||||
var debugObjects []fyne.CanvasObject
|
||||
|
||||
func setDebugObjects() {
|
||||
debugging := crocDebugMode()
|
||||
for _, obj := range debugObjects {
|
||||
if debugging {
|
||||
obj.Show()
|
||||
} else {
|
||||
obj.Hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func settingsTabItem(a fyne.App) *container.TabItem {
|
||||
themeBinding := binding.BindPreferenceString("theme", a.Preferences())
|
||||
themeSelect := widget.NewSelect([]string{"light", "dark", "black"}, func(selection string) {
|
||||
@ -33,7 +61,40 @@ func settingsTabItem(a fyne.App) *container.TabItem {
|
||||
})
|
||||
currentTheme, _ := themeBinding.Get()
|
||||
themeSelect.SetSelected(currentTheme)
|
||||
return container.NewTabItemWithIcon("Settings", theme.SettingsIcon(), container.NewVBox(
|
||||
|
||||
curveBinding := binding.BindPreferenceString("pake-curve", a.Preferences())
|
||||
curveSelect := widget.NewSelect([]string{"siec", "p256", "p348", "p521"}, func(selection string) {
|
||||
curveBinding.Set(selection)
|
||||
})
|
||||
currentCurve, _ := curveBinding.Get()
|
||||
curveSelect.SetSelected(currentCurve)
|
||||
|
||||
hashBinding := binding.BindPreferenceString("croc-hash", a.Preferences())
|
||||
hashSelect := widget.NewSelect([]string{"imohash", "md5", "xxhash"}, func(selection string) {
|
||||
hashBinding.Set(selection)
|
||||
})
|
||||
currentHash, _ := hashBinding.Get()
|
||||
hashSelect.SetSelected(currentHash)
|
||||
|
||||
debugLevelBinding := binding.BindPreferenceString("debug-level", a.Preferences())
|
||||
debugCheck := widget.NewCheck("Enable Debug Log", func(debug bool) {
|
||||
if debug {
|
||||
log.SetLevel("trace")
|
||||
debugLevelBinding.Set("trace")
|
||||
} else {
|
||||
log.SetLevel("error")
|
||||
debugLevelBinding.Set("error")
|
||||
}
|
||||
setDebugObjects()
|
||||
})
|
||||
debugCheck.SetChecked(crocDebugMode())
|
||||
|
||||
return container.NewTabItemWithIcon("Settings", theme.SettingsIcon(), container.NewVScroll(container.NewVBox(
|
||||
widget.NewLabelWithStyle("Appearance", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||
widget.NewForm(
|
||||
widget.NewFormItem("Theme", themeSelect),
|
||||
),
|
||||
widget.NewSeparator(),
|
||||
widget.NewLabelWithStyle("Relay", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||
widget.NewForm(
|
||||
widget.NewFormItem("Address", widget.NewEntryWithData(binding.BindPreferenceString("relay-address", a.Preferences()))),
|
||||
@ -49,13 +110,15 @@ func settingsTabItem(a fyne.App) *container.TabItem {
|
||||
widget.NewSeparator(),
|
||||
widget.NewLabelWithStyle("Transfer Options", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||
widget.NewForm(
|
||||
widget.NewFormItem("PAKE Curve", curveSelect),
|
||||
widget.NewFormItem("Hash Algorithm", hashSelect),
|
||||
widget.NewFormItem("", widget.NewCheckWithData("Disable Multiplexing", binding.BindPreferenceBool("disable-multiplexing", a.Preferences()))),
|
||||
widget.NewFormItem("", widget.NewCheckWithData("Disable Compression", binding.BindPreferenceBool("disable-compression", a.Preferences()))),
|
||||
),
|
||||
widget.NewSeparator(),
|
||||
widget.NewLabelWithStyle("Appearance", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||
widget.NewLabelWithStyle("Debug", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||
widget.NewForm(
|
||||
widget.NewFormItem("Theme", themeSelect),
|
||||
widget.NewFormItem("", debugCheck),
|
||||
),
|
||||
))
|
||||
)))
|
||||
}
|
||||
|
@ -1000,6 +1000,32 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
github.com/rivo/uniseg
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Oliver Kuederle
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
github.com/russross/blackfriday/v2
|
||||
|
||||
Blackfriday is distributed under the Simplified BSD License:
|
||||
@ -1059,7 +1085,7 @@ SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
github.com/schollz/croc/v8
|
||||
github.com/schollz/croc/v9
|
||||
|
||||
MIT License
|
||||
|
||||
@ -1609,32 +1635,6 @@ SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
github.com/urfave/cli/v2
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Jeremy Saenz & Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
github.com/yuin/goldmark
|
||||
|
||||
MIT License
|
||||
|