Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ios wireguard #53

Merged
merged 33 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
4099688
[WIP] shadowsocks implementation prepare
alexudev Dec 13, 2021
6583090
[WIP] shadowsocks implementation added
alexudev Dec 21, 2021
39e3489
Merge conflicts in .gitmodules resolved
alexudev Dec 21, 2021
56754d6
Added fastlane scripts, old ids cleaned up
alexudev Dec 22, 2021
9ca8c66
Tried to get rid of crashes on sequential vpn turn on/off
alexudev Dec 23, 2021
6a98cdf
Insert assets on project generation stage, add static versioning (mak…
alexudev Dec 23, 2021
7c46e42
Merge remote-tracking branch 'origin/dev' into ios-wireguard
alexudev Dec 31, 2021
db527be
VPN over Shadowsocks, three providers added, still unstable (testing,…
alexudev Dec 31, 2021
7131257
missing files added
alexudev Dec 31, 2021
7c05188
ShadowSocks disabled for production while in debug/testing mode
alexudev Dec 31, 2021
543bd1a
Merge remote-tracking branch 'origin/dev' into ios-wireguard
alexudev Jan 6, 2022
e1293c2
Merge remote-tracking branch 'origin/dev' into ios-wireguard
alexudev Feb 15, 2022
8591d4e
Merge remote-tracking branch 'origin/dev' into ios-wireguard
alexudev Feb 23, 2022
b20e25f
Move frameworks from extemsion to host app
alexudev Feb 23, 2022
fe9dd1d
Rename ios_compile to apple_compile since it could be used for macOS
AlexKLWS Apr 24, 2022
4bfb528
Kill prepare process if any of steps failed
AlexKLWS Apr 24, 2022
3a69107
Clean up apple compile script
AlexKLWS Apr 24, 2022
92d79eb
Clean up comments
AlexKLWS Apr 24, 2022
ba1efd5
Create and use version file from WireGuardKitGo on iOS for consistency
AlexKLWS Apr 28, 2022
0cc8fea
Improve Tun2Socks error message
AlexKLWS Apr 28, 2022
58b1c4b
Update xcode patcher to use WireGuardKitGo folder for iOS project
AlexKLWS Apr 28, 2022
0fadf03
Add potential go PATH to config build settings
AlexKLWS Apr 28, 2022
1fdcf38
Remove unused xcode_patcher
AlexKLWS Apr 28, 2022
cf08af3
Ensure Tun2Socks go deps are installed and up to date with latest go
AlexKLWS Apr 28, 2022
cc7112f
Reduce path to non-homebrew path
AlexKLWS Apr 28, 2022
531e0ad
Update README
AlexKLWS Apr 29, 2022
7ff6b64
Replace die with killProcess in apple_compile
AlexKLWS Apr 29, 2022
6674b78
Merge pull request #71 from AlexKLWS/improve-build-process
pokamest Jun 30, 2022
aa1b561
Latest updates before starting anew
alexudev Jun 30, 2022
d38e40d
Latest updates before starting anew 2
alexudev Jun 30, 2022
6744dce
QRCodeReader (WIP)
eugenyorbitsoftcom Jul 6, 2022
9aabe7c
QRCodeReader for iOS
eugenyorbitsoftcom Jul 6, 2022
240e550
Merge pull request #77 from amnezia-vpn/qr-code-native-ios
pokamest Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,12 @@ ui_*.h
Makefile*
*build-*

# fastlane
client/fastlane/report.xml
client/fastlane/build/*

# Qt-es
client/Release-iphoneos/
client/Debug-iphoneos/
client/.xcode/
client/.qmake.cache
Expand All @@ -39,6 +44,7 @@ client/qrc_*.cpp
client/ui_*.h
client/ui_*.cpp
client/Makefile*
client/fastlane/build/
client/*build-*
client/AmneziaVPN.xcodeproj
client/Debug-iphonesimulator/
Expand All @@ -48,7 +54,7 @@ client/qmlcache_loader.cpp
client/rep_ipc_interface_replica.h
client/resources_qmlcache.qrc
client/3rd/OpenVPNAdpter/build/

client/3rd/ShadowSocks/build/
# QtCreator

*.autosave
Expand Down
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
[submodule "client/3rd/OpenVPNAdapter"]
path = client/3rd/OpenVPNAdapter
url = https://github.com/ss-abramchuk/OpenVPNAdapter.git
[submodule "client/3rd/ShadowPath"]
path = client/3rd/ShadowPath
url = https://github.com/qman9501/ShadowPath
[submodule "client/3rd/outline-go-tun2socks"]
path = client/3rd/outline-go-tun2socks
url = https://github.com/Jigsaw-Code/outline-go-tun2socks.git
[submodule "client/3rd/qzxing"]
path = client/3rd/qzxing
url = https://github.com/ftylitak/qzxing.git
[submodule "client/3rd/CocoaAsyncSocket"]
path = client/3rd/CocoaAsyncSocket
url = https://github.com/robbiehanson/CocoaAsyncSocket.git
[submodule "client/3rd/CocoaLumberjack"]
path = client/3rd/CocoaLumberjack
url = https://github.com/CocoaLumberjack/CocoaLumberjack.git
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ AmneziaVPN uses a number of open source projects to work:
- [QtSsh](https://github.com/jaredtao/QtSsh) - forked form Qt Creator
- and more...

## Checking out the source code

Make sure to pull all submodules after checking out the repo.

```bash
git submodule update --init
```

## Development

Want to contribute? Welcome!
Expand All @@ -34,6 +42,58 @@ Easiest way to build your own executables - is to fork project and configure [Tr
Or you can build sources manually using Qt Creator. Qt >= 14.2 supported.
Look to the `build_macos.sh` and `build_windows.bat` scripts in `deploy` folder for details.

### How to build iOS app from source code on MacOS

1. First, make sure you have [XCode](https://developer.apple.com/xcode/) installed,
at least version 12 or higher.

2. We use `qmake` to generate the XCode project and then we "patch" it to add
extra components such as the wireguard, the browser bridge and so on. We patch
the XCode project using [xcodeproj](https://github.com/CocoaPods/Xcodeproj). To
install it:
```bash
gem install xcodeproj # probably you want to run this command with `sudo`
```
3. You also need to install go >= v1.16. If you don't have it done already,
download go from the [official website](https://golang.org/dl/) or use Homebrew.
Latest version is recommended.

4. Navigate inside client folder and generate the XCode project using our script:
```bash
cd client
./scripts/apple_compile.sh ios
```

If you have more than one version of Qt installed, you'll most likely get
a "`qmake` cannot be found in your `$PATH`" error. In this case run this script
using QT\IOS\_BIN env to set the path for the Qt5 macos build bin folder.
For example, the path could look like this:
```bash
QT_IOS_BIN="/Users/username/Qt/5.15.2/ios/bin" ./scripts/apple_compile.sh ios
```

If you get `gomobile: command not found` make sure to set PATH to the location
of the bin folder where gomobile was installed. Usually, it's in `GOPATH`.
```bash
export PATH=$(PATH):/path/to/GOPATH/bin
```

5. Xcode should automatically open. You can then run/test/archive/ship the app.

If build fails with the following error
```
make: ***
[$(PROJECTDIR)/client/build/AmneziaVPN.build/Debug-iphoneos/wireguard-go-bridge/goroot/.prepared]
Error 1
```
Add a user defined variable to both AmneziaVPN and WireGuardNetworkExtension targets' build settings with
key `PATH` and value `${PATH}/path/to/bin/folder/with/go/executable`, e.g. `${PATH}:/usr/local/go/bin`.

Build might fail with "source files not found" error the first time you try it, because modern XCode build system compiles
dependencies in parallel, and some dependencies end up being built after the ones that
require them. In this case simply restart the build.


## License
GPL v.3

Expand Down
1 change: 1 addition & 0 deletions client/3rd/CocoaAsyncSocket
Submodule CocoaAsyncSocket added at 5ddba5
1 change: 1 addition & 0 deletions client/3rd/CocoaLumberjack
Submodule CocoaLumberjack added at 70f04b
1,640 changes: 1,640 additions & 0 deletions client/3rd/PacketProcessor/PacketProcessor.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>PacketProcessor.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// CocoaAsyncSocket.h
// CocoaAsyncSocket
//
// Created by Derek Clarkson on 10/08/2015.
// CocoaAsyncSocket project is in the public domain.
//

#import <Foundation/Foundation.h>

//! Project version number for CocoaAsyncSocket.
FOUNDATION_EXPORT double cocoaAsyncSocketVersionNumber;

//! Project version string for CocoaAsyncSocket.
FOUNDATION_EXPORT const unsigned char cocoaAsyncSocketVersionString[];

#import <CocoaAsyncSocket/GCDAsyncSocket.h>
#import <CocoaAsyncSocket/GCDAsyncUdpSocket.h>
Loading