Skip to content

Commit

Permalink
Merge branch 'master' into daniellacosse/cordova_move_cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fortuna authored Apr 10, 2024
2 parents 92cd605 + 1089944 commit f3ef3b3
Show file tree
Hide file tree
Showing 20 changed files with 183 additions and 333 deletions.
37 changes: 14 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ IMPORT_PATH=$(IMPORT_HOST)/Jigsaw-Code/outline-apps
all: android apple linux windows

ROOT_PKG=client/src/tun2socks
# Don't strip Android debug symbols so we can upload them to crash reporting tools.
ANDROID_BUILD_CMD=$(GOBIND) -a -ldflags '-w' -target=android -androidapi 19 -tags android -work

android: $(BUILDDIR)/android/tun2socks.aar

$(BUILDDIR)/android/tun2socks.aar: $(GOMOBILE)
mkdir -p "$(BUILDDIR)/android"
$(ANDROID_BUILD_CMD) -o "$@" $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks
# Don't strip Android debug symbols so we can upload them to crash reporting tools.
$(GOBIND) -target=android -androidapi 19 -tags android -work -a -ldflags '-w' -o "$@" $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks

$(BUILDDIR)/ios/Tun2socks.xcframework: $(GOMOBILE)
# -iosversion should match what outline-client supports.
$(GOBIND) -iosversion=12.0 -target=ios,iossimulator -o $@ -ldflags '-w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks
$(GOBIND) -target=ios,iossimulator -iosversion=12.0 -bundleid org.outline.tun2socks -ldflags '-w' -o "$@" $(IMPORT_PATH)/$(ROOT_PKG)/outline/tun2socks $(IMPORT_PATH)/$(ROOT_PKG)/outline/shadowsocks

$(BUILDDIR)/macos/Tun2socks.xcframework: $(GOMOBILE)
# MACOSX_DEPLOYMENT_TARGET and -iosversion should match what outline-client supports.
Expand All @@ -35,40 +34,32 @@ $(BUILDDIR)/apple/Tun2socks.xcframework: $(BUILDDIR)/ios/Tun2socks.xcframework $
find $^ -name "Tun2socks.framework" -type d | xargs -I {} echo " -framework {} " | \
xargs xcrun xcodebuild -create-xcframework -output "$@"

XGO=$(GOBIN)/xgo
TUN2SOCKS_VERSION=v1.16.11
XGO_LDFLAGS='-w -X main.version=$(TUN2SOCKS_VERSION)'
ELECTRON_PKG=$(ROOT_PKG)/outline/electron
# -w disable DWARF generation
LDFLAGS='-static -w -X main.version=$(TUN2SOCKS_VERSION)'
ELECTRON_PKG="./client/src/tun2socks/outline/electron"

# TODO: build directly when on linux
LINUX_BUILDDIR=$(BUILDDIR)/linux

linux: $(LINUX_BUILDDIR)/tun2socks

$(LINUX_BUILDDIR)/tun2socks: $(XGO)
mkdir -p "$(LINUX_BUILDDIR)/$(IMPORT_PATH)"
$(XGO) -ldflags $(XGO_LDFLAGS) --targets=linux/amd64 -dest "$(LINUX_BUILDDIR)" -pkg $(ELECTRON_PKG) .
mv "$(LINUX_BUILDDIR)/$(IMPORT_PATH)-linux-amd64" "$@"
rm -r "$(LINUX_BUILDDIR)/$(IMPORT_HOST)"
$(LINUX_BUILDDIR)/tun2socks:
mkdir -p "$(@D)"
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC='zig cc -target x86_64-linux' go build -trimpath -ldflags=--extldflags=$(LDFLAGS) -o "$@" $(ELECTRON_PKG)

# TODO: build directly when on windows
WINDOWS_BUILDDIR=$(BUILDDIR)/windows

windows: $(WINDOWS_BUILDDIR)/tun2socks.exe

$(WINDOWS_BUILDDIR)/tun2socks.exe: $(XGO)
mkdir -p "$(WINDOWS_BUILDDIR)/$(IMPORT_PATH)"
$(XGO) -ldflags $(XGO_LDFLAGS) --targets=windows/386 -dest "$(WINDOWS_BUILDDIR)" -pkg $(ELECTRON_PKG) .
mv "$(WINDOWS_BUILDDIR)/$(IMPORT_PATH)-windows-386.exe" "$@"
rm -r "$(WINDOWS_BUILDDIR)/$(IMPORT_HOST)"

$(WINDOWS_BUILDDIR)/tun2socks.exe:
mkdir -p "$(@D)"
GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC='zig cc -target x86_64-windows' go build -trimpath -ldflags=--extldflags=$(LDFLAGS) -o "$@" $(ELECTRON_PKG)

$(GOMOBILE): go.mod
env GOBIN="$(GOBIN)" go install golang.org/x/mobile/cmd/gomobile
env GOBIN="$(GOBIN)" $(GOMOBILE) init

$(XGO): go.mod
env GOBIN="$(GOBIN)" go install github.com/crazy-max/xgo
mkdir -p "$(@D)"
go build -o "$(@D)" golang.org/x/mobile/cmd/gomobile golang.org/x/mobile/cmd/gobind

go.mod: tools.go
go mod tidy
Expand Down
Binary file added client/resources/icons/osx/icon-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/resources/icons/osx/icon-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/resources/icons/osx/icon-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/resources/icons/osx/icon-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/resources/icons/osx/icon-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/resources/icons/osx/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions client/resources/original_messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,24 @@
}
}
},
"server_create_your_own_zero_state_access": {
"description": "When the user has not yet added a server to the application, the main page shows this message at the bottom.",
"message": "Don’t have a server?$NEW_LINE$Create your own at $START_OF_LINK$our website$END_OF_LINK$ or$NEW_LINE$request an $START_OF_LINK2$access key$END_OF_LINK$.",
"placeholders": {
"END_OF_LINK": {
"content": "{closeLink}"
},
"NEW_LINE": {
"content": "<br>"
},
"START_OF_LINK": {
"content": "{openLink}"
},
"START_OF_LINK2": {
"content": "{openLink2}"
}
}
},
"server_default_name": {
"description": "This is the default name for an added server when the type or name is not specified by the access key.",
"message": "Proxy Server"
Expand Down
5 changes: 2 additions & 3 deletions client/src/www/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export class App {
document.addEventListener('resume', this.syncConnectivityStateToServerCards.bind(this));

// Register handlers for events fired by Polymer components.
this.rootEl.addEventListener('PromptAddServerRequested', this.requestPromptAddServer.bind(this));
this.rootEl.$.serversView.addEventListener('add-server', this.requestPromptAddServer.bind(this));
this.rootEl.addEventListener('AddServerConfirmationRequested', this.requestAddServerConfirmation.bind(this));
this.rootEl.addEventListener('AddServerRequested', this.requestAddServer.bind(this));
this.rootEl.addEventListener('IgnoreServerRequested', this.requestIgnoreServer.bind(this));
Expand Down Expand Up @@ -300,7 +300,6 @@ export class App {
}

private requestPromptAddServer() {
this.rootEl.promptAddServer();
this.pullClipboardText();
}

Expand Down Expand Up @@ -440,7 +439,7 @@ export class App {
console.error(`Failed to read auto-connect dialog status, assuming not dismissed: ${e}`);
}
if (!dismissed) {
this.rootEl.$.serversView.$.autoConnectDialog.show();
this.rootEl.$.autoConnectDialog.show();
}
}

Expand Down
17 changes: 16 additions & 1 deletion client/src/www/ui_components/app-root.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,14 @@ export class AppRoot extends mixinBehaviors([AppLocalizeBehavior], PolymerElemen
</app-header>
<iron-pages id="pages" selected="[[page]]" attr-for-selected="name">
<servers-view name="servers" id="serversView" servers="[[servers]]" localize="[[localize]]" use-alt-access-message="[[useAltAccessMessage]]""></servers-view>
<servers-view
name="servers"
id="serversView"
servers="[[servers]]"
localize="[[localize]]"
should-show-access-key-wiki-link="[[useAltAccessMessage]]"
on-add-server="promptAddServer"
></servers-view>
<template is="dom-if" if="{{contactViewFeatureFlag}}">
<contact-view
name="contact"
Expand Down Expand Up @@ -490,6 +497,14 @@ export class AppRoot extends mixinBehaviors([AppLocalizeBehavior], PolymerElemen
root-path="[[rootPath]]"
localize="[[localize]]"
></server-rename-dialog>
<user-comms-dialog
id="autoConnectDialog"
localize="[[localize]]"
title-localization-key="auto-connect-dialog-title"
detail-localization-key="auto-connect-dialog-detail"
fire-event-on-hide="AutoConnectDialogDismissed"
></user-comms-dialog>
`;
}

Expand Down
Loading

0 comments on commit f3ef3b3

Please sign in to comment.