Commit 9674e843 authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Initial commit

parents

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
GITLAB_CHANGELOG_DISCUSSION_PATH="ci/QA.discussion"
GITLAB_CHANGELOG_TEMPLATE_PATH="ci/QA.changelog"
BETA_CHANGELOG_TEMPLATE_PATH="ci/BETA.changelog"
# Summary
### Steps to reproduce
(Please provide detail steps).
### What is the current bug behaviour?
(What actually happens).
### What is the expected correct behaviour?
(What you should see instead).
### Relevant logs and/or screenshots
### Possible fixes suggested re-mediation
### Assignees and labels
( please add labels as applicable )
- [ ] Patched
- [ ] Verified patch
A similar PR may already be submitted!
Please search among the Pull requests before creating one.
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
For more information, see the [CONTRIBUTING](/.github.com/CONTRIBUTING.md) readme or the contributing [guide](https://pia-oss.github.io/contribute).
**Summary**
<!-- Summary of the PR -->
This PR fixes/implements the following **bugs/features**
* [ ] Bug 1
* [ ] Bug 2
* [ ] Feature 1
* [ ] Feature 2
* [ ] Breaking changes
<!-- You can skip this if you're fixing a typo or adding an app to the Showcase. -->
Explain the **motivation** for making this change. What existing problem does the pull request solve?
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
<!-- Make sure tests pass on both Travis and Circle CI. -->
**Code formatting**
<!-- See the simple style guide. -->
**Closing issues**
<!-- Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). -->
Fixes #
\ No newline at end of file
.DS_Store
*.swp
*.pbxuser
**/*.xcworkspace/xcuserdata
**/*.xcodeproj/project.xcworkspace
**/*.xcodeproj/xcuserdata
Pods
fastlane/**/*.html
fastlane/README.md
fastlane/report.xml
fastlane/test_output
fastlane/review_information/demo_*
build
dist
Preview.html
Gemfile.lock
variables:
LC_ALL: "en_US.UTF-8"
LANG: "en_US.UTF-8"
STAGE_BUILD_PATH: "build"
STAGE_ARTIFACTS_PATH: "dist"
STAGE_ARCHIVE_NAME: "pia-vpn"
SERIALIZED_ARCHIVE_JSON: "$STAGE_ARTIFACTS_PATH/notify.json"
before_script:
- gem install bundler --no-ri --no-rdoc
- bundle exec fastlane run ensure_git_status_clean
- bundle install
- bundle update
stages:
- test
- archive
- deploy
- notify
# hidden
.unit_test:
stage: test
variables:
SCAN_SCHEME: "PIA VPN dev"
SCAN_DEVICES: "iPhone X"
script:
- bundle exec fastlane unit_test
only:
- branches
except:
- master
tags:
- ios
qa_archive:
stage: archive
variables:
GYM_SCHEME: "PIA VPN dev"
MATCH_TYPE: "adhoc"
script:
- bundle exec fastlane create_archive
artifacts:
paths:
- "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.*"
expire_in: 1 week
only:
- develop
tags:
- ios
qa_deploy:
stage: deploy
variables:
IPA_OUTPUT_PATH: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
FL_HOCKEY_IPA: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
FL_HOCKEY_COMMIT_SHA: $CI_COMMIT_SHA
FL_HOCKEY_BUILD_SERVER_URL: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID"
FL_HOCKEY_REPOSITORY_URL: $CI_PROJECT_URL
FL_HOCKEY_NOTIFY: "false"
FL_HOCKEY_STRATEGY: "replace"
script:
- bundle exec fastlane qa_deploy
environment:
name: "hockey"
url: $HOCKEY_URL
artifacts:
paths:
- $SERIALIZED_ARCHIVE_JSON
expire_in: 1 week
only:
- develop
tags:
- ios
qa_notify:
stage: notify
variables:
FL_SLACK_USERNAME: "HockeyApp"
GITLAB_CHANGELOG_ISSUE_FORMAT: "- #%{id}: <%{url}|%{desc}>"
dependencies:
- qa_deploy
script:
- bundle exec fastlane qa_notify
when:
manual
only:
- develop
tags:
- ios
beta_archive:
stage: archive
variables:
GYM_SCHEME: "PIA VPN"
MATCH_TYPE: "appstore"
script:
#- bundle exec fastlane clean_openssl
- bundle exec fastlane create_archive
artifacts:
paths:
- "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.*"
expire_in: 1 week
only:
- master
tags:
- ios
beta_deploy:
stage: deploy
variables:
PILOT_IPA: "$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
PILOT_DISTRIBUTE_EXTERNAL: "true"
DEMO_ACCOUNT_REQUIRED: "true"
script:
- bundle exec fastlane beta_deploy
environment:
name: "testflight"
only:
- master
tags:
- ios
# Summary
### Steps to reproduce
### What is the current bug behavior?
(What actually happens)
### What is the expected correct behavior?
(What you should see instead)
### Relevant logs and/or screenshots
### Possible fixes suggested remediation
### Assignees and labels
(delete as applicable)
~bug ~confirmed ~regression ~suggestion
~blocker ~major ~minor
~tablet ~mobile ~tv
~ios9 ~ios10 ~ios11
%@ms
/cc @Dev /assign @QA
* [ ] Patched
* [ ] Verified patch
# Contributor agreement
By contributing any improvement, modification, or change to this project, I hereby certify that:
(a) The contribution was authored or created in whole or in part by me and I have the full and unrestricted ownership right and title to submit the contribution under the MIT license; or
(b) The contribution is based upon previously authored work that, to the best of my knowledge, is licensed appropriately under an open source license and I have the full and unrestricted right under that open source license to submit that work with modifications, whether created in whole or in part by me, under the MIT license; or
(c) The contribution was lawfully provided to me by a licensed third-party who certified (a), (b) or (c) and I have not modified the contribution.
I understand and agree that the contents of this project and the contents of this contribution are considered to be part of the public record and that a record of the contribution (including all personal information I submit with it) shall be maintained indefinitely and may be redistributed to third-parties consistent with this terms of this project or the open source license(s) involved.
\ No newline at end of file
# Contribution Guidelines
Private Internet Access welcomes community contributions, and are always looking for ways in which to improve. Please take a look at our contribution guidelines, and get involved with the PIA community.
## Bugs and Issues
Have you found a bug? Is our software behaving in an unexpected way? Please check the open issues for duplicates -- perhaps a fix is already in development, or maybe a solution has already been published.
If not then please submit a bug report using our [template](/.github/ISSUE_TEMPLATE.md)
## Feature Requests
Feature requests can also be submitted as issues. We’d be grateful if you checked for duplicates also before submitting a feature request.
## Working with our Code
* Fork the repository. Make sure to keep your repository synced with the source repo.
* When you are ready to start working on a new feature, cut a new branch from `develop` with the prefix `feature/` (e.g. `feature/name-of-feature`).
* Refer to the [README](/README.md) for instructions on how to install and build.
## Making Pull Requests
* Sync the `develop` branch in your fork with the `develop` branch in the source repo.
* Merge your feature branch into `develop`.
* Make your pull request from `develop` in your fork to `develop` in the source.
* Use short and concise commit messages.
* Lint your code before committing and making a pull request.
* Write unit tests for new features and make sure all tests are passing.
* If your pull request contains multiple commits or commits that are not meaningful, consider squashing them.
source "https://rubygems.org"
gem "fastlane"
gem "cocoapods"
gem "dotenv"
#CI_HOSTNAME=`[[ $CI_PROJECT_URL =~ ^https:\/\/([^\/]+)\/.*$ ]] && echo ${BASH_REMATCH[1]}`
ci_project_url = ENV['CI_PROJECT_URL']
ENV['CI_HOSTNAME'] = ci_project_url.gsub(/^https:\/\/([^\/]+)\/.*$/, '\1') unless ci_project_url.nil?
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
Copyright (c) 2018-Present Private Internet Access
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.
\ No newline at end of file
//
// ContentBlockerRequestHandler.swift
// PIA VPN AdBlocker
//
// Created by Davide De Rosa on 2/21/18.
// Copyright © 2018 London Trust Media. All rights reserved.
//
import UIKit
import MobileCoreServices
class ContentBlockerRequestHandler: NSObject, NSExtensionRequestHandling {
private let webRulesURL = "https://www.privateinternetaccess.com/api/client/ios-adblocker"
private let uti = "public.json"
private let fallbackName = "fallback"
func beginRequest(with context: NSExtensionContext) {
let attachment: NSItemProvider
let rulesURL = URL(string: webRulesURL)!
if let webRules = try? String(contentsOf: rulesURL, encoding: .utf8) {
attachment = NSItemProvider(item: webRules as NSString, typeIdentifier: uti)
} else {
attachment = NSItemProvider(contentsOf: Bundle.main.url(forResource: fallbackName, withExtension: "json"))!
}
let item = NSExtensionItem()
item.attachments = [attachment]
context.completeRequest(returningItems: [item], completionHandler: nil)
}
}
<?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>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>PIA VPN AdBlocker</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.5</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.Safari.content-blocker</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ContentBlockerRequestHandler</string>
</dict>
<key>NSHumanReadableDescription</key>
<string>PIA VPN AdBlocker</string>
</dict>
</plist>
This source diff could not be displayed because it is too large. You can view the blob instead.
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>PIA VPN Tunnel</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.5</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.networkextension.packet-tunnel</string>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string>
</dict>
</dict>
</plist>
<?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>com.apple.developer.networking.networkextension</key>
<array>
<string>packet-tunnel-provider</string>
</array>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.privateinternetaccess</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)group.com.privateinternetaccess</string>
</array>
</dict>
</plist>
//
// PacketTunnelProvider.swift
// PIA VPN
//
// Created by Davide De Rosa on 2/1/17.
// Copyright © 2017 London Trust Media. All rights reserved.
//
import PIATunnel
class PacketTunnelProvider: PIATunnelProvider {
}
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EFB606F203D7A2C0095398C"
BuildableName = "PIA VPN AdBlocker.appex"
BlueprintName = "PIA VPN AdBlocker"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0E67FC211E3F802D00EF9929"
BuildableName = "PIA VPN Tunnel.appex"
BlueprintName = "PIA VPN Tunnel"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EEE1BE61E4F6EF400397DE2"
BuildableName = "PIA VPNTests.xctest"
BlueprintName = "PIA VPNTests"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
region = "IT"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0EE2200B1F4EF307002805AE"
BuildableName = "PIA VPN dev.app"
BlueprintName = "PIA VPN dev"
ReferencedContainer = "container:PIA VPN.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "291C637B183EBC210039EC03"