diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index abfe50c91..26d07bdeb 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -4,6 +4,7 @@ on: [pull_request] jobs: buildAll: + name: build all runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/macos-deploy.yml b/.github/workflows/macos-deploy.yml new file mode 100644 index 000000000..0e43c205d --- /dev/null +++ b/.github/workflows/macos-deploy.yml @@ -0,0 +1,92 @@ +name: MacOS Safari Deploy + +on: [push] + +jobs: + buildApp: + name: safari build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: setup env + id: node-version + run: | + docker build -t enkrypt-build-container . + echo "NODE_VERSION=$(docker run --rm -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "node --version")" >> $GITHUB_OUTPUT + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + + - name: Cache yarn modules + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + + - name: yarn install + run: docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" enkrypt-build-container /bin/bash -c "yarn install --silent" + + - name: build + run: | + mkdir release + docker run --rm --user "$(id -u):$(id -g)" -v `pwd`:/home:rw enkrypt-build-container /bin/bash -c "cd packages/extension && yarn build:all && yarn build:safari" + + - uses: actions/upload-artifact@v4 + with: + name: safari-build-artifact + path: packages/extension/dist + retention-days: 1 + + deploy: + name: Deploying to appstore + needs: buildApp + runs-on: macOS-latest + + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: "latest-stable" + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Retrieve saved safari build + uses: actions/download-artifact@v4 + with: + name: safari-build-artifact + path: packages/extension/dist + - uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.0" + bundler-cache: true + working-directory: "macos/Enkrypt" + - name: Deploy via Fastlane + uses: maierj/fastlane-action@v3.0.0 + with: + lane: "buildandrelease" + subdirectory: "macos/Enkrypt" + env: + APPLE_ID: "${{ secrets.OSX_APPLE_ID }}" + APP_ID: "${{ secrets.OSX_APP_ID }}" + FASTLANE_ITC_TEAM_ID: "${{ secrets.OSX_FASTLANE_ITC_TEAM_ID }}" + FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: "${{ secrets.OSX_FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}" + ITC_TEAM_ID: "${{ secrets.OSX_FASTLANE_ITC_TEAM_ID }}" + INSTALLER_CERT: "${{ secrets.OSX_INSTALLER_CERT }}" + SAFARI_PROVISION: "${{ secrets.OSX_SAFARI_PROVISION }}" + EXTENSION_PROVISION: "${{ secrets.OSX_EXTENSION_PROVISION }}" + MATCH_GIT_URL: "${{ secrets.OSX_MATCH_GIT_URL }}" + MATCH_PASSWORD: "${{ secrets.OSX_MATCH_PASSWORD }}" + GIT_AUTHORIZATION: "${{ secrets.OSX_GIT_AUTHORIZATION }}" + API_KEY: "${{ secrets.OSX_API_KEY }}" + API_KEY_ID: "${{ secrets.OSX_API_KEY_ID }}" + API_ISSUER_ID: "${{ secrets.OSX_API_ISSUER_ID }}" + + - name: Upload Enkrypt pkg + uses: actions/upload-artifact@v4 + with: + name: safari-build-pkg + path: macos/Enkrypt/build/Enkrypt.pkg + retention-days: 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1e454de9..dd2a24262 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: - "v*" jobs: release: + name: new release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index d38691576..a3d50d6db 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -4,6 +4,7 @@ on: [push] jobs: test: + name: test all runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 306c1fc2b..da52e5cc4 100644 --- a/.gitignore +++ b/.gitignore @@ -71,6 +71,7 @@ typings/ # dotenv environment variables file .env .env.test +.env.sh # parcel-bundler cache (https://parceljs.org/) .cache diff --git a/macos/Enkrypt/.gitignore b/macos/Enkrypt/.gitignore new file mode 100644 index 000000000..55f36644c --- /dev/null +++ b/macos/Enkrypt/.gitignore @@ -0,0 +1,24 @@ +# Mac OS X +*.DS_Store + +# Xcode +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 +*.xcuserstate +project.xcworkspace/ +xcuserdata/ + +# Generated files +*.o +*.pyc + + +#Python modules +MANIFEST +dist/ +build/ + +# Backup files +*~.nib \ No newline at end of file diff --git a/macos/Enkrypt/Enkrypt Extension/Enkrypt_Extension.entitlements b/macos/Enkrypt/Enkrypt Extension/Enkrypt_Extension.entitlements new file mode 100644 index 000000000..f2ef3ae02 --- /dev/null +++ b/macos/Enkrypt/Enkrypt Extension/Enkrypt_Extension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/macos/Enkrypt/Enkrypt Extension/Info.plist b/macos/Enkrypt/Enkrypt Extension/Info.plist new file mode 100644 index 000000000..9ee504dc5 --- /dev/null +++ b/macos/Enkrypt/Enkrypt Extension/Info.plist @@ -0,0 +1,13 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.Safari.web-extension + NSExtensionPrincipalClass + $(PRODUCT_MODULE_NAME).SafariWebExtensionHandler + + + diff --git a/macos/Enkrypt/Enkrypt Extension/SafariWebExtensionHandler.swift b/macos/Enkrypt/Enkrypt Extension/SafariWebExtensionHandler.swift new file mode 100644 index 000000000..2cfdf5536 --- /dev/null +++ b/macos/Enkrypt/Enkrypt Extension/SafariWebExtensionHandler.swift @@ -0,0 +1,26 @@ +// +// SafariWebExtensionHandler.swift +// Enkrypt Extension +// +// Created by admin on 8/16/22. +// + +import SafariServices +import os.log + +let SFExtensionMessageKey = "message" + +class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling { + + func beginRequest(with context: NSExtensionContext) { + let item = context.inputItems[0] as! NSExtensionItem + let message = item.userInfo?[SFExtensionMessageKey] + os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@", message as! CVarArg) + + let response = NSExtensionItem() + response.userInfo = [ SFExtensionMessageKey: [ "Response to": message ] ] + + context.completeRequest(returningItems: [response], completionHandler: nil) + } + +} diff --git a/macos/Enkrypt/Enkrypt Extension/service-worker-loader.js b/macos/Enkrypt/Enkrypt Extension/service-worker-loader.js new file mode 100644 index 000000000..87af2c5cd --- /dev/null +++ b/macos/Enkrypt/Enkrypt Extension/service-worker-loader.js @@ -0,0 +1 @@ +import './assets/background.ts-BhDrlCyp.js'; diff --git a/macos/Enkrypt/Enkrypt.xcodeproj/project.pbxproj b/macos/Enkrypt/Enkrypt.xcodeproj/project.pbxproj new file mode 100644 index 000000000..319ebe1ac --- /dev/null +++ b/macos/Enkrypt/Enkrypt.xcodeproj/project.pbxproj @@ -0,0 +1,633 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 55; + objects = { + +/* Begin PBXBuildFile section */ + 848405B52D0CC6C100D6CA98 /* service-worker-loader.js in Resources */ = {isa = PBXBuildFile; fileRef = 848405B42D0CC6C100D6CA98 /* service-worker-loader.js */; }; + 849394FD28AC474C009F7287 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 849394FC28AC474C009F7287 /* AppDelegate.swift */; }; + 8493950128AC474C009F7287 /* Main.html in Resources */ = {isa = PBXBuildFile; fileRef = 849394FF28AC474C009F7287 /* Main.html */; }; + 8493950528AC474C009F7287 /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = 8493950428AC474C009F7287 /* Style.css */; }; + 8493950728AC474C009F7287 /* Script.js in Resources */ = {isa = PBXBuildFile; fileRef = 8493950628AC474C009F7287 /* Script.js */; }; + 8493950928AC474C009F7287 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493950828AC474C009F7287 /* ViewController.swift */; }; + 8493950C28AC474C009F7287 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8493950A28AC474C009F7287 /* Main.storyboard */; }; + 8493950E28AC474E009F7287 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8493950D28AC474E009F7287 /* Assets.xcassets */; }; + 8493951728AC474E009F7287 /* Enkrypt Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 8493951628AC474E009F7287 /* Enkrypt Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; + 8493951C28AC474E009F7287 /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8493951B28AC474E009F7287 /* SafariWebExtensionHandler.swift */; }; + 8493953528AC474F009F7287 /* favicon.ico in Resources */ = {isa = PBXBuildFile; fileRef = 8493952928AC474E009F7287 /* favicon.ico */; }; + 8493953628AC474F009F7287 /* index.html in Resources */ = {isa = PBXBuildFile; fileRef = 8493952A28AC474E009F7287 /* index.html */; }; + 8493953828AC474F009F7287 /* onboard.html in Resources */ = {isa = PBXBuildFile; fileRef = 8493952C28AC474F009F7287 /* onboard.html */; }; + 8493953B28AC474F009F7287 /* trezor-usb-permissions.html in Resources */ = {isa = PBXBuildFile; fileRef = 8493952F28AC474F009F7287 /* trezor-usb-permissions.html */; }; + 8493953C28AC474F009F7287 /* scripts in Resources */ = {isa = PBXBuildFile; fileRef = 8493953028AC474F009F7287 /* scripts */; }; + 8493953D28AC474F009F7287 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 8493953128AC474F009F7287 /* manifest.json */; }; + 8493953E28AC474F009F7287 /* action.html in Resources */ = {isa = PBXBuildFile; fileRef = 8493953228AC474F009F7287 /* action.html */; }; + 8493953F28AC474F009F7287 /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 8493953328AC474F009F7287 /* assets */; }; + 8493954028AC474F009F7287 /* vendor in Resources */ = {isa = PBXBuildFile; fileRef = 8493953428AC474F009F7287 /* vendor */; }; + EBAAC15D28D2F5600061925C /* Dark.png in Resources */ = {isa = PBXBuildFile; fileRef = EBAAC15A28D2F5600061925C /* Dark.png */; }; + EBAAC15E28D2F5600061925C /* Logo.png in Resources */ = {isa = PBXBuildFile; fileRef = EBAAC15B28D2F5600061925C /* Logo.png */; }; + EBAAC15F28D2F5600061925C /* Light.png in Resources */ = {isa = PBXBuildFile; fileRef = EBAAC15C28D2F5600061925C /* Light.png */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 8493951828AC474E009F7287 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 849394F128AC474C009F7287 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 8493951528AC474E009F7287; + remoteInfo = "Enkrypt Extension"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 8493952428AC474E009F7287 /* Embed App Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 12; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + 8493951728AC474E009F7287 /* Enkrypt Extension.appex in Embed App Extensions */, + ); + name = "Embed App Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 848405B42D0CC6C100D6CA98 /* service-worker-loader.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = "../../../packages/extension/dist/service-worker-loader.js"; sourceTree = ""; }; + 849394F928AC474C009F7287 /* Enkrypt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Enkrypt.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 849394FC28AC474C009F7287 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 8493950028AC474C009F7287 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = ../Base.lproj/Main.html; sourceTree = ""; }; + 8493950428AC474C009F7287 /* Style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = Style.css; sourceTree = ""; }; + 8493950628AC474C009F7287 /* Script.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Script.js; sourceTree = ""; }; + 8493950828AC474C009F7287 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 8493950B28AC474C009F7287 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 8493950D28AC474E009F7287 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8493950F28AC474E009F7287 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8493951028AC474E009F7287 /* Enkrypt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Enkrypt.entitlements; sourceTree = ""; }; + 8493951628AC474E009F7287 /* Enkrypt Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Enkrypt Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8493951B28AC474E009F7287 /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = ""; }; + 8493951D28AC474E009F7287 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 8493951E28AC474E009F7287 /* Enkrypt_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Enkrypt_Extension.entitlements; sourceTree = ""; }; + 8493952928AC474E009F7287 /* favicon.ico */ = {isa = PBXFileReference; lastKnownFileType = image.ico; name = favicon.ico; path = ../../../packages/extension/dist/favicon.ico; sourceTree = ""; }; + 8493952A28AC474E009F7287 /* index.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = index.html; path = ../../../packages/extension/dist/index.html; sourceTree = ""; }; + 8493952C28AC474F009F7287 /* onboard.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = onboard.html; path = ../../../packages/extension/dist/onboard.html; sourceTree = ""; }; + 8493952F28AC474F009F7287 /* trezor-usb-permissions.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = "trezor-usb-permissions.html"; path = "../../../packages/extension/dist/trezor-usb-permissions.html"; sourceTree = ""; }; + 8493953028AC474F009F7287 /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = scripts; path = ../../../packages/extension/dist/scripts; sourceTree = ""; }; + 8493953128AC474F009F7287 /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = ../../../packages/extension/dist/manifest.json; sourceTree = ""; }; + 8493953228AC474F009F7287 /* action.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = action.html; path = ../../../packages/extension/dist/action.html; sourceTree = ""; }; + 8493953328AC474F009F7287 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../../../packages/extension/dist/assets; sourceTree = ""; }; + 8493953428AC474F009F7287 /* vendor */ = {isa = PBXFileReference; lastKnownFileType = folder; name = vendor; path = ../../../packages/extension/dist/vendor; sourceTree = ""; }; + EBAAC15A28D2F5600061925C /* Dark.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Dark.png; path = Enkrypt/Resources/Dark.png; sourceTree = SOURCE_ROOT; }; + EBAAC15B28D2F5600061925C /* Logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Logo.png; path = Enkrypt/Resources/Logo.png; sourceTree = SOURCE_ROOT; }; + EBAAC15C28D2F5600061925C /* Light.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Light.png; path = Enkrypt/Resources/Light.png; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 849394F628AC474C009F7287 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8493951328AC474E009F7287 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 849394F028AC474C009F7287 = { + isa = PBXGroup; + children = ( + 849394FB28AC474C009F7287 /* Enkrypt */, + 8493951A28AC474E009F7287 /* Enkrypt Extension */, + 849394FA28AC474C009F7287 /* Products */, + ); + sourceTree = ""; + }; + 849394FA28AC474C009F7287 /* Products */ = { + isa = PBXGroup; + children = ( + 849394F928AC474C009F7287 /* Enkrypt.app */, + 8493951628AC474E009F7287 /* Enkrypt Extension.appex */, + ); + name = Products; + sourceTree = ""; + }; + 849394FB28AC474C009F7287 /* Enkrypt */ = { + isa = PBXGroup; + children = ( + 849394FC28AC474C009F7287 /* AppDelegate.swift */, + 8493950828AC474C009F7287 /* ViewController.swift */, + 8493950A28AC474C009F7287 /* Main.storyboard */, + 8493950D28AC474E009F7287 /* Assets.xcassets */, + 8493950F28AC474E009F7287 /* Info.plist */, + 8493951028AC474E009F7287 /* Enkrypt.entitlements */, + 849394FE28AC474C009F7287 /* Resources */, + ); + path = Enkrypt; + sourceTree = ""; + }; + 849394FE28AC474C009F7287 /* Resources */ = { + isa = PBXGroup; + children = ( + EBAAC15A28D2F5600061925C /* Dark.png */, + EBAAC15C28D2F5600061925C /* Light.png */, + EBAAC15B28D2F5600061925C /* Logo.png */, + 849394FF28AC474C009F7287 /* Main.html */, + 8493950428AC474C009F7287 /* Style.css */, + 8493950628AC474C009F7287 /* Script.js */, + ); + path = Resources; + sourceTree = ""; + }; + 8493951A28AC474E009F7287 /* Enkrypt Extension */ = { + isa = PBXGroup; + children = ( + 8493952828AC474E009F7287 /* Resources */, + 8493951B28AC474E009F7287 /* SafariWebExtensionHandler.swift */, + 8493951D28AC474E009F7287 /* Info.plist */, + 8493951E28AC474E009F7287 /* Enkrypt_Extension.entitlements */, + ); + path = "Enkrypt Extension"; + sourceTree = ""; + }; + 8493952828AC474E009F7287 /* Resources */ = { + isa = PBXGroup; + children = ( + 848405B42D0CC6C100D6CA98 /* service-worker-loader.js */, + 8493952928AC474E009F7287 /* favicon.ico */, + 8493952A28AC474E009F7287 /* index.html */, + 8493952C28AC474F009F7287 /* onboard.html */, + 8493952F28AC474F009F7287 /* trezor-usb-permissions.html */, + 8493953028AC474F009F7287 /* scripts */, + 8493953128AC474F009F7287 /* manifest.json */, + 8493953228AC474F009F7287 /* action.html */, + 8493953328AC474F009F7287 /* assets */, + 8493953428AC474F009F7287 /* vendor */, + ); + name = Resources; + path = "Enkrypt Extension"; + sourceTree = SOURCE_ROOT; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 849394F828AC474C009F7287 /* Enkrypt */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8493952528AC474E009F7287 /* Build configuration list for PBXNativeTarget "Enkrypt" */; + buildPhases = ( + 849394F528AC474C009F7287 /* Sources */, + 849394F628AC474C009F7287 /* Frameworks */, + 849394F728AC474C009F7287 /* Resources */, + 8493952428AC474E009F7287 /* Embed App Extensions */, + ); + buildRules = ( + ); + dependencies = ( + 8493951928AC474E009F7287 /* PBXTargetDependency */, + ); + name = Enkrypt; + productName = Enkrypt; + productReference = 849394F928AC474C009F7287 /* Enkrypt.app */; + productType = "com.apple.product-type.application"; + }; + 8493951528AC474E009F7287 /* Enkrypt Extension */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8493952128AC474E009F7287 /* Build configuration list for PBXNativeTarget "Enkrypt Extension" */; + buildPhases = ( + 8493951228AC474E009F7287 /* Sources */, + 8493951328AC474E009F7287 /* Frameworks */, + 8493951428AC474E009F7287 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Enkrypt Extension"; + productName = "Enkrypt Extension"; + productReference = 8493951628AC474E009F7287 /* Enkrypt Extension.appex */; + productType = "com.apple.product-type.app-extension"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 849394F128AC474C009F7287 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1340; + LastUpgradeCheck = 1340; + TargetAttributes = { + 849394F828AC474C009F7287 = { + CreatedOnToolsVersion = 13.4.1; + }; + 8493951528AC474E009F7287 = { + CreatedOnToolsVersion = 13.4.1; + }; + }; + }; + buildConfigurationList = 849394F428AC474C009F7287 /* Build configuration list for PBXProject "Enkrypt" */; + compatibilityVersion = "Xcode 13.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 849394F028AC474C009F7287; + productRefGroup = 849394FA28AC474C009F7287 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 849394F828AC474C009F7287 /* Enkrypt */, + 8493951528AC474E009F7287 /* Enkrypt Extension */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 849394F728AC474C009F7287 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8493950C28AC474C009F7287 /* Main.storyboard in Resources */, + EBAAC15E28D2F5600061925C /* Logo.png in Resources */, + 8493950728AC474C009F7287 /* Script.js in Resources */, + 8493950128AC474C009F7287 /* Main.html in Resources */, + EBAAC15F28D2F5600061925C /* Light.png in Resources */, + EBAAC15D28D2F5600061925C /* Dark.png in Resources */, + 8493950E28AC474E009F7287 /* Assets.xcassets in Resources */, + 8493950528AC474C009F7287 /* Style.css in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8493951428AC474E009F7287 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8493954028AC474F009F7287 /* vendor in Resources */, + 8493953E28AC474F009F7287 /* action.html in Resources */, + 8493953828AC474F009F7287 /* onboard.html in Resources */, + 848405B52D0CC6C100D6CA98 /* service-worker-loader.js in Resources */, + 8493953D28AC474F009F7287 /* manifest.json in Resources */, + 8493953B28AC474F009F7287 /* trezor-usb-permissions.html in Resources */, + 8493953528AC474F009F7287 /* favicon.ico in Resources */, + 8493953628AC474F009F7287 /* index.html in Resources */, + 8493953C28AC474F009F7287 /* scripts in Resources */, + 8493953F28AC474F009F7287 /* assets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 849394F528AC474C009F7287 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8493950928AC474C009F7287 /* ViewController.swift in Sources */, + 849394FD28AC474C009F7287 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 8493951228AC474E009F7287 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8493951C28AC474E009F7287 /* SafariWebExtensionHandler.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 8493951928AC474E009F7287 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 8493951528AC474E009F7287 /* Enkrypt Extension */; + targetProxy = 8493951828AC474E009F7287 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 849394FF28AC474C009F7287 /* Main.html */ = { + isa = PBXVariantGroup; + children = ( + 8493950028AC474C009F7287 /* Base */, + ); + name = Main.html; + sourceTree = ""; + }; + 8493950A28AC474C009F7287 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8493950B28AC474C009F7287 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8493951F28AC474E009F7287 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8493952028AC474E009F7287 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 12.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 8493952228AC474E009F7287 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "Enkrypt Extension/Enkrypt_Extension.entitlements"; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 82; + DEVELOPMENT_TEAM = MDN888GSU8; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Enkrypt Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Enkrypt Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MARKETING_VERSION = 1.17.0; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.myetherwallet.enkrypt.safari.Extension; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.myetherwallet.enkrypt.safari.Extension macos"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 8493952328AC474E009F7287 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "Enkrypt Extension/Enkrypt_Extension.entitlements"; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application"; + CODE_SIGN_STYLE = Manual; + CURRENT_PROJECT_VERSION = 82; + DEVELOPMENT_TEAM = MDN888GSU8; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "Enkrypt Extension/Info.plist"; + INFOPLIST_KEY_CFBundleDisplayName = "Enkrypt Extension"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@executable_path/../../../../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MARKETING_VERSION = 1.17.0; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.myetherwallet.enkrypt.safari.Extension; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.myetherwallet.enkrypt.safari.Extension macos"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 8493952628AC474E009F7287 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Enkrypt/Enkrypt.entitlements; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 82; + DEVELOPMENT_TEAM = MDN888GSU8; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Enkrypt/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Enkrypt; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSMainStoryboardFile = Main; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.17.0; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + "-framework", + WebKit, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.myetherwallet.enkrypt.safari; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.myetherwallet.enkrypt.safari macos"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 8493952728AC474E009F7287 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = Enkrypt/Enkrypt.entitlements; + CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 82; + DEVELOPMENT_TEAM = MDN888GSU8; + ENABLE_HARDENED_RUNTIME = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = Enkrypt/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = Enkrypt; + INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSMainStoryboardFile = Main; + INFOPLIST_KEY_NSPrincipalClass = NSApplication; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 12.3; + MARKETING_VERSION = 1.17.0; + ONLY_ACTIVE_ARCH = YES; + OTHER_LDFLAGS = ( + "-framework", + SafariServices, + "-framework", + WebKit, + ); + PRODUCT_BUNDLE_IDENTIFIER = com.myetherwallet.enkrypt.safari; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.myetherwallet.enkrypt.safari macos"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 849394F428AC474C009F7287 /* Build configuration list for PBXProject "Enkrypt" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8493951F28AC474E009F7287 /* Debug */, + 8493952028AC474E009F7287 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8493952128AC474E009F7287 /* Build configuration list for PBXNativeTarget "Enkrypt Extension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8493952228AC474E009F7287 /* Debug */, + 8493952328AC474E009F7287 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8493952528AC474E009F7287 /* Build configuration list for PBXNativeTarget "Enkrypt" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8493952628AC474E009F7287 /* Debug */, + 8493952728AC474E009F7287 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 849394F128AC474C009F7287 /* Project object */; +} diff --git a/macos/Enkrypt/Enkrypt.xcodeproj/xcshareddata/xcschemes/Enkrypt.xcscheme b/macos/Enkrypt/Enkrypt.xcodeproj/xcshareddata/xcschemes/Enkrypt.xcscheme new file mode 100644 index 000000000..d8b151798 --- /dev/null +++ b/macos/Enkrypt/Enkrypt.xcodeproj/xcshareddata/xcschemes/Enkrypt.xcscheme @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Enkrypt/Enkrypt/AppDelegate.swift b/macos/Enkrypt/Enkrypt/AppDelegate.swift new file mode 100644 index 000000000..e4bcaf8fd --- /dev/null +++ b/macos/Enkrypt/Enkrypt/AppDelegate.swift @@ -0,0 +1,21 @@ +// +// AppDelegate.swift +// Enkrypt +// +// Created by admin on 8/16/22. +// + +import Cocoa + +@main +class AppDelegate: NSObject, NSApplicationDelegate { + + func applicationDidFinishLaunching(_ notification: Notification) { + // Override point for customization after application launch. + } + + func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } + +} diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AccentColor.colorset/Contents.json b/macos/Enkrypt/Enkrypt/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 000000000..eb8789700 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/Contents.json b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..64dc11ee7 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "filename" : "icon_16x16.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "filename" : "icon_16x16@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "filename" : "icon_32x32.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "filename" : "icon_32x32@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "filename" : "icon_128x128.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "filename" : "icon_128x128@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "filename" : "icon_256x256.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "filename" : "icon_256x256@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "filename" : "icon_512x512.png", + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "filename" : "icon_512x512@2x.png", + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128.png new file mode 100644 index 000000000..a07c6b0b8 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png new file mode 100644 index 000000000..b877df02f Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16.png new file mode 100644 index 000000000..9cd5759f3 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png new file mode 100644 index 000000000..800bde8f9 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256.png new file mode 100644 index 000000000..62215a581 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png new file mode 100644 index 000000000..c8bd4a757 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32.png new file mode 100644 index 000000000..b1e77fd0f Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png new file mode 100644 index 000000000..63c9adaad Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512.png new file mode 100644 index 000000000..1fe4816da Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png new file mode 100644 index 000000000..2108d7de7 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png differ diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/Contents.json b/macos/Enkrypt/Enkrypt/Assets.xcassets/Contents.json new file mode 100644 index 000000000..73c00596a --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/macos/Enkrypt/Enkrypt/Assets.xcassets/LargeIcon.imageset/Contents.json b/macos/Enkrypt/Enkrypt/Assets.xcassets/LargeIcon.imageset/Contents.json new file mode 100644 index 000000000..a19a54922 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Assets.xcassets/LargeIcon.imageset/Contents.json @@ -0,0 +1,20 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/macos/Enkrypt/Enkrypt/Base.lproj/Main.html b/macos/Enkrypt/Enkrypt/Base.lproj/Main.html new file mode 100644 index 000000000..6cf20b352 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Base.lproj/Main.html @@ -0,0 +1,25 @@ + + + + + + + + + + + + + +

Multiple Chains. One Wallet.

+
+

How to enable Enkrypt

+

In Safari Preferences on the Extensions tab, click the checkbox next to Enkrypt to enable it. Follow further instructions on the opened Safari tab.

+

In Safari Preferences on the Extensions tab, click the checkbox next to Enkrypt to enable it. Follow further instructions on the opened Safari tab.

+

In Safari Preferences on the Extensions tab, click the checkbox next to Enkrypt to enable it. Follow further instructions on the opened Safari tab.

+ Enkrypt's extension + Enkrypt's extension +
+ + + diff --git a/macos/Enkrypt/Enkrypt/Base.lproj/Main.storyboard b/macos/Enkrypt/Enkrypt/Base.lproj/Main.storyboard new file mode 100644 index 000000000..ae2252f8b --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Base.lproj/Main.storyboard @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/macos/Enkrypt/Enkrypt/Enkrypt.entitlements b/macos/Enkrypt/Enkrypt/Enkrypt.entitlements new file mode 100644 index 000000000..625af03d9 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Enkrypt.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + + diff --git a/macos/Enkrypt/Enkrypt/Info.plist b/macos/Enkrypt/Enkrypt/Info.plist new file mode 100644 index 000000000..86e2fde2e --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Info.plist @@ -0,0 +1,10 @@ + + + + + ITSAppUsesNonExemptEncryption + + SFSafariWebExtensionConverterVersion + 13.4.1 + + diff --git a/macos/Enkrypt/Enkrypt/Resources/Dark.png b/macos/Enkrypt/Enkrypt/Resources/Dark.png new file mode 100644 index 000000000..1d9796aed Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Resources/Dark.png differ diff --git a/macos/Enkrypt/Enkrypt/Resources/Light.png b/macos/Enkrypt/Enkrypt/Resources/Light.png new file mode 100644 index 000000000..bfccf7ba4 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Resources/Light.png differ diff --git a/macos/Enkrypt/Enkrypt/Resources/Logo.png b/macos/Enkrypt/Enkrypt/Resources/Logo.png new file mode 100644 index 000000000..567504895 Binary files /dev/null and b/macos/Enkrypt/Enkrypt/Resources/Logo.png differ diff --git a/macos/Enkrypt/Enkrypt/Resources/Script.js b/macos/Enkrypt/Enkrypt/Resources/Script.js new file mode 100644 index 000000000..888d89fd6 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Resources/Script.js @@ -0,0 +1,15 @@ +function show(enabled) { + if (typeof enabled === "boolean") { + document.body.classList.toggle(`state-on`, enabled); + document.body.classList.toggle(`state-off`, !enabled); + } else { + document.body.classList.remove(`state-on`); + document.body.classList.remove(`state-off`); + } +} + +function openPreferences() { + webkit.messageHandlers.controller.postMessage("open-preferences"); +} + +document.querySelector("button.open-preferences").addEventListener("click", openPreferences); diff --git a/macos/Enkrypt/Enkrypt/Resources/Style.css b/macos/Enkrypt/Enkrypt/Resources/Style.css new file mode 100644 index 000000000..62d3e6d30 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/Resources/Style.css @@ -0,0 +1,127 @@ +* { + -webkit-user-select: none; + -webkit-user-drag: none; + cursor: default; +} + +:root { + color-scheme: light dark; + --spacing: 20px; +} + +html { + height: 100%; +} + +body { + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + width: 720px; + margin: 0; + height: 500px; + font: -apple-system-short-body; + text-align: center; +} + +body:not(.state-on, .state-off) :is(.state-on, .state-off) { + display: none; +} + +body.state-on :is(.state-off, .state-unknown) { + display: none; +} + +body.state-off :is(.state-on, .state-unknown) { + display: none; +} + +.logo { + margin: 0 0 16px 0; +} + +h1 { + font-style: normal; + font-weight: 700; + font-size: 26px; + line-height: 32px; + text-align: center; + margin: 0 0 32px 0; + color: rgba(0, 0, 0, 0.85); +} + +.block { + width: 540px; + background: #F5F5F5; + border: 1px solid rgba(0, 0, 0, 0.05); + border-radius: 10px; + padding: 16px 20px; + box-sizing: border-box; + margin: 0 0 32px 0; + overflow: hidden; + text-align: left; +} + +h4 { + font-style: normal; + font-weight: 590; + font-size: 11px; + line-height: 14px; + margin: 0 0 4px 0; + color: rgba(0, 0, 0, 0.5); +} + +p { + font-style: normal; + font-weight: 400; + font-size: 13px; + line-height: 16px; + color: #202124; + margin: 0; +} + +.image { + margin: 0 0 -20px -20px; + display: block; +} + +.image-dark { + margin: 0 0 -20px -20px; + display: none; +} + +button { + background: #0A84FF; + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16); + border-radius: 5px; + font-style: normal; + font-weight: 400; + font-size: 13px; + line-height: 28px; + color: #FFFFFF; + padding: 0 12px; + border: 0 none; +} + +@media (prefers-color-scheme: dark) { + h1 { + color: rgba(255, 255, 255, 0.85); + } + .block { + background: rgba(255, 255, 255, 0.05); + border: 1px solid rgba(255, 255, 255, 0.25); + } + h4 { + color: rgba(255, 255, 255, 0.55); + } + p { + color: rgba(255, 255, 255, 0.85); + } + .image { + display: none; + } + .image-dark { + display: block; + } +} diff --git a/macos/Enkrypt/Enkrypt/ViewController.swift b/macos/Enkrypt/Enkrypt/ViewController.swift new file mode 100644 index 000000000..216af91a8 --- /dev/null +++ b/macos/Enkrypt/Enkrypt/ViewController.swift @@ -0,0 +1,53 @@ +// +// ViewController.swift +// Enkrypt +// +// Created by admin on 8/16/22. +// + +import Cocoa +import SafariServices +import WebKit + +let extensionBundleIdentifier = "com.myetherwallet.enkrypt.safari.Extension" + +class ViewController: NSViewController, WKNavigationDelegate, WKScriptMessageHandler { + + @IBOutlet var webView: WKWebView! + + override func viewDidLoad() { + super.viewDidLoad() + + self.webView.navigationDelegate = self + + self.webView.configuration.userContentController.add(self, name: "controller") + + self.webView.loadFileURL(Bundle.main.url(forResource: "Main", withExtension: "html")!, allowingReadAccessTo: Bundle.main.resourceURL!) + } + + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { + SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in + guard let state = state, error == nil else { + // Insert code to inform the user that something went wrong. + return + } + + DispatchQueue.main.async { + webView.evaluateJavaScript("show(\(state.isEnabled))") + } + } + } + + func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) { + if (message.body as! String != "open-preferences") { + return; + } + + SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in + DispatchQueue.main.async { + NSApplication.shared.terminate(nil) + } + } + } + +} diff --git a/macos/Enkrypt/Gemfile b/macos/Enkrypt/Gemfile new file mode 100644 index 000000000..cdd3a6b34 --- /dev/null +++ b/macos/Enkrypt/Gemfile @@ -0,0 +1,6 @@ +source "https://rubygems.org" + +gem "fastlane" + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/macos/Enkrypt/Gemfile.lock b/macos/Enkrypt/Gemfile.lock new file mode 100644 index 000000000..3ecbda28f --- /dev/null +++ b/macos/Enkrypt/Gemfile.lock @@ -0,0 +1,219 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.6) + rexml + addressable (2.8.6) + public_suffix (>= 2.0.2, < 6.0) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.3.0) + aws-partitions (1.883.0) + aws-sdk-core (3.190.3) + aws-eventstream (~> 1, >= 1.3.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.8) + jmespath (~> 1, >= 1.6.1) + aws-sdk-kms (1.76.0) + aws-sdk-core (~> 3, >= 3.188.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.142.0) + aws-sdk-core (~> 3, >= 3.189.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.6.5) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.6.20240107) + dotenv (2.8.1) + emoji_regex (3.2.3) + excon (0.109.0) + faraday (1.10.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.3.0) + fastlane (2.219.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + http-cookie (~> 1.0.5) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (>= 2.0.0, < 3.0.0) + naturally (~> 2.2) + optparse (>= 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (~> 3) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + fastlane-plugin-json (1.1.0) + fastlane-plugin-versioning (0.5.2) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.54.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-core (0.11.3) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + google-apis-iamcredentials_v1 (0.17.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-playcustomapp_v1 (0.13.0) + google-apis-core (>= 0.11.0, < 2.a) + google-apis-storage_v1 (0.31.0) + google-apis-core (>= 0.11.0, < 2.a) + google-cloud-core (1.6.1) + google-cloud-env (>= 1.0, < 3.a) + google-cloud-errors (~> 1.0) + google-cloud-env (1.6.0) + faraday (>= 0.17.3, < 3.0) + google-cloud-errors (1.3.1) + google-cloud-storage (1.47.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.31.0) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.8.1) + faraday (>= 0.17.3, < 3.a) + jwt (>= 1.4, < 3.0) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.5) + domain_name (~> 0.5) + httpclient (2.8.3) + jmespath (1.6.2) + json (2.7.1) + jwt (2.7.1) + mini_magick (4.12.0) + mini_mime (1.1.5) + multi_json (1.15.0) + multipart-post (2.3.0) + nanaimo (0.3.0) + naturally (2.2.1) + optparse (0.4.0) + os (1.1.4) + plist (3.7.1) + public_suffix (5.0.4) + rake (13.1.0) + representable (3.2.0) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.6) + rouge (2.0.7) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.18.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.10) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.2) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unicode-display_width (2.5.0) + word_wrap (1.0.0) + xcodeproj (1.23.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + universal-darwin-22 + x86_64-darwin-20 + x86_64-darwin-21 + arm64-darwin-23 + +DEPENDENCIES + fastlane + fastlane-plugin-json + fastlane-plugin-versioning + +BUNDLED WITH + 2.5.5 diff --git a/macos/Enkrypt/fastlane/Appfile b/macos/Enkrypt/fastlane/Appfile new file mode 100644 index 000000000..44ff399d4 --- /dev/null +++ b/macos/Enkrypt/fastlane/Appfile @@ -0,0 +1,7 @@ +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile + +apple_id ENV["APPLE_ID"] +app_identifier ENV["APP_ID"] +itc_team_id ENV["ITC_TEAM_ID"] +team_id ENV["TEAM_ID"] \ No newline at end of file diff --git a/macos/Enkrypt/fastlane/Fastfile b/macos/Enkrypt/fastlane/Fastfile new file mode 100644 index 000000000..d3777da9e --- /dev/null +++ b/macos/Enkrypt/fastlane/Fastfile @@ -0,0 +1,68 @@ +# This file contains the fastlane.tools configuration +# You can find the documentation at https://docs.fastlane.tools +# +# For a list of all available actions, check out +# +# https://docs.fastlane.tools/actions +# +# For a list of all available plugins, check out +# +# https://docs.fastlane.tools/plugins/available-plugins +# + +# Uncomment the line if you want fastlane to automatically update itself + +before_all do + update_fastlane +end + +desc "Prepare the macos app for build" +lane :prepare do + match( + app_identifier: ["com.myetherwallet.enkrypt.safari","com.myetherwallet.enkrypt.safari.Extension"], + type: "appstore", + platform: "macos", + git_branch: "safari", + git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), + readonly: true, + generate_apple_certs: false, + additional_cert_types:"mac_installer_distribution" + ) +end + +desc "Push a new release build to the App Store" +lane :release do + manifest = read_json( + json_path: "../../packages/extension/dist/manifest.json" + ) + increment_version_number_in_xcodeproj(version_number: manifest[:version], xcodeproj: "Enkrypt.xcodeproj") + increment_build_number( build_number: ENV["GITHUB_RUN_ID"], xcodeproj: "Enkrypt.xcodeproj") + build_mac_app(scheme: "Enkrypt", + export_team_id: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), + destination: "generic/platform=macOS", + clean: true, + export_method: "app-store", + output_directory: "build", + installer_cert_name: ENV["INSTALLER_CERT"], + export_options: { + provisioningProfiles: { + "com.myetherwallet.enkrypt.safari" => ENV["SAFARI_PROVISION"], + "com.myetherwallet.enkrypt.safari.Extension" => ENV["EXTENSION_PROVISION"] + } + }) + upload_to_app_store(skip_metadata: true, skip_screenshots: true, run_precheck_before_submit: false) +end + +desc "Prepare build and release build to the App Store" +lane :buildandrelease do + setup_ci + app_store_connect_api_key( + key_id: ENV["API_KEY_ID"] , + issuer_id: ENV["API_ISSUER_ID"], + key_content: ENV["API_KEY"], + duration: 1200, # optional (maximum 1200) + in_house: false # optional but may be required if using match/sigh + ) + prepare() + release() +end diff --git a/macos/Enkrypt/fastlane/Matchfile b/macos/Enkrypt/fastlane/Matchfile new file mode 100644 index 000000000..426d5c106 --- /dev/null +++ b/macos/Enkrypt/fastlane/Matchfile @@ -0,0 +1,11 @@ +git_url ENV["MATCH_GIT_URL"] + +storage_mode("git") + +# app_identifier(["tools.fastlane.app", "tools.fastlane.app2"]) +# username("user@fastlane.tools") # Your Apple Developer Portal username + +# For all available options run `fastlane match --help` +# Remove the # in the beginning of the line to enable the other options + +# The docs are available on https://docs.fastlane.tools/actions/match diff --git a/macos/Enkrypt/fastlane/Pluginfile b/macos/Enkrypt/fastlane/Pluginfile new file mode 100644 index 000000000..517d6c358 --- /dev/null +++ b/macos/Enkrypt/fastlane/Pluginfile @@ -0,0 +1,6 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-json' +gem 'fastlane-plugin-versioning' diff --git a/macos/Enkrypt/fastlane/README.md b/macos/Enkrypt/fastlane/README.md new file mode 100644 index 000000000..2154c4d56 --- /dev/null +++ b/macos/Enkrypt/fastlane/README.md @@ -0,0 +1,46 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +### prepare + +```sh +[bundle exec] fastlane prepare +``` + +Prepare the macos app for build + +### release + +```sh +[bundle exec] fastlane release +``` + +Push a new release build to the App Store + +### buildandrelease + +```sh +[bundle exec] fastlane buildandrelease +``` + +Prepare build and release build to the App Store + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). diff --git a/macos/Enkrypt/fastlane/report.xml b/macos/Enkrypt/fastlane/report.xml new file mode 100644 index 000000000..c3e69e738 --- /dev/null +++ b/macos/Enkrypt/fastlane/report.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/extension/.browserlistrc b/packages/extension/.browserlistrc index ed92abb80..5bacf4d07 100644 --- a/packages/extension/.browserlistrc +++ b/packages/extension/.browserlistrc @@ -1,7 +1,5 @@ last 2 versions not dead -not safari > 0 -not ios_saf > 0 not baidu > 0 not ie > 0 not op_mini all diff --git a/packages/extension/configs/vite/transform-manifest.ts b/packages/extension/configs/vite/transform-manifest.ts index f23411092..ec478d5ee 100644 --- a/packages/extension/configs/vite/transform-manifest.ts +++ b/packages/extension/configs/vite/transform-manifest.ts @@ -1,4 +1,4 @@ -import { CrxPlugin } from '@crxjs/vite-plugin' +import { CrxPlugin } from '@crxjs/vite-plugin'; function transFormManifest(): CrxPlugin { return { @@ -17,15 +17,23 @@ function transFormManifest(): CrxPlugin { js: ['vendor/trezor-content-script.js'], run_at: 'document_start', }, - ] as any - if (process.env.BROWSER !== 'opera') { + ] as any; + if (process.env.BROWSER !== 'opera' && process.env.BROWSER !== 'safari') { manifest.content_scripts?.push({ matches: ['file://*/*', 'http://*/*', 'https://*/*'], js: ['scripts/inject.js'], run_at: 'document_start', all_frames: false, world: 'MAIN', - } as any) + } as any); + } + if (process.env.BROWSER === 'safari') { + (manifest as any).browser_specific_settings = { + safari: { + strict_min_version: '16.6', + strict_max_version: '18.*', + }, + }; } manifest.web_accessible_resources?.push({ resources: [ @@ -35,9 +43,9 @@ function transFormManifest(): CrxPlugin { ], use_dynamic_url: false, matches: ['file://*/*', 'http://*/*', 'https://*/*'], - }) - return manifest + }); + return manifest; }, - } + }; } -export default transFormManifest +export default transFormManifest; diff --git a/packages/extension/package.json b/packages/extension/package.json index 62ddc771f..b066f7955 100644 --- a/packages/extension/package.json +++ b/packages/extension/package.json @@ -16,6 +16,7 @@ "build:chrome": "yarn prebuild && cross-env BROWSER='chrome' MINIFY='true' vite build", "build:firefox": "yarn prebuild && cross-env BROWSER='firefox' MINIFY='true' vite build && node configs/get-system-info.js", "build:opera": "yarn prebuild && cross-env BROWSER='opera' MINIFY='true' vite build", + "build:safari": "yarn prebuild && cross-env BROWSER='safari' MINIFY='true' vite build", "kadena:prebuild": "pactjs contract-generate --contract=coin --api https://api.chainweb.com/chainweb/0.0/mainnet01/chain/1/pact", "test": "vitest run -c ./configs/vitest.config.mts", "watch": "yarn dev", diff --git a/packages/extension/public/assets/img/safari-icons/icon16.png b/packages/extension/public/assets/img/safari-icons/icon16.png new file mode 100644 index 000000000..5417fe2bf Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon16.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon19.png b/packages/extension/public/assets/img/safari-icons/icon19.png new file mode 100644 index 000000000..1546c7a1e Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon19.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon192.png b/packages/extension/public/assets/img/safari-icons/icon192.png new file mode 100644 index 000000000..969f1dbc3 Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon192.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon32.png b/packages/extension/public/assets/img/safari-icons/icon32.png new file mode 100644 index 000000000..1c0eefd1a Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon32.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon38.png b/packages/extension/public/assets/img/safari-icons/icon38.png new file mode 100644 index 000000000..cfac73cb3 Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon38.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon48.png b/packages/extension/public/assets/img/safari-icons/icon48.png new file mode 100644 index 000000000..4f363deee Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon48.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon64.png b/packages/extension/public/assets/img/safari-icons/icon64.png new file mode 100644 index 000000000..a2d3a89de Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon64.png differ diff --git a/packages/extension/public/assets/img/safari-icons/icon72.png b/packages/extension/public/assets/img/safari-icons/icon72.png new file mode 100644 index 000000000..673c2ab57 Binary files /dev/null and b/packages/extension/public/assets/img/safari-icons/icon72.png differ diff --git a/packages/extension/src/libs/utils/selective-wasm.ts b/packages/extension/src/libs/utils/selective-wasm.ts new file mode 100644 index 000000000..989452645 --- /dev/null +++ b/packages/extension/src/libs/utils/selective-wasm.ts @@ -0,0 +1,6 @@ +import { createWasm } from '@polkadot/wasm-crypto-init/asm'; +import { initBridge } from '@polkadot/wasm-crypto/init'; + +if (__IS_SAFARI__) { + initBridge(createWasm); +} diff --git a/packages/extension/src/manifest/manifest-safari.json b/packages/extension/src/manifest/manifest-safari.json new file mode 100644 index 000000000..e38a03fcb --- /dev/null +++ b/packages/extension/src/manifest/manifest-safari.json @@ -0,0 +1,58 @@ +{ + "name": "Enkrypt: ETH, BTC and Solana Wallet", + "manifest_version": 3, + "action": { + "default_icon": { + "16": "assets/img/safari-icons/icon16.png", + "19": "assets/img/safari-icons/icon19.png", + "32": "assets/img/safari-icons/icon32.png", + "38": "assets/img/safari-icons/icon38.png", + "48": "assets/img/safari-icons/icon48.png", + "64": "assets/img/safari-icons/icon64.png", + "72": "assets/img/safari-icons/icon72.png", + "192": "assets/img/safari-icons/icon192.png" + }, + "default_title": "Enkrypt", + "default_popup": "action.html" + }, + "background": { + "service_worker": "scripts/background.js" + }, + "web_accessible_resources": [ + { + "resources": ["scripts/inject.js", "scripts/*.js.map"], + "use_dynamic_url": false, + "matches": ["http://*/*", "https://*/*"] + } + ], + "content_scripts": [ + { + "matches": ["file://*/*", "http://*/*", "https://*/*"], + "js": ["scripts/contentscript.js"], + "run_at": "document_start", + "all_frames": false + }, + { + "matches": ["*://connect.trezor.io/*/popup.html"], + "js": ["vendor/trezor-content-script.js"], + "run_at": "document_start" + } + ], + "host_permissions": ["file://*/*", "http://*/*", "https://*/*"], + "content_security_policy": { + "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self'" + }, + "permissions": [ + "storage", + "unlimitedStorage", + "tabs", + "clipboardWrite", + "scripting" + ], + "browser_specific_settings": { + "safari": { + "strict_min_version": "16.6", + "strict_max_version": "18.*" + } + } +} diff --git a/packages/extension/src/manifest/manifest.safari.ts b/packages/extension/src/manifest/manifest.safari.ts new file mode 100644 index 000000000..d54d5f8d1 --- /dev/null +++ b/packages/extension/src/manifest/manifest.safari.ts @@ -0,0 +1,30 @@ +import { defineManifest, ManifestV3Export } from '@crxjs/vite-plugin'; +import { chromeManifest } from './manifest.chrome'; +const operaManifest = { + ...chromeManifest, + action: { + default_icon: { + '16': 'assets/img/safari-icons/icon16.png', + '19': 'assets/img/safari-icons/icon19.png', + '32': 'assets/img/safari-icons/icon32.png', + '38': 'assets/img/safari-icons/icon38.png', + '48': 'assets/img/safari-icons/icon48.png', + '64': 'assets/img/safari-icons/icon64.png', + '72': 'assets/img/safari-icons/icon72.png', + '192': 'assets/img/safari-icons/icon192.png', + }, + default_title: 'Enkrypt', + default_popup: 'action.html', + }, + host_permissions: ['file://*/*', 'http://*/*', 'https://*/*'], + permissions: [ + 'storage', + 'unlimitedStorage', + 'tabs', + 'clipboardRead', + 'clipboardWrite', + 'scripting', + ], +} as ManifestV3Export; + +export default defineManifest(operaManifest); diff --git a/packages/extension/src/scripts/chrome/background.ts b/packages/extension/src/scripts/chrome/background.ts index 82efce701..9f9290ae9 100644 --- a/packages/extension/src/scripts/chrome/background.ts +++ b/packages/extension/src/scripts/chrome/background.ts @@ -35,7 +35,7 @@ Browser.runtime.onInstalled.addListener(object => { } }); -if (__IS_OPERA__) { +if (__IS_OPERA__ || __IS_SAFARI__) { Browser.scripting.registerContentScripts([ { id: 'inject-script', diff --git a/packages/extension/src/ui/action/components/network-menu/index.vue b/packages/extension/src/ui/action/components/network-menu/index.vue index 3002a6d13..9352954bc 100644 --- a/packages/extension/src/ui/action/components/network-menu/index.vue +++ b/packages/extension/src/ui/action/components/network-menu/index.vue @@ -21,7 +21,7 @@
NFTs @@ -160,7 +162,7 @@ const props = defineProps({ }); const accountToRename = ref(); const accountToDelete = ref(); - +const isBrowserHWSupported = !(__IS_FIREFOX__ || __IS_SAFARI__); const close = () => { props.toggle(); }; diff --git a/packages/extension/src/ui/action/views/deposit/index.vue b/packages/extension/src/ui/action/views/deposit/index.vue index 2f4eca623..1997418ef 100644 --- a/packages/extension/src/ui/action/views/deposit/index.vue +++ b/packages/extension/src/ui/action/views/deposit/index.vue @@ -119,7 +119,7 @@ const depositCopy = computed(() => { height: 600px; left: -340px; top: 0px; - position: fixed; + position: absolute; z-index: 105; display: none; box-sizing: border-box; diff --git a/packages/extension/src/ui/action/views/import-account/index.vue b/packages/extension/src/ui/action/views/import-account/index.vue index 88b44eb30..5a620be4b 100644 --- a/packages/extension/src/ui/action/views/import-account/index.vue +++ b/packages/extension/src/ui/action/views/import-account/index.vue @@ -211,7 +211,7 @@ const walletUpdate = (wallet: KeyPairAdd) => { height: 600px; left: -340px; top: 0px; - position: fixed; + position: absolute; z-index: 105; display: flex; box-sizing: border-box; diff --git a/packages/extension/src/ui/action/views/network-activity/components/network-activity-action.vue b/packages/extension/src/ui/action/views/network-activity/components/network-activity-action.vue index 20b93cc0a..057473492 100644 --- a/packages/extension/src/ui/action/views/network-activity/components/network-activity-action.vue +++ b/packages/extension/src/ui/action/views/network-activity/components/network-activity-action.vue @@ -4,7 +4,11 @@ Deposit - + Buy/Sell Send