Code Monkey home page Code Monkey logo

ios-mac-app's Introduction

Proton VPN for iOS and macOS

Copyright (c) 2023 Proton Technologies AG

Dependencies

This project uses Swift Package Manager for all of it's dependencies. Allow Xcode to resolve packages before running any target.

Third-party dependencies

ACKNOWLEDGEMENTS.md

Setup

  • Enable Git LFS on your machine
  • Clone this repository
  • Make sure you have go installed (brew install go)
  • Configure code signing for all targets with a paid Apple developer account (required due to VPN entitlements) and change the bundle identifiers to something unique
  • Clean build folder in Xcode (Cmd+Shift+K)

Obfuscated Constants

A set of secrets is required in order to build the project. These include URLs and keys, and are kept in files named ObfuscatedConstants.swift. These files are kept in a seperate repository, which requires some additional setup to keep synchronised.

Firstly, invoke the script located at scripts/credentials.sh with the setup command. Provide the path where you wish the secrets repository to be cloned locally using the -p argument, and the url of the repository using the -r argument.

./scripts/credentials.sh setup -p <path to credentials repo> -r <credentials remote>

Then, to verify that setup has been successful:

./scripts/credentials.sh checkout

If setup correctly, obfuscated constants will be automatically synchronised during the Generate Obfuscated Constants build phase of each app.

Package Structure

The project is packaged by layer in order to avoid module dependency hell:

  • Foundations: small, single-purpose libraries for building bigger things. These should only ever link each other, if they do so at all.
  • Shared: slightly larger libraries meant for sharing code between applications or extensions. Portions of this library that get too big or would benefit from being their own module can be broken out into Foundations. These should only ever link Foundations libraries, with the possible exception of these libraries each linking CoreCommon .
  • Features: self-contained libraries containing a single feature. These libraries should only ever link libraries from the Shared or Foundations categories. They are included and instantiated within application, test, or extension code.

Adding new code/feature to LegacyCommon and NEHelper should be avoided if possible. These packages should be gradually chipped away at in order to place their components into new/existing packages in the above three categories.

Code linting

During development swiftlint is run on non-strict mode so it's easier to develop without worrying about code formatting. On CI, linting is strict and will fail on any warning. Before commiting code to this repository run the following script to add a pre-commit hook that will check all new/modified files in strict mode and stop you from committing code that won't make it through CI.

./scripts/pre_commit_lint.sh setup

Localization

The app uses SwiftGen to generate the Localizable.strings file for accessing all the app strings stored in the standard Localizable.strings files. Just add a new string to Strings package and run the swiftgen command in a directory where swiftgen.yml is defined.

License

The code and data files in this distribution are licensed under the terms of the GPLv3 as published by the Free Software Foundation. See https://www.gnu.org/licenses/ for a copy of this license.

Copyright (c) 2023 Proton Technologies AG

ios-mac-app's People

Contributors

alexmorral avatar dhoko avatar erikackermann avatar flexjdev avatar gricsi avatar igorkulman avatar jaroslavas avatar jsoref avatar magohamote avatar pawel-jurczyk avatar proton-ci avatar protonjohn avatar roanutil avatar siejkowski avatar victor avatar zhj4478 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-mac-app's Issues

Kill Switch blocks Gradle sync because of localhost use

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

I think the Kill Switch is be blocking localhost connections on my Mac, and I'm not sure it should be. I've come for some advice about it. I'm not too well-versed in managing networks, so please bear with me as I ask.

I'm an Android developer using Android Studio and Gradle build tools. I often need to run the gradle sync command to pull code dependencies. (I know Xcode uses different build tools, but your Android team will know what I'm referring to if it's necessary.)

With Kill Switch off, the gradle sync completes normally.
With Kill Switch on, it immediately fails. (log below)

(It might be worth noting that I always have Allow LAN Connections disabled.)

Gradle runs a daemon on localhost to help with its processes, and what I think I've figured out is that the connection to that daemon is blocked by the Kill Switch. But this is just a process running on my local machine. Is this expected? I'm not making any outside connections to other devices so it seems weird to me that localhost is having issues, but again - I'm not a network expert.

**EXPAND FOR LOG OUTPUT**
Starting a Gradle Daemon, 15 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not connect to the Gradle daemon.
Daemon uid: dfa58bf1-9dc8-41b2-9e05-1d3c2b6487ac with diagnostics:
Daemon pid: 47724
  log file: /Users/[username]/.gradle/daemon/7.5.1/daemon-47724.out.log
----- Last  20 lines from daemon log file - daemon-47724.out.log -----
2022-09-26T21:26:25.088-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2022-09-26T21:26:25.088-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.0.4
2022-09-26T21:26:25.089-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo0
2022-09-26T21:26:25.089-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
2022-09-26T21:26:25.089-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Ignoring remote address on loopback interface /fe80:0:0:0:0:0:0:1%lo0
2022-09-26T21:26:25.089-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo0
2022-09-26T21:26:25.089-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
2022-09-26T21:26:25.091-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [77f01216-b83a-4c7f-8b6f-90a4be42dfe6 port:51410, addresses:[localhost/127.0.0.1]].
2022-09-26T21:26:25.094-0500 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Mon Sep 26 21:26:25 CDT 2022, with address: [77f01216-b83a-4c7f-8b6f-90a4be42dfe6 port:51410, addresses:[localhost/127.0.0.1]]
2022-09-26T21:26:25.094-0500 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [77f01216-b83a-4c7f-8b6f-90a4be42dfe6 port:51410, addresses:[localhost/127.0.0.1]]
2022-09-26T21:26:25.095-0500 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=dfa58bf1-9dc8-41b2-9e05-1d3c2b6487ac,javaHome=/Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home,daemonRegistryDir=/Users/[username]/.gradle/daemon,pid=47724,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx2048m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2022-09-26T21:26:25.095-0500 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [77f01216-b83a-4c7f-8b6f-90a4be42dfe6 port:51410, addresses:[localhost/127.0.0.1]], context: DefaultDaemonContext[uid=dfa58bf1-9dc8-41b2-9e05-1d3c2b6487ac,javaHome=/Library/Java/JavaVirtualMachines/temurin-18.jdk/Contents/Home,daemonRegistryDir=/Users/[username]/.gradle/daemon,pid=47724,idleTimeout=10800000,priority=NORMAL,daemonOpts=--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.base/java.lang=ALL-UNNAMED,--add-opens,java.base/java.lang.invoke=ALL-UNNAMED,--add-opens,java.base/java.util=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.prefs/java.util.prefs=ALL-UNNAMED,--add-opens,java.base/java.nio.charset=ALL-UNNAMED,--add-opens,java.base/java.net=ALL-UNNAMED,--add-opens,java.base/java.util.concurrent.atomic=ALL-UNNAMED,-Xmx2048m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2022-09-26T21:26:25.100-0500 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
2022-09-26T21:26:25.101-0500 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2022-09-26T21:26:25.103-0500 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2022-09-26T21:26:25.103-0500 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
2022-09-26T21:26:25.104-0500 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
2022-09-26T21:26:25.106-0500 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
2022-09-26T21:26:25.106-0500 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
2022-09-26T21:26:25.106-0500 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
----- End of the daemon log -----

I guess I'd like to know if there's any way to make this sync work with Kill Switch enabled, or if it's even supposed to be working already. I've looked into proxying (though I barely know what's up there), and I saw that for Windows and Android (ironically), split tunneling is supported that I could maybe use, except it's not supported on Mac. Not sure.

Worst case, maybe I just disable Kill Switch? But I like the idea of no leaks, and I don't have this issue on other VPNs. But like... I like Proton, so I'm interested in figuring this out.

Can not update Pod.

How can get last source code from Pod like Tunnelkit?
I can not access to Proton Git Server via ssh/p22.


Protocols

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

Why none of the protocols work in Iran?

"protonvpn://" protocol Docs

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

I have found that the app registers a protocol handler for protonvpn://. I was wondering if this supports any specific URL patterns to perform different actions in the app, and I have searched for documentation but haven't found any.

So does anyone know if this protocol supports any links for connecting, disconnecting, opening settings, etc?

Any protocol couldnt open

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

It is interesting that only the protocol (tcp) can be connected, but no website can open

Would you be able to upload the .ipa files for iPhone installation?

Hi. People in certain countries in the world are suffering access to the internet. Many of them have iPhone phones but Apple App Store is blocked in those countries and they cannot download ProtonVPN. Could you please upload the .ipa files as an asset in your releases so that people from outside of Iran can download the .ipa file and share it with people in Iran via email or other methods? I would really appreciate it if you could upload the .ipa file for the latest version of ProtonVPN here as soon as possible. Please do not wait until the next version is released even if it means you have to create a new release in order to be able to add an asset (the .ipa) file.

Thank you thank you thank you

[!] Invalid `Podfile` file: no implicit conversion of nil into String.

clb@clbdeMac-mini ios-mac-app-develop % pod install

[!] Invalid Podfile file: no implicit conversion of nil into String.

from /Users/clb/Downloads/ios-mac-app-develop/Podfile:7

-------------------------------------------

def proton_url

'git@' + ENV["PROTON_GIT_URL"]

end

-------------------------------------------

Please give more techincal details on kill switch issue

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

I have searched for ever to figure out why my macbook kept crashing in the watchdog driver. After a lot of digger I have come to the conclusion it is because of this: https://protonvpn.com/support/macos-t2-chip-kill-switch/

It would be really helpful if you would supply more technical information so that people can find the issue. Your application crashes the watchdog driver which causes a CPU panic.

Is there a way to put the custom API domain for fetching the servers?

Well here is the thing:
Currently I'm living in a country in which when I open the app, the initial call for fetching servers is blocked and I should wait for a couple of minutes until it changes the URI to the fallback one.

When I was using Linux and more specifically this repo, I could merge this PR in my code and build the project myself, with that the initial call would be successfully fulfilled.

I was looking for a way to do the same thing in the mac version of ProtonVPN so I can avoid the long loading time when I open the app.

I saw this post about using TunnelBlick but I prefer using the ProtonVPN mac app if it's possible.

Thanks a lot and sorry if it's not the right place to raise this issue ๐Ÿ™๐Ÿป.

Are there plans for tvOS?

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

In theory, the build to AppleTV is not too involved. So is this planned?

Shouldn't the app name be replaced from ProtonVPN to Proton VPN?

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

Shouldn't the app name be replaced from ProtonVPN to Proton VPN?

Support port forwarding

Could you please add support for port forwarding in the macOS app so that there's feature parity with the Windows app?

Code for the latest versions

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

After new designed apps released I decided to check the code for them and didn't find the code for the latest v3.0.0 for MacOS and v3.1.3 for iOS, where can I find it? and seems like iOS app for ProtonMail lags behind in the version as well

Auto select protocol should be more humanity for client

We are happy to answer your questions about the code or discuss technical ideas.

Please complete the following checklist (by adding [x]):

  • I have searched open and closed issues for duplicates
  • This isn't a feature request
  • This is not a report about my app not working as expected

Once detected proton main site API blocked. should trying to connect stealth protocol first. on the most network restrictive environment. other VPN protocol almost unable to use.
Might you know, users can not wait connect for long time, right? why not for more consider from users?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.