├── .commitlintrc.json
├── .github
├── ISSUE_TEMPLATE.md
└── workflows
│ └── release.yml
├── .gitignore
├── .npmignore
├── .releaserc.json
├── .vscode
└── settings.json
├── CONTRIBUTING.md
├── CapacitorCodePush.podspec
├── LICENSE.md
├── README.md
├── SUPPORT.md
├── android
├── .gitignore
├── build.gradle
├── gradle.properties
├── proguard-rules.pro
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── microsoft
│ └── capacitor
│ ├── CodePush.java
│ ├── CodePushException.java
│ ├── CodePushPackageManager.java
│ ├── CodePushPackageMetadata.java
│ ├── CodePushPreferences.java
│ ├── CodePushReportingManager.java
│ ├── InstallMode.java
│ ├── InstallOptions.java
│ ├── ReportingStatus.java
│ ├── StatusReport.java
│ ├── UpdateHashUtils.java
│ └── Utilities.java
├── dist
├── esm
│ ├── callbackUtil.d.ts
│ ├── callbackUtil.js
│ ├── callbackUtil.js.map
│ ├── codePush.d.ts
│ ├── codePush.js
│ ├── codePush.js.map
│ ├── codePushUtil.d.ts
│ ├── codePushUtil.js
│ ├── codePushUtil.js.map
│ ├── fileUtil.d.ts
│ ├── fileUtil.js
│ ├── fileUtil.js.map
│ ├── httpRequester.d.ts
│ ├── httpRequester.js
│ ├── httpRequester.js.map
│ ├── index.d.ts
│ ├── index.js
│ ├── index.js.map
│ ├── installMode.d.ts
│ ├── installMode.js
│ ├── installMode.js.map
│ ├── installOptions.d.ts
│ ├── installOptions.js
│ ├── installOptions.js.map
│ ├── localPackage.d.ts
│ ├── localPackage.js
│ ├── localPackage.js.map
│ ├── nativeAppInfo.d.ts
│ ├── nativeAppInfo.js
│ ├── nativeAppInfo.js.map
│ ├── nativeCodePushPlugin.d.ts
│ ├── nativeCodePushPlugin.js
│ ├── nativeCodePushPlugin.js.map
│ ├── package.d.ts
│ ├── package.js
│ ├── package.js.map
│ ├── remotePackage.d.ts
│ ├── remotePackage.js
│ ├── remotePackage.js.map
│ ├── sdk.d.ts
│ ├── sdk.js
│ ├── sdk.js.map
│ ├── syncOptions.d.ts
│ ├── syncOptions.js
│ ├── syncOptions.js.map
│ ├── syncStatus.d.ts
│ ├── syncStatus.js
│ └── syncStatus.js.map
├── plugin.js
└── plugin.js.map
├── gulpfile.js
├── ios
├── Plugin.xcodeproj
│ └── project.pbxproj
├── Plugin.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── Plugin
│ ├── Base64
│ │ ├── CodePushMF_Base64Additions.h
│ │ └── CodePushMF_Base64Additions.m
│ ├── CDVWKWebViewEngine+CodePush.m
│ ├── CodePush.h
│ ├── CodePush.m
│ ├── CodePushPackageManager.h
│ ├── CodePushPackageManager.m
│ ├── CodePushPackageMetadata.h
│ ├── CodePushPackageMetadata.m
│ ├── CodePushPlugin.h
│ ├── CodePushPlugin.m
│ ├── CodePushReportingManager.h
│ ├── CodePushReportingManager.m
│ ├── InstallMode.h
│ ├── InstallOptions.h
│ ├── InstallOptions.m
│ ├── JWT
│ │ ├── Core
│ │ │ ├── Algorithms
│ │ │ │ ├── Base
│ │ │ │ │ ├── CodePushJWTAlgorithm.h
│ │ │ │ │ ├── CodePushJWTAlgorithmFactory.h
│ │ │ │ │ ├── CodePushJWTAlgorithmFactory.m
│ │ │ │ │ ├── CodePushJWTAlgorithmNone.h
│ │ │ │ │ └── CodePushJWTAlgorithmNone.m
│ │ │ │ ├── ESFamily
│ │ │ │ │ ├── CodePushJWTAlgorithmESBase.h
│ │ │ │ │ └── CodePushJWTAlgorithmESBase.m
│ │ │ │ ├── HSFamily
│ │ │ │ │ ├── CodePushJWTAlgorithmHSBase.h
│ │ │ │ │ └── CodePushJWTAlgorithmHSBase.m
│ │ │ │ ├── Holders
│ │ │ │ │ ├── CodePushJWTAlgorithmDataHolder.h
│ │ │ │ │ ├── CodePushJWTAlgorithmDataHolder.m
│ │ │ │ │ ├── CodePushJWTAlgorithmDataHolderChain.h
│ │ │ │ │ └── CodePushJWTAlgorithmDataHolderChain.m
│ │ │ │ └── RSFamily
│ │ │ │ │ ├── CodePushJWTAlgorithmRSBase.h
│ │ │ │ │ ├── CodePushJWTAlgorithmRSBase.m
│ │ │ │ │ ├── CodePushJWTRSAlgorithm.h
│ │ │ │ │ └── RSKeys
│ │ │ │ │ ├── CodePushJWTCryptoKey.h
│ │ │ │ │ ├── CodePushJWTCryptoKey.m
│ │ │ │ │ ├── CodePushJWTCryptoKeyExtractor.h
│ │ │ │ │ ├── CodePushJWTCryptoKeyExtractor.m
│ │ │ │ │ ├── CodePushJWTCryptoSecurity.h
│ │ │ │ │ └── CodePushJWTCryptoSecurity.m
│ │ │ ├── ClaimSet
│ │ │ │ ├── CodePushJWTClaim.h
│ │ │ │ ├── CodePushJWTClaim.m
│ │ │ │ ├── CodePushJWTClaimsSet.h
│ │ │ │ ├── CodePushJWTClaimsSet.m
│ │ │ │ ├── CodePushJWTClaimsSetSerializer.h
│ │ │ │ ├── CodePushJWTClaimsSetSerializer.m
│ │ │ │ ├── CodePushJWTClaimsSetVerifier.h
│ │ │ │ └── CodePushJWTClaimsSetVerifier.m
│ │ │ ├── Coding
│ │ │ │ ├── CodePushJWTCoding+ResultTypes.h
│ │ │ │ ├── CodePushJWTCoding+ResultTypes.m
│ │ │ │ ├── CodePushJWTCoding+VersionOne.h
│ │ │ │ ├── CodePushJWTCoding+VersionOne.m
│ │ │ │ ├── CodePushJWTCoding+VersionThree.h
│ │ │ │ ├── CodePushJWTCoding+VersionThree.m
│ │ │ │ ├── CodePushJWTCoding+VersionTwo.h
│ │ │ │ ├── CodePushJWTCoding+VersionTwo.m
│ │ │ │ ├── CodePushJWTCoding.h
│ │ │ │ └── CodePushJWTCoding.m
│ │ │ ├── FrameworkSupplement
│ │ │ │ └── CodePushJWT.h
│ │ │ └── Supplement
│ │ │ │ ├── CodePushJWTBase64Coder.h
│ │ │ │ ├── CodePushJWTBase64Coder.m
│ │ │ │ ├── CodePushJWTDeprecations.h
│ │ │ │ ├── CodePushJWTErrorDescription.h
│ │ │ │ └── CodePushJWTErrorDescription.m
│ │ └── LICENSE
│ ├── StatusReport.h
│ ├── StatusReport.m
│ ├── UpdateHashUtils.h
│ ├── UpdateHashUtils.m
│ ├── Utilities.h
│ └── Utilities.m
├── PluginTests
│ ├── Info.plist
│ └── PluginTests.swift
├── Podfile
├── Podfile.lock
└── Pods
│ ├── Local Podspecs
│ ├── Capacitor.podspec.json
│ └── CapacitorCordova.podspec.json
│ ├── Manifest.lock
│ ├── Pods.xcodeproj
│ ├── project.pbxproj
│ └── xcuserdata
│ │ └── sangmin.xcuserdatad
│ │ └── xcschemes
│ │ ├── Capacitor.xcscheme
│ │ ├── CapacitorCordova.xcscheme
│ │ ├── Pods-Plugin.xcscheme
│ │ ├── Pods-PluginTests.xcscheme
│ │ ├── naveridlogin-sdk-ios.xcscheme
│ │ └── xcschememanagement.plist
│ ├── Target Support Files
│ ├── Capacitor
│ │ ├── Capacitor-Info.plist
│ │ ├── Capacitor-dummy.m
│ │ ├── Capacitor-prefix.pch
│ │ ├── Capacitor.debug.xcconfig
│ │ ├── Capacitor.modulemap
│ │ └── Capacitor.release.xcconfig
│ ├── CapacitorCordova
│ │ ├── CapacitorCordova-Info.plist
│ │ ├── CapacitorCordova-dummy.m
│ │ ├── CapacitorCordova-prefix.pch
│ │ ├── CapacitorCordova.debug.xcconfig
│ │ ├── CapacitorCordova.modulemap
│ │ └── CapacitorCordova.release.xcconfig
│ ├── Pods-Plugin
│ │ ├── Pods-Plugin-Info.plist
│ │ ├── Pods-Plugin-acknowledgements.markdown
│ │ ├── Pods-Plugin-acknowledgements.plist
│ │ ├── Pods-Plugin-dummy.m
│ │ ├── Pods-Plugin-umbrella.h
│ │ ├── Pods-Plugin.debug.xcconfig
│ │ ├── Pods-Plugin.modulemap
│ │ └── Pods-Plugin.release.xcconfig
│ ├── Pods-PluginTests
│ │ ├── Pods-PluginTests-Info.plist
│ │ ├── Pods-PluginTests-acknowledgements.markdown
│ │ ├── Pods-PluginTests-acknowledgements.plist
│ │ ├── Pods-PluginTests-dummy.m
│ │ ├── Pods-PluginTests-frameworks.sh
│ │ ├── Pods-PluginTests-umbrella.h
│ │ ├── Pods-PluginTests.debug.xcconfig
│ │ ├── Pods-PluginTests.modulemap
│ │ └── Pods-PluginTests.release.xcconfig
│ └── naveridlogin-sdk-ios
│ │ ├── naveridlogin-sdk-ios.debug.xcconfig
│ │ └── naveridlogin-sdk-ios.release.xcconfig
│ └── naveridlogin-sdk-ios
│ ├── LICENSE
│ ├── NaverThirdPartyLogin.framework
│ ├── Headers
│ │ ├── NaverThirdPartyConstantsForApp.h
│ │ ├── NaverThirdPartyLogin.h
│ │ └── NaverThirdPartyLoginConnection.h
│ ├── Info.plist
│ ├── Modules
│ │ └── module.modulemap
│ ├── NaverAuth.bundle
│ │ ├── btn_notice_close_normal@2x.png
│ │ ├── en.lproj
│ │ │ └── NaverAuth.strings
│ │ ├── ko.lproj
│ │ │ └── NaverAuth.strings
│ │ ├── login_banner_btn_close@2x.png
│ │ ├── login_banner_btn_close@3x.png
│ │ ├── login_naverapp_logo@2x.png
│ │ ├── login_naverapp_logo@3x.png
│ │ ├── zh-Hans.lproj
│ │ │ └── NaverAuth.strings
│ │ └── zh-Hant.lproj
│ │ │ └── NaverAuth.strings
│ └── NaverThirdPartyLogin
│ └── README.md
├── package-lock.json
├── package.json
├── rollup.config.js
├── samples
├── .gitignore
├── advanced
│ ├── README.md
│ ├── config.xml
│ └── www
│ │ ├── css
│ │ └── index.css
│ │ ├── img
│ │ └── logo.png
│ │ ├── index.html
│ │ └── js
│ │ └── index.js
└── basic
│ ├── README.md
│ ├── config.xml
│ └── www
│ ├── css
│ └── index.css
│ ├── img
│ └── logo.png
│ ├── index.html
│ └── js
│ └── index.js
├── src
├── callbackUtil.ts
├── codePush.ts
├── codePushUtil.ts
├── fileUtil.ts
├── http.ts
├── httpRequester.ts
├── index.ts
├── installMode.ts
├── installOptions.ts
├── localPackage.ts
├── nativeAppInfo.ts
├── nativeCodePushPlugin.ts
├── package.ts
├── remotePackage.ts
├── sdk.ts
├── syncOptions.ts
└── syncStatus.ts
├── test
├── platform.ts
├── projectManager.ts
├── serverUtil.ts
├── template
│ ├── build.json
│ ├── package.json
│ └── www
│ │ ├── index.html
│ │ └── js
│ │ ├── scenarioCheckForUpdate.js
│ │ ├── scenarioCheckForUpdateCustomKey.js
│ │ ├── scenarioDownloadUpdate.js
│ │ ├── scenarioInstall.js
│ │ ├── scenarioInstallOnRestart2xWithRevert.js
│ │ ├── scenarioInstallOnRestartWithRevert.js
│ │ ├── scenarioInstallOnResumeWithRevert.js
│ │ ├── scenarioInstallWithRevert.js
│ │ ├── scenarioRestart.js
│ │ ├── scenarioSetup.js
│ │ ├── scenarioSync.js
│ │ ├── scenarioSync2x.js
│ │ ├── scenarioSyncMandatoryDefault.js
│ │ ├── scenarioSyncMandatoryRestart.js
│ │ ├── scenarioSyncMandatoryResume.js
│ │ ├── scenarioSyncRestartDelay.js
│ │ ├── scenarioSyncResume.js
│ │ ├── scenarioSyncResumeDelay.js
│ │ ├── updateDeviceReady.js
│ │ ├── updateNARConditional.js
│ │ ├── updateNotifyApplicationReady.js
│ │ ├── updateSync.js
│ │ └── updateSync2x.js
├── test.ts
└── testUtil.ts
├── tsconfig.json
├── tslint.json
└── typings
└── replace.d.ts
/.commitlintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "@commitlint/config-conventional"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
2 |
3 | ### Description
4 |
5 | [FILL THIS OUT: Explain what you did, what you expected to happen, and what actually happens. Also exact reproduction steps and stack trace will be much appreciated.]
6 |
7 | ### Reproduction
8 |
9 | [FILL THIS OUT: If possible try to reproduce your bug on our basic sample: https://github.com/Microsoft/cordova-plugin-code-push/tree/master/samples/basic. If you can't reproduce the bug on it, provide us as much info as possible about your project.]
10 |
11 | ### Additional Information
12 |
13 | * cordova-plugin-code-push version:
14 | * List of installed plugins:
15 | * Cordova version:
16 | * iOS/Android/Windows version:
17 | * Does this reproduce on a debug build or release build?
18 | * Does this reproduce on a simulator, or only on a physical device?
19 |
20 | (The more info the faster we will be able to address it!)
21 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | repository_dispatch:
4 | types: [semantic-release]
5 | jobs:
6 | release:
7 | name: Release
8 | runs-on: ubuntu-18.04
9 | steps:
10 | - name: Checkout
11 | uses: actions/checkout@v1
12 | - name: Setup Node.js
13 | uses: actions/setup-node@v1
14 | with:
15 | node-version: 12
16 | - name: Install dependencies
17 | run: npm ci
18 | - name: Build
19 | run: npx tsc
20 | - name: Lint
21 | run: npx tslint --project .
22 | - name: Release
23 | env:
24 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25 | NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 | run: npx semantic-release
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | #ignore the files built by npm install
3 | node_modules/*
4 |
5 | #ignore the compiled files
6 | bin/*
7 |
8 | #ignore the test output files
9 | test-*
10 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .npmignore
2 | .gitignore
3 | .commitlintrc.json
4 | .releaserc.json
5 | gulpfile.js
6 | node_modules/*
7 | samples/*
8 | test/*
9 | www/*
10 | bin/test/*
11 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "branches": [
3 | "master",
4 | {
5 | "name": "capacitor",
6 | "prerelease": true
7 | }
8 | ],
9 | "plugins": [
10 | "@semantic-release/commit-analyzer",
11 | "@semantic-release/release-notes-generator",
12 | "@semantic-release/npm",
13 | "@semantic-release/git"
14 | ]
15 | }
16 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "typescript.tsdk": "node_modules/typescript/lib"
3 | }
4 |
--------------------------------------------------------------------------------
/CapacitorCodePush.podspec:
--------------------------------------------------------------------------------
1 | require 'json'
2 |
3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4 |
5 | Pod::Spec.new do |s|
6 | s.name = 'CapacitorCodepush'
7 | s.version = package['version']
8 | s.summary = package['description']
9 | s.license = package['license']
10 | s.homepage = package['homepage']
11 | s.author = package['author']
12 | s.source = { :git => package['repository'], :tag => s.version.to_s }
13 | s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
14 | s.ios.deployment_target = '12.0'
15 | s.dependency 'Capacitor'
16 | s.dependency 'SSZipArchive'
17 | s.swift_version = '5.0'
18 | end
19 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | CodePush Plugin for Apache Capacitor
2 |
3 | MIT License
4 |
5 | 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:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | 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.
10 |
--------------------------------------------------------------------------------
/SUPPORT.md:
--------------------------------------------------------------------------------
1 | # Support
2 |
3 | ## How to file issues and get help
4 | This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates. For new issues, file your bug or feature request as a new issue.
5 | For help and questions about using this project, please consider reaching out to the App Center support team using the support feature in your App Center account if you have one - otherwise please create an issue in this repository.
6 |
7 | ## Microsoft Support Policy
8 | Support for this project is limited to the resources listed above.
9 |
10 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /.gradle
3 | /gradlew
4 | /gradlew.bat
5 | /gradle
6 | /local.properties
7 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | # AndroidX package structure to make it clearer which packages are bundled with the
20 | # Android operating system, and which are packaged with your app's APK
21 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
22 | android.useAndroidX=true
23 | # Automatically convert third-party libraries to use AndroidX
24 | android.enableJetifier=true
25 |
--------------------------------------------------------------------------------
/android/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
23 | -keep public class com.nhn.android.naverlogin.** {
24 | public protected *;
25 | }
26 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':capacitor-android'
2 | project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor')
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/java/com/microsoft/capacitor/CodePushException.java:
--------------------------------------------------------------------------------
1 | package com.microsoft.capacitor;
2 |
3 | public class CodePushException extends Exception {
4 | public CodePushException() {
5 | }
6 |
7 | public CodePushException(String message) {
8 | super(message);
9 | }
10 |
11 | public CodePushException(String message, Throwable cause) {
12 | super(message, cause);
13 | }
14 |
15 | public CodePushException(Throwable cause) {
16 | super(cause);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/android/src/main/java/com/microsoft/capacitor/InstallMode.java:
--------------------------------------------------------------------------------
1 | package com.microsoft.capacitor;
2 |
3 | /**
4 | * Defines the available InstallModes.
5 | */
6 | public enum InstallMode {
7 | IMMEDIATE(0),
8 | ON_NEXT_RESTART(1),
9 | ON_NEXT_RESUME(2);
10 |
11 | private int value;
12 |
13 | InstallMode(int i) {
14 | this.value = i;
15 | }
16 |
17 | /**
18 | * Returns the InstallMode associated with a given value.
19 | * If no InstallMode is associated with the provided value, null is returned.
20 | */
21 | public static InstallMode fromValue(int i) {
22 | for (InstallMode mode : InstallMode.values()) {
23 | if (i == mode.value) {
24 | return mode;
25 | }
26 | }
27 |
28 | return null;
29 | }
30 |
31 | /**
32 | * Returns the value associated with this enum.
33 | */
34 | public int getValue() {
35 | return this.value;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/android/src/main/java/com/microsoft/capacitor/InstallOptions.java:
--------------------------------------------------------------------------------
1 | package com.microsoft.capacitor;
2 |
3 | /**
4 | * Defines the update installation options.
5 | */
6 | public class InstallOptions {
7 | public InstallMode installMode;
8 | public int minimumBackgroundDuration;
9 |
10 | public InstallOptions(InstallMode installMode, int minimumBackgroundDuration) {
11 | this.installMode = installMode;
12 | this.minimumBackgroundDuration = minimumBackgroundDuration;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/android/src/main/java/com/microsoft/capacitor/ReportingStatus.java:
--------------------------------------------------------------------------------
1 | package com.microsoft.capacitor;
2 |
3 | /**
4 | * Defines application statuses we use in reporting events from the native to the JS layer.
5 | */
6 | public enum ReportingStatus {
7 | STORE_VERSION(0),
8 | UPDATE_CONFIRMED(1),
9 | UPDATE_ROLLED_BACK(2);
10 |
11 | private int value;
12 |
13 | ReportingStatus(int i) {
14 | this.value = i;
15 | }
16 |
17 | /**
18 | * Returns the value associated with this enum.
19 | */
20 | public int getValue() {
21 | return this.value;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/dist/esm/callbackUtil.d.ts:
--------------------------------------------------------------------------------
1 | export interface Callback {
2 | (error: Error | null | undefined, parameter: T): void;
3 | }
4 | export interface SuccessCallback {
5 | (result?: T): void;
6 | }
7 | export interface ErrorCallback {
8 | (error?: Error | null | undefined): void;
9 | }
10 |
--------------------------------------------------------------------------------
/dist/esm/callbackUtil.js:
--------------------------------------------------------------------------------
1 | export {};
2 | //# sourceMappingURL=callbackUtil.js.map
--------------------------------------------------------------------------------
/dist/esm/callbackUtil.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"callbackUtil.js","sourceRoot":"","sources":["../../src/callbackUtil.ts"],"names":[],"mappings":""}
--------------------------------------------------------------------------------
/dist/esm/codePushUtil.d.ts:
--------------------------------------------------------------------------------
1 | import { Callback, ErrorCallback, SuccessCallback } from "./callbackUtil";
2 | /**
3 | * Callback / error / logging utilities.
4 | */
5 | export declare class CodePushUtil {
6 | /**
7 | * Tag used for logging to the console.
8 | */
9 | private static TAG;
10 | /**
11 | * Performs a copy of all members of fromParameter to toParameter, with the condition that they are unassigned or null in toParameter.
12 | */
13 | static copyUnassignedMembers(fromParameter: any, toParameter: any): void;
14 | /**
15 | * Given two Cordova style callbacks for success and error, this function returns a node.js
16 | * style callback where the error is the first parameter and the result the second.
17 | */
18 | static getNodeStyleCallbackFor(successCallback: SuccessCallback, errorCallback: {
19 | (error?: any): void;
20 | }): Callback;
21 | /**
22 | * Gets the message of an error, if any. Otherwise it returns the empty string.
23 | */
24 | static getErrorMessage(e: Error | undefined): string;
25 | /**
26 | * Logs the error to the console and then forwards it to the provided ErrorCallback, if any.
27 | * TODO: remove me
28 | */
29 | static invokeErrorCallback: (error: Error, errorCallback: ErrorCallback) => void;
30 | /**
31 | * Logs the error to the console and then throws the error.
32 | */
33 | static throwError: (error: Error) => void;
34 | /**
35 | * Logs a message using the CodePush tag.
36 | */
37 | static logMessage(msg: string): void;
38 | /**
39 | * Logs an error message using the CodePush tag.
40 | */
41 | static logError(message: String, error?: Error): void;
42 | }
43 |
--------------------------------------------------------------------------------
/dist/esm/codePushUtil.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Callback / error / logging utilities.
3 | */
4 | export class CodePushUtil {
5 | /**
6 | * Performs a copy of all members of fromParameter to toParameter, with the condition that they are unassigned or null in toParameter.
7 | */
8 | static copyUnassignedMembers(fromParameter, toParameter) {
9 | for (let key in fromParameter) {
10 | if (toParameter[key] === undefined || toParameter[key] === null) {
11 | toParameter[key] = fromParameter[key];
12 | }
13 | }
14 | }
15 | /**
16 | * Given two Cordova style callbacks for success and error, this function returns a node.js
17 | * style callback where the error is the first parameter and the result the second.
18 | */
19 | static getNodeStyleCallbackFor(successCallback, errorCallback) {
20 | return (error, result) => {
21 | if (error) {
22 | errorCallback && errorCallback(error);
23 | }
24 | else {
25 | successCallback && successCallback(result);
26 | }
27 | };
28 | }
29 | /**
30 | * Gets the message of an error, if any. Otherwise it returns the empty string.
31 | */
32 | static getErrorMessage(e) {
33 | return e && e.message || e && e.toString() || "";
34 | }
35 | /**
36 | * Logs a message using the CodePush tag.
37 | */
38 | static logMessage(msg) {
39 | console.log(CodePushUtil.TAG + " " + msg);
40 | }
41 | /**
42 | * Logs an error message using the CodePush tag.
43 | */
44 | static logError(message, error) {
45 | const errorMessage = `${message || ""} ${CodePushUtil.getErrorMessage(error)}`;
46 | const stackTrace = error && error.stack ? `. StackTrace: ${error.stack}` : "";
47 | console.error(`${CodePushUtil.TAG} ${errorMessage}${stackTrace}`);
48 | }
49 | }
50 | /**
51 | * Tag used for logging to the console.
52 | */
53 | CodePushUtil.TAG = "[CodePush]";
54 | /**
55 | * Logs the error to the console and then forwards it to the provided ErrorCallback, if any.
56 | * TODO: remove me
57 | */
58 | CodePushUtil.invokeErrorCallback = (error, errorCallback) => {
59 | CodePushUtil.logError(null, error);
60 | errorCallback && errorCallback(error);
61 | };
62 | /**
63 | * Logs the error to the console and then throws the error.
64 | */
65 | CodePushUtil.throwError = (error) => {
66 | CodePushUtil.logError(null, error);
67 | throw error;
68 | };
69 | //# sourceMappingURL=codePushUtil.js.map
--------------------------------------------------------------------------------
/dist/esm/codePushUtil.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"codePushUtil.js","sourceRoot":"","sources":["../../src/codePushUtil.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,OAAO,YAAY;IAOrB;;OAEG;IACI,MAAM,CAAC,qBAAqB,CAAC,aAAkB,EAAE,WAAgB;QACpE,KAAK,IAAI,GAAG,IAAI,aAAa,EAAE;YAC3B,IAAU,WAAY,CAAC,GAAG,CAAC,KAAK,SAAS,IAAU,WAAY,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE;gBACrE,WAAY,CAAC,GAAG,CAAC,GAAS,aAAc,CAAC,GAAG,CAAC,CAAC;aACvD;SACJ;IACL,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,uBAAuB,CAAI,eAAmC,EAAE,aAAuC;QACjH,OAAO,CAAC,KAAU,EAAE,MAAS,EAAE,EAAE;YAC7B,IAAI,KAAK,EAAE;gBACP,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;aACzC;iBAAM;gBACH,eAAe,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;aAC9C;QACL,CAAC,CAAC;IACN,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,eAAe,CAAC,CAAoB;QAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;IACrD,CAAC;IAmBD;;OAEG;IACI,MAAM,CAAC,UAAU,CAAC,GAAW;QAChC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,QAAQ,CAAC,OAAe,EAAE,KAAa;QACjD,MAAM,YAAY,GAAG,GAAG,OAAO,IAAI,EAAE,IAAI,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/E,MAAM,UAAU,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,iBAAiB,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,GAAG,IAAI,YAAY,GAAG,UAAU,EAAE,CAAC,CAAC;IACtE,CAAC;;AApED;;GAEG;AACY,gBAAG,GAAW,YAAY,CAAC;AAkC1C;;;GAGG;AACW,gCAAmB,GAAG,CAAC,KAAY,EAAE,aAA4B,EAAQ,EAAE;IACrF,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnC,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AAC1C,CAAC,CAAA;AAED;;GAEG;AACW,uBAAU,GAAG,CAAC,KAAY,EAAQ,EAAE;IAC9C,YAAY,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACnC,MAAM,KAAK,CAAC;AAChB,CAAC,CAAA"}
--------------------------------------------------------------------------------
/dist/esm/fileUtil.d.ts:
--------------------------------------------------------------------------------
1 | import { Directory, GetUriOptions } from "@capacitor/filesystem";
2 | import { Callback } from "./callbackUtil";
3 | /**
4 | * File utilities for CodePush.
5 | */
6 | export declare class FileUtil {
7 | static directoryExists(directory: Directory, path: string): Promise;
8 | static writeStringToDataFile(content: string, path: string, createIfNotExists: boolean, callback: Callback): void;
9 | static fileExists(directory: Directory, path: string): Promise;
10 | /**
11 | * Makes sure the given directory exists and is empty.
12 | */
13 | static cleanDataDirectory(path: string): Promise;
14 | static getUri(fsDir: Directory, path: string): Promise;
15 | static getDataUri(path: string): Promise;
16 | static dataDirectoryExists(path: string): Promise;
17 | static copyDirectoryEntriesTo(sourceDir: GetUriOptions, destinationDir: GetUriOptions, ignoreList?: string[]): Promise;
18 | static copy(source: GetUriOptions, destination: GetUriOptions): Promise;
19 | /**
20 | * Recursively deletes the contents of a directory.
21 | */
22 | static deleteDataDirectory(path: string): Promise;
23 | /**
24 | * Deletes a given set of files from a directory.
25 | */
26 | static deleteEntriesFromDataDirectory(dirPath: string, filesToDelete: string[]): Promise;
27 | /**
28 | * Writes a string to a file.
29 | */
30 | static writeStringToFile(data: string, directory: Directory, path: string, createIfNotExists: boolean, callback: Callback): Promise;
31 | static readFile(directory: Directory, path: string): Promise;
32 | static readDataFile(path: string): Promise;
33 | }
34 |
--------------------------------------------------------------------------------
/dist/esm/httpRequester.d.ts:
--------------------------------------------------------------------------------
1 | import { Http } from "code-push/script/acquisition-sdk";
2 | import type { Callback } from "./callbackUtil";
3 | /**
4 | * XMLHttpRequest-based implementation of Http.Requester.
5 | */
6 | export declare class HttpRequester implements Http.Requester {
7 | private contentType;
8 | constructor(contentType?: string | undefined);
9 | request(verb: Http.Verb, url: string, callbackOrRequestBody: Callback | string, callback?: Callback): void;
10 | /**
11 | * Gets the HTTP method name as a string.
12 | * The reason for which this is needed is because the Http.Verb enum corresponds to integer values from native runtime.
13 | */
14 | private getHttpMethodName;
15 | }
16 |
--------------------------------------------------------------------------------
/dist/esm/httpRequester.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"httpRequester.js","sourceRoot":"","sources":["../../src/httpRequester.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG/D;;GAEG;AACH,MAAM,OAAO,aAAa;IAGtB,YAAY,WAAgC;QACxC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IAEM,OAAO,CAAC,IAAe,EAAE,GAAW,EAAE,qBAAuD,EAAE,QAAkC;QACpI,IAAI,WAAgB,CAAC;QACrB,IAAI,eAAe,GAA4B,QAAS,CAAC;QAEzD,+BAA+B;QAC/B,IAAI,CAAC,eAAe,IAAI,OAAO,qBAAqB,KAAK,UAAU,EAAE;YACjE,eAAe,GAA4B,qBAAqB,CAAC;SACpE;QAED,4CAA4C;QAC5C,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE;YAC3C,WAAW,GAAW,qBAAqB,CAAC;SAC/C;QAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACjC,IAAI;gBACA,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,wCAAwC;aAClF;YAAC,OAAO,CAAC,EAAE;gBACR,aAAa;aAChB;SACJ;QAED,IAAI,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,UAAU,KAAK,IAAI,EAAE;YACrB,OAAO,eAAe,CAAC,IAAI,KAAK,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC,CAAC;SACjE;QAED,MAAM,OAAO,GAA8B;YACvC,wBAAwB,EAAE,0BAA0B;YACpD,2BAA2B,EAAE,SAAS;YACtC,wBAAwB,EAAE,OAAO;SACpC,CAAC;QACF,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;SAC9C;QACD,MAAM,OAAO,GAAgB;YACzB,MAAM,EAAE,UAAU;YAClB,GAAG;YACH,OAAO;SACV,CAAC;QACF,IAAI,UAAU,KAAK,KAAK,EAAE;YACtB,OAAO,CAAC,MAAM,GAAG,WAAW,CAAC;SAChC;aAAM;YACH,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;SAC9B;QACD,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAuB,EAAE,EAAE;YACzD,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;gBAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxF,IAAI,QAAQ,GAAkB,EAAE,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CAAC;YACrF,eAAe,IAAI,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACK,iBAAiB,CAAC,IAAe;QACrC,QAAQ,IAAI,EAAE;YACV;gBACI,OAAO,KAAK,CAAC;YACjB;gBACI,OAAO,QAAQ,CAAC;YACpB;gBACI,OAAO,MAAM,CAAC;YAClB;gBACI,OAAO,OAAO,CAAC;YACnB;gBACI,OAAO,MAAM,CAAC;YAClB;gBACI,OAAO,KAAK,CAAC;YACjB,mBAAqB;YACrB,qBAAuB;YACvB,qBAAuB;YACvB;gBACI,OAAO,IAAI,CAAC;SACnB;IACL,CAAC;CACJ"}
--------------------------------------------------------------------------------
/dist/esm/index.d.ts:
--------------------------------------------------------------------------------
1 | export * from "./codePush";
2 | export * from "./installMode";
3 | export * from "./installOptions";
4 | export { CodePush } from "./nativeCodePushPlugin";
5 |
--------------------------------------------------------------------------------
/dist/esm/index.js:
--------------------------------------------------------------------------------
1 | export * from "./codePush";
2 | export * from "./installMode";
3 | export * from "./installOptions";
4 | export { CodePush } from "./nativeCodePushPlugin";
5 | //# sourceMappingURL=index.js.map
--------------------------------------------------------------------------------
/dist/esm/index.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC"}
--------------------------------------------------------------------------------
/dist/esm/installMode.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the available install modes for updates.
3 | */
4 | export declare enum InstallMode {
5 | /**
6 | * The update will be applied to the running application immediately. The application will be reloaded with the new content immediately.
7 | */
8 | IMMEDIATE = 0,
9 | /**
10 | * The update is downloaded but not installed immediately. The new content will be available the next time the application is started.
11 | */
12 | ON_NEXT_RESTART = 1,
13 | /**
14 | * The udpate is downloaded but not installed immediately. The new content will be available the next time the application is resumed or restarted, whichever event happends first.
15 | */
16 | ON_NEXT_RESUME = 2
17 | }
18 |
--------------------------------------------------------------------------------
/dist/esm/installMode.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the available install modes for updates.
3 | */
4 | export var InstallMode;
5 | (function (InstallMode) {
6 | /**
7 | * The update will be applied to the running application immediately. The application will be reloaded with the new content immediately.
8 | */
9 | InstallMode[InstallMode["IMMEDIATE"] = 0] = "IMMEDIATE";
10 | /**
11 | * The update is downloaded but not installed immediately. The new content will be available the next time the application is started.
12 | */
13 | InstallMode[InstallMode["ON_NEXT_RESTART"] = 1] = "ON_NEXT_RESTART";
14 | /**
15 | * The udpate is downloaded but not installed immediately. The new content will be available the next time the application is resumed or restarted, whichever event happends first.
16 | */
17 | InstallMode[InstallMode["ON_NEXT_RESUME"] = 2] = "ON_NEXT_RESUME";
18 | })(InstallMode || (InstallMode = {}));
19 | //# sourceMappingURL=installMode.js.map
--------------------------------------------------------------------------------
/dist/esm/installMode.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"installMode.js","sourceRoot":"","sources":["../../src/installMode.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,WAeX;AAfD,WAAY,WAAW;IACrB;;OAEG;IACH,uDAAS,CAAA;IAET;;OAEG;IACH,mEAAe,CAAA;IAEf;;OAEG;IACH,iEAAc,CAAA;AAChB,CAAC,EAfW,WAAW,KAAX,WAAW,QAetB"}
--------------------------------------------------------------------------------
/dist/esm/installOptions.d.ts:
--------------------------------------------------------------------------------
1 | import { InstallMode } from "./installMode";
2 | /**
3 | * Defines the install operation options.
4 | */
5 | export interface InstallOptions {
6 | /**
7 | * Used to specify the InstallMode used for the install operation. This is optional and defaults to InstallMode.ON_NEXT_RESTART.
8 | */
9 | installMode?: InstallMode;
10 | /**
11 | * If installMode === ON_NEXT_RESUME, the minimum amount of time (in seconds) which needs to pass with the app in the background before an update install occurs when the app is resumed.
12 | */
13 | minimumBackgroundDuration?: number;
14 | /**
15 | * Used to specify the InstallMode used for the install operation if the update is mandatory. This is optional and defaults to InstallMode.IMMEDIATE.
16 | */
17 | mandatoryInstallMode?: InstallMode;
18 | }
19 |
--------------------------------------------------------------------------------
/dist/esm/installOptions.js:
--------------------------------------------------------------------------------
1 | export {};
2 | //# sourceMappingURL=installOptions.js.map
--------------------------------------------------------------------------------
/dist/esm/installOptions.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"installOptions.js","sourceRoot":"","sources":["../../src/installOptions.ts"],"names":[],"mappings":""}
--------------------------------------------------------------------------------
/dist/esm/nativeAppInfo.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Provides information about the native app.
3 | */
4 | export declare class NativeAppInfo {
5 | /**
6 | * Gets the application build timestamp.
7 | */
8 | static getApplicationBuildTime(): Promise;
9 | /**
10 | * Gets the application version.
11 | */
12 | static getApplicationVersion(): Promise;
13 | /**
14 | * Gets a hash of the `public` folder contents compiled in the app store binary.
15 | */
16 | static getBinaryHash(): Promise;
17 | /**
18 | * Gets the server URL from config.xml by calling into the native platform.
19 | */
20 | static getServerURL(): Promise;
21 | /**
22 | * Gets the deployment key from config.xml by calling into the native platform.
23 | */
24 | static getDeploymentKey(): Promise;
25 | /**
26 | * Checks if a package update was previously attempted but failed for a given package hash.
27 | * Every reverted update is stored such that the application developer has the option to ignore
28 | * updates that previously failed. This way, an infinite update loop can be prevented in case of a bad update package.
29 | */
30 | static isFailedUpdate(packageHash: string): Promise;
31 | /**
32 | * Checks if this is the first application run of a package after it has been applied.
33 | * The didUpdateCallback callback can be used for migrating data from the old app version to the new one.
34 | *
35 | * @param packageHash The hash value of the package.
36 | * @returns Whether it is the first run after an update.
37 | */
38 | static isFirstRun(packageHash: string): Promise;
39 | /**
40 | * Checks with the native side if there is a pending update.
41 | */
42 | static isPendingUpdate(): Promise;
43 | }
44 |
--------------------------------------------------------------------------------
/dist/esm/nativeAppInfo.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"nativeAppInfo.js","sourceRoot":"","sources":["../../src/nativeAppInfo.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEpE,MAAM,gBAAgB,GAAW,gCAAgC,CAAC;AAElE;;GAEG;AACH,MAAM,OAAO,aAAa;IAEtB;;OAEG;IACI,MAAM,CAAO,uBAAuB;;YACvC,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,kBAAkB,EAAE,CAAC;gBACzD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;aAC3D;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,qBAAqB;;YACrC,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC;gBACpD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;aACzD;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,aAAa;;YAC7B,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,aAAa,EAAE,CAAC;gBACpD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;aACjD;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,YAAY;;YAC5B,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,YAAY,EAAE,CAAC;gBACnD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,OAAO,gBAAgB,CAAC;aAC3B;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,gBAAgB;;YAChC,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,gBAAgB,EAAE,CAAC;gBACvD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;aAChD;QACL,CAAC;KAAA;IAED;;;;OAIG;IACI,MAAM,CAAO,cAAc,CAAC,WAAmB;;YAClD,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,cAAc,CAAC,EAAC,WAAW,EAAC,CAAC,CAAC;gBAClE,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,wCAAwC;gBACxC,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAED;;;;;;OAMG;IACI,MAAM,CAAO,UAAU,CAAC,WAAmB;;YAC9C,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,UAAU,CAAC,EAAC,WAAW,EAAC,CAAC,CAAC;gBAC9D,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,wCAAwC;gBACxC,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,eAAe;;YAC/B,IAAI;gBACA,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,eAAe,EAAE,CAAC;gBACtD,OAAO,MAAM,CAAC,KAAK,CAAC;aACvB;YAAC,OAAO,CAAC,EAAE;gBACR,wCAAwC;gBACxC,OAAO,KAAK,CAAC;aAChB;QACL,CAAC;KAAA;CACJ"}
--------------------------------------------------------------------------------
/dist/esm/nativeCodePushPlugin.d.ts:
--------------------------------------------------------------------------------
1 | import { InstallOptions } from "./installOptions";
2 | interface StatusReport {
3 | status: number;
4 | label: string;
5 | appVersion: string;
6 | deploymentKey: string;
7 | lastVersionLabelOrAppVersion: string;
8 | lastVersionDeploymentKey: string;
9 | }
10 | interface PluginCallResponse {
11 | value: T;
12 | }
13 | interface NativeDecodeSignatureOptions {
14 | publicKey: string;
15 | signature: string;
16 | }
17 | interface NativePathOptions {
18 | path: string;
19 | }
20 | interface NativeHashOptions {
21 | packageHash: string;
22 | }
23 | interface NativeInstallOptions extends InstallOptions {
24 | startLocation: string;
25 | }
26 | interface NativeUnzipOptions extends InstallOptions {
27 | zipFile: string;
28 | targetDirectory: string;
29 | }
30 | interface NativeStatusReportOptions {
31 | statusReport: StatusReport;
32 | }
33 | export interface NativeCodePushPlugin {
34 | getDeploymentKey(): Promise>;
35 | getServerURL(): Promise>;
36 | getPublicKey(): Promise>;
37 | decodeSignature(options: NativeDecodeSignatureOptions): Promise>;
38 | getBinaryHash(): Promise>;
39 | getPackageHash(options: NativePathOptions): Promise>;
40 | notifyApplicationReady(): Promise;
41 | isFirstRun(options: NativeHashOptions): Promise>;
42 | isPendingUpdate(): Promise>;
43 | isFailedUpdate(options: NativeHashOptions): Promise>;
44 | install(options: NativeInstallOptions): Promise;
45 | reportFailed(options: NativeStatusReportOptions): Promise;
46 | reportSucceeded(options: NativeStatusReportOptions): Promise;
47 | restartApplication(): Promise;
48 | preInstall(options: NativeInstallOptions): Promise;
49 | getAppVersion(): Promise>;
50 | getNativeBuildTime(): Promise>;
51 | unzip(options: NativeUnzipOptions): Promise;
52 | addListener(eventName: "codePushStatus", listenerFunc: (info: any) => void): void;
53 | }
54 | export declare const CodePush: NativeCodePushPlugin;
55 | export {};
56 |
--------------------------------------------------------------------------------
/dist/esm/nativeCodePushPlugin.js:
--------------------------------------------------------------------------------
1 | // Type definitions for Apache Cordova CodePush plugin.
2 | // Project: https://github.com/Microsoft/cordova-plugin-code-push
3 | //
4 | // Copyright (c) Microsoft Corporation
5 | // All rights reserved.
6 | // Licensed under the MIT license.
7 | import { registerPlugin } from "@capacitor/core";
8 | export const CodePush = /*#__PURE__*/ registerPlugin("CodePush");
9 | //# sourceMappingURL=nativeCodePushPlugin.js.map
--------------------------------------------------------------------------------
/dist/esm/nativeCodePushPlugin.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"nativeCodePushPlugin.js","sourceRoot":"","sources":["../../src/nativeCodePushPlugin.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,iEAAiE;AACjE,EAAE;AACF,sCAAsC;AACtC,uBAAuB;AACvB,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAgEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC,cAAc,CAAuB,UAAU,CAAC,CAAC"}
--------------------------------------------------------------------------------
/dist/esm/package.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Base class for CodePush packages.
3 | */
4 | export class Package {
5 | }
6 | //# sourceMappingURL=package.js.map
--------------------------------------------------------------------------------
/dist/esm/package.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":"AAyFA;;GAEG;AACH,MAAM,OAAO,OAAO;CASnB"}
--------------------------------------------------------------------------------
/dist/esm/remotePackage.d.ts:
--------------------------------------------------------------------------------
1 | import { SuccessCallback } from "./callbackUtil";
2 | import { DownloadProgress, ILocalPackage, IRemotePackage, Package } from "./package";
3 | /**
4 | * Defines a remote package, which represents an update package available for download.
5 | */
6 | export declare class RemotePackage extends Package implements IRemotePackage {
7 | private isDownloading;
8 | /**
9 | * The URL at which the package is available for download.
10 | */
11 | downloadUrl: string;
12 | /**
13 | * Downloads the package update from the CodePush service.
14 | * TODO: implement download progress
15 | *
16 | * @param downloadProgress Optional callback invoked during the download process. It is called several times with one DownloadProgress parameter.
17 | */
18 | download(downloadProgress?: SuccessCallback): Promise;
19 | /**
20 | * Aborts the current download session, previously started with download().
21 | */
22 | abortDownload(): Promise;
23 | }
24 |
--------------------------------------------------------------------------------
/dist/esm/remotePackage.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"remotePackage.js","sourceRoot":"","sources":["../../src/remotePackage.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAmD,OAAO,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAEjD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,OAAO;IAA1C;;QAEU,kBAAa,GAAY,KAAK,CAAC;IAgFzC,CAAC;IAzEC;;;;;OAKG;IACU,QAAQ,CAAC,gBAAoD;;YACxE,YAAY,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;YAC9C,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBACrB,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC,CAAC;aAC3F;YAED,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAE1B,MAAM,IAAI,GAAG,YAAY,CAAC,WAAW,GAAG,GAAG,GAAG,YAAY,CAAC,qBAAqB,CAAC;YACjF,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAE7D,IAAI;gBACF,iCAAiC;gBACjC,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC,EAAE;oBAC/E,MAAM,UAAU,CAAC,KAAK,CAAC;wBACrB,IAAI,EAAE,YAAY,CAAC,WAAW;wBAC9B,SAAS,EAAE,SAAS,CAAC,IAAI;wBACzB,SAAS,EAAE,IAAI;qBAChB,CAAC,CAAC;iBACJ;gBAED,2BAA2B;gBAC3B,IAAI,MAAM,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;oBACnD,MAAM,UAAU,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxE;gBAED,MAAM,IAAI,CAAC,YAAY,CAAC;oBACtB,GAAG,EAAE,IAAI,CAAC,WAAW;oBACrB,MAAM,EAAE,KAAK;oBACb,QAAQ,EAAE,IAAI;oBACd,aAAa,EAAE,SAAS,CAAC,IAAI;oBAC7B,YAAY,EAAE,MAAM;iBACrB,CAAC,CAAC;aACJ;YAAC,OAAO,CAAC,EAAE;gBACV,YAAY,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,kDAAkD,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC5H;oBAAS;gBACR,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;aAC5B;YAED,MAAM,aAAa,GAAG,MAAM,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAC3E,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;YACxC,YAAY,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC;YAChD,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAC5C,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YAChC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;YAC1C,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAC5C,YAAY,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;YAC5C,YAAY,CAAC,UAAU,GAAG,KAAK,CAAC;YAChC,YAAY,CAAC,aAAa,GAAG,aAAa,CAAC;YAC3C,YAAY,CAAC,SAAS,GAAG,QAAQ,CAAC;YAElC,YAAY,CAAC,UAAU,CAAC,4BAA4B,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;YACrF,GAAG,CAAC,oBAAoB,CAAC,YAAY,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC;YAEnE,OAAO,YAAY,CAAC;QACtB,CAAC;KAAA;IAED;;OAEG;IACU,aAAa;;YACxB,iCAAiC;YACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC7B,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;gBAC3B,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;QACL,CAAC;KAAA;CACF"}
--------------------------------------------------------------------------------
/dist/esm/sdk.d.ts:
--------------------------------------------------------------------------------
1 | import { AcquisitionManager } from "code-push/script/acquisition-sdk";
2 | import { Callback } from "./callbackUtil";
3 | import { IPackage } from "./package";
4 | /**
5 | * Interacts with the CodePush Acquisition SDK.
6 | */
7 | export declare class Sdk {
8 | private static DefaultAcquisitionManager;
9 | private static DefaultConfiguration;
10 | /**
11 | * Reads the CodePush configuration and creates an AcquisitionManager instance using it.
12 | */
13 | static getAcquisitionManager(userDeploymentKey?: string, contentType?: string): Promise;
14 | /**
15 | * Reports the deployment status to the CodePush server.
16 | */
17 | static reportStatusDeploy(pkg?: IPackage, status?: string, currentDeploymentKey?: string, previousLabelOrAppVersion?: string, previousDeploymentKey?: string, callback?: Callback): Promise;
18 | /**
19 | * Reports the download status to the CodePush server.
20 | */
21 | static reportStatusDownload(pkg: IPackage, deploymentKey?: string, callback?: Callback): Promise;
22 | }
23 |
--------------------------------------------------------------------------------
/dist/esm/sdk.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAiB,MAAM,kCAAkC,CAAC;AAErF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;GAEG;AACH,MAAM,OAAO,GAAG;IAKZ;;OAEG;IACI,MAAM,CAAO,qBAAqB,CAAC,iBAA0B,EAAE,WAAoB;;YACtF,MAAM,cAAc,GAAG,GAAgC,EAAE;gBACrD,IAAI,iBAAiB,KAAK,GAAG,CAAC,oBAAoB,CAAC,aAAa,IAAI,WAAW,EAAE;oBAC7E,IAAI,mBAAmB,GAAkB;wBACrC,aAAa,EAAE,iBAAiB,IAAI,GAAG,CAAC,oBAAoB,CAAC,aAAa;wBAC1E,SAAS,EAAE,GAAG,CAAC,oBAAoB,CAAC,SAAS;wBAC7C,gBAAgB,EAAE,GAAG,CAAC,oBAAoB,CAAC,gBAAgB;wBAC3D,UAAU,EAAE,GAAG,CAAC,oBAAoB,CAAC,UAAU;wBAC/C,cAAc,EAAE,GAAG,CAAC,oBAAoB,CAAC,cAAc;qBAC1D,CAAC;oBACF,IAAI,SAAS,GAAG,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;oBAC/C,IAAI,wBAAwB,GAAuB,IAAI,kBAAkB,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;oBAC1G,OAAO,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;iBACpD;qBAAM,IAAI,GAAG,CAAC,oBAAoB,CAAC,aAAa,EAAE;oBAC/C,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;iBACzD;qBAAM;oBACH,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,uIAAuI,CAAC,CAAC,CAAC;iBAC7K;YACL,CAAC,CAAC;YAEF,IAAI,GAAG,CAAC,yBAAyB,EAAE;gBAC/B,OAAO,cAAc,EAAE,CAAC;aAC3B;iBAAM;gBACH,IAAI,SAAS,GAAG,IAAI,CAAC;gBACrB,IAAI;oBACA,SAAS,GAAG,MAAM,aAAa,CAAC,YAAY,EAAE,CAAC;iBAClD;gBAAC,OAAO,CAAC,EAAE;oBACR,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;iBACnG;gBAED,IAAI,UAAU,GAAG,IAAI,CAAC;gBACtB,IAAI;oBACA,UAAU,GAAG,MAAM,aAAa,CAAC,qBAAqB,EAAE,CAAC;iBAC5D;gBAAC,OAAO,CAAC,EAAE;oBACR,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;iBACxF;gBAED,IAAI,aAAa,GAAG,IAAI,CAAC;gBACzB,IAAI;oBACA,aAAa,GAAG,MAAM,aAAa,CAAC,gBAAgB,EAAE,CAAC;iBAC1D;gBAAC,OAAO,CAAC,EAAE,GAAE;gBAEd,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;gBACpC,GAAG,CAAC,oBAAoB,GAAG;oBACvB,aAAa;oBACb,SAAS;oBACT,gBAAgB,EAAE,KAAK;oBACvB,UAAU;oBACV,cAAc,EAAE,MAAM,CAAC,IAAI;iBAC9B,CAAC;gBAEF,IAAI,aAAa,EAAE;oBACf,GAAG,CAAC,yBAAyB,GAAG,IAAI,kBAAkB,CAAC,IAAI,aAAa,EAAE,EAAE,GAAG,CAAC,oBAAoB,CAAC,CAAC;iBACzG;gBAED,OAAO,cAAc,EAAE,CAAC;aAC3B;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,kBAAkB,CAAC,GAAc,EAAE,MAAe,EAAE,oBAA6B,EAAE,yBAAkC,EAAE,qBAA8B,EAAE,QAAyB;;YAChM,IAAI;gBACA,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,CAAC;gBACrG,kBAAkB,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;aAClH;YAAC,OAAO,CAAC,EAAE;gBACR,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;aAC3B;QACL,CAAC;KAAA;IAED;;OAEG;IACI,MAAM,CAAO,oBAAoB,CAAC,GAAa,EAAE,aAAsB,EAAE,QAAyB;;YACrG,IAAI;gBACA,MAAM,kBAAkB,GAAG,MAAM,GAAG,CAAC,qBAAqB,CAAC,aAAa,EAAE,kBAAkB,CAAC,CAAC;gBAC9F,kBAAkB,CAAC,oBAAoB,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;aAC1D;YAAC,OAAO,CAAC,EAAE;gBACR,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,CAAC,wDAAwD,GAAG,CAAC,CAAC,CAAC,CAAC;aACjG;QACL,CAAC;KAAA;CACJ"}
--------------------------------------------------------------------------------
/dist/esm/syncOptions.js:
--------------------------------------------------------------------------------
1 | export {};
2 | //# sourceMappingURL=syncOptions.js.map
--------------------------------------------------------------------------------
/dist/esm/syncOptions.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"syncOptions.js","sourceRoot":"","sources":["../../src/syncOptions.ts"],"names":[],"mappings":""}
--------------------------------------------------------------------------------
/dist/esm/syncStatus.d.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the possible result and intermediate statuses of the window.codePush.sync operation.
3 | * The result statuses are final, mutually exclusive statuses of the sync operation. The operation will end with only one of the possible result statuses.
4 | * The intermediate statuses are not final, one or more of them can happen before sync ends, based on the options you use and user interaction.
5 | *
6 | * NOTE: Adding new statuses or changing old statuses requires an update to CodePush.sync(), which must know which callbacks are results and which are not!
7 | * Also, don't forget to change the TestMessage module in ServerUtils!
8 | * AND THE codePush.d.ts (typings) file!!!
9 | */
10 | export declare enum SyncStatus {
11 | /**
12 | * Result status - the application is up to date.
13 | */
14 | UP_TO_DATE = 0,
15 | /**
16 | * Result status - an update is available, it has been downloaded, unzipped and copied to the deployment folder.
17 | * After the completion of the callback invoked with SyncStatus.UPDATE_INSTALLED, the application will be reloaded with the updated code and resources.
18 | */
19 | UPDATE_INSTALLED = 1,
20 | /**
21 | * Result status - an optional update is available, but the user declined to install it. The update was not downloaded.
22 | */
23 | UPDATE_IGNORED = 2,
24 | /**
25 | * Result status - an error happened during the sync operation. This might be an error while communicating with the server, downloading or unziping the update.
26 | * The console logs should contain more information about what happened. No update has been applied in this case.
27 | */
28 | ERROR = 3,
29 | /**
30 | * Result status - there is an ongoing sync in progress, so this attempt to sync has been aborted.
31 | */
32 | IN_PROGRESS = 4,
33 | /**
34 | * Intermediate status - the plugin is about to check for updates.
35 | */
36 | CHECKING_FOR_UPDATE = 5,
37 | /**
38 | * Intermediate status - a user dialog is about to be displayed. This status will be reported only if user interaction is enabled.
39 | */
40 | AWAITING_USER_ACTION = 6,
41 | /**
42 | * Intermediate status - the update packages is about to be downloaded.
43 | */
44 | DOWNLOADING_PACKAGE = 7,
45 | /**
46 | * Intermediate status - the update package is about to be installed.
47 | */
48 | INSTALLING_UPDATE = 8
49 | }
50 |
--------------------------------------------------------------------------------
/dist/esm/syncStatus.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the possible result and intermediate statuses of the window.codePush.sync operation.
3 | * The result statuses are final, mutually exclusive statuses of the sync operation. The operation will end with only one of the possible result statuses.
4 | * The intermediate statuses are not final, one or more of them can happen before sync ends, based on the options you use and user interaction.
5 | *
6 | * NOTE: Adding new statuses or changing old statuses requires an update to CodePush.sync(), which must know which callbacks are results and which are not!
7 | * Also, don't forget to change the TestMessage module in ServerUtils!
8 | * AND THE codePush.d.ts (typings) file!!!
9 | */
10 | export var SyncStatus;
11 | (function (SyncStatus) {
12 | /**
13 | * Result status - the application is up to date.
14 | */
15 | SyncStatus[SyncStatus["UP_TO_DATE"] = 0] = "UP_TO_DATE";
16 | /**
17 | * Result status - an update is available, it has been downloaded, unzipped and copied to the deployment folder.
18 | * After the completion of the callback invoked with SyncStatus.UPDATE_INSTALLED, the application will be reloaded with the updated code and resources.
19 | */
20 | SyncStatus[SyncStatus["UPDATE_INSTALLED"] = 1] = "UPDATE_INSTALLED";
21 | /**
22 | * Result status - an optional update is available, but the user declined to install it. The update was not downloaded.
23 | */
24 | SyncStatus[SyncStatus["UPDATE_IGNORED"] = 2] = "UPDATE_IGNORED";
25 | /**
26 | * Result status - an error happened during the sync operation. This might be an error while communicating with the server, downloading or unziping the update.
27 | * The console logs should contain more information about what happened. No update has been applied in this case.
28 | */
29 | SyncStatus[SyncStatus["ERROR"] = 3] = "ERROR";
30 | /**
31 | * Result status - there is an ongoing sync in progress, so this attempt to sync has been aborted.
32 | */
33 | SyncStatus[SyncStatus["IN_PROGRESS"] = 4] = "IN_PROGRESS";
34 | /**
35 | * Intermediate status - the plugin is about to check for updates.
36 | */
37 | SyncStatus[SyncStatus["CHECKING_FOR_UPDATE"] = 5] = "CHECKING_FOR_UPDATE";
38 | /**
39 | * Intermediate status - a user dialog is about to be displayed. This status will be reported only if user interaction is enabled.
40 | */
41 | SyncStatus[SyncStatus["AWAITING_USER_ACTION"] = 6] = "AWAITING_USER_ACTION";
42 | /**
43 | * Intermediate status - the update packages is about to be downloaded.
44 | */
45 | SyncStatus[SyncStatus["DOWNLOADING_PACKAGE"] = 7] = "DOWNLOADING_PACKAGE";
46 | /**
47 | * Intermediate status - the update package is about to be installed.
48 | */
49 | SyncStatus[SyncStatus["INSTALLING_UPDATE"] = 8] = "INSTALLING_UPDATE";
50 | })(SyncStatus || (SyncStatus = {}));
51 | //# sourceMappingURL=syncStatus.js.map
--------------------------------------------------------------------------------
/dist/esm/syncStatus.js.map:
--------------------------------------------------------------------------------
1 | {"version":3,"file":"syncStatus.js","sourceRoot":"","sources":["../../src/syncStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,CAAN,IAAY,UA+CX;AA/CD,WAAY,UAAU;IAClB;;OAEG;IACH,uDAAU,CAAA;IAEV;;;OAGG;IACH,mEAAgB,CAAA;IAEhB;;OAEG;IACH,+DAAc,CAAA;IAEd;;;OAGG;IACH,6CAAK,CAAA;IAEL;;OAEG;IACH,yDAAW,CAAA;IAEX;;OAEG;IACH,yEAAmB,CAAA;IAEnB;;OAEG;IACH,2EAAoB,CAAA;IAEpB;;OAEG;IACH,yEAAmB,CAAA;IAEnB;;OAEG;IACH,qEAAiB,CAAA;AACrB,CAAC,EA/CW,UAAU,KAAV,UAAU,QA+CrB"}
--------------------------------------------------------------------------------
/ios/Plugin.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Plugin/Base64/CodePushMF_Base64Additions.h:
--------------------------------------------------------------------------------
1 | //
2 | // MF_Base64Additions.h
3 | // Base64 -- RFC 4648 compatible implementation
4 | // see http://www.ietf.org/rfc/rfc4648.txt for more details
5 | //
6 | // Designed to be compiled with Automatic Reference Counting
7 | //
8 | // Created by Dave Poirier on 2012-06-14.
9 | // Public Domain
10 | // Hosted at https://github.com/ekscrypto/Base64
11 | //
12 |
13 | #import
14 |
15 | @interface NSString (Base64Addition)
16 | +(NSString *)stringFromBase64String:(NSString *)base64String;
17 | +(NSString *)stringFromBase64UrlEncodedString:(NSString *)base64UrlEncodedString;
18 | -(NSString *)base64String;
19 | -(NSString *)base64UrlEncodedString;
20 | @end
21 |
22 | @interface NSData (Base64Addition)
23 | +(NSData *)dataWithBase64String:(NSString *)base64String;
24 | +(NSData *)dataWithBase64UrlEncodedString:(NSString *)base64UrlEncodedString;
25 | -(NSString *)base64String;
26 | -(NSString *)base64UrlEncodedString;
27 | @end
28 |
29 | @interface MF_Base64Codec : NSObject
30 | +(NSData *)dataFromBase64String:(NSString *)base64String;
31 | +(NSString *)base64StringFromData:(NSData *)data;
32 | +(NSString *)base64UrlEncodedStringFromBase64String:(NSString *)base64String;
33 | +(NSString *)base64StringFromBase64UrlEncodedString:(NSString *)base64UrlEncodedString;
34 | @end
35 |
--------------------------------------------------------------------------------
/ios/Plugin/CodePush.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import "CAPPlugin.h"
3 | #import "CAPBridgedPlugin.h"
4 |
5 |
6 | @class CAPPluginCall;
7 |
8 | @interface CodePushPlugin : CAPPlugin
9 |
10 | @end
11 |
--------------------------------------------------------------------------------
/ios/Plugin/CodePushPackageManager.h:
--------------------------------------------------------------------------------
1 | #import "CodePushPackageMetadata.h"
2 | #import "InstallOptions.h"
3 |
4 | @interface CodePushPackageManager : NSObject
5 |
6 | + (void)cleanOldPackage;
7 | + (void)revertToPreviousVersion;
8 | + (CodePushPackageMetadata*)getCurrentPackageMetadata;
9 | + (void)clearFailedUpdates;
10 | + (void)cleanDeployments;
11 | + (NSString*)getCachedBinaryHash;
12 | + (void)saveBinaryHash:(NSString*)binaryHash;
13 | + (BOOL)isFailedHash:(NSString*)packageHash;
14 | + (void)savePendingInstall:(InstallOptions *)installOptions;
15 | + (InstallOptions*)getPendingInstall;
16 | + (void)clearPendingInstall;
17 | + (void)markInstallNeedsConfirmation;
18 | + (BOOL)installNeedsConfirmation;
19 | + (void)clearInstallNeedsConfirmation;
20 | + (void)clearBinaryFirstRunFlag;
21 | + (void)markBinaryFirstRunFlag;
22 | + (BOOL)isBinaryFirstRun;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/ios/Plugin/CodePushPackageMetadata.h:
--------------------------------------------------------------------------------
1 | @interface CodePushPackageMetadata : NSObject
2 |
3 | @property NSString* deploymentKey;
4 | @property NSString* packageDescription;
5 | @property NSString* label;
6 | @property NSString* appVersion;
7 | @property bool isMandatory;
8 | @property NSString* packageHash;
9 | @property NSNumber* packageSize;
10 | @property NSString* localPath;
11 | @property NSString* nativeBuildTime;
12 |
13 | + (CodePushPackageMetadata*)parsePackageManifest:(NSString*)content;
14 |
15 | @end
--------------------------------------------------------------------------------
/ios/Plugin/CodePushPackageMetadata.m:
--------------------------------------------------------------------------------
1 | #import "CodePushPackageMetadata.h"
2 |
3 | @implementation CodePushPackageMetadata
4 |
5 | + (CodePushPackageMetadata*)parsePackageManifest:(NSString*)content {
6 | if (content) {
7 | NSData* manifestData = [content dataUsingEncoding:NSUTF8StringEncoding];
8 | NSMutableDictionary *manifest = [NSJSONSerialization JSONObjectWithData:manifestData options:NSJSONReadingMutableContainers | NSJSONReadingMutableLeaves error:NULL];
9 |
10 | if (manifestData) {
11 | CodePushPackageMetadata* packageMetadata = [[CodePushPackageMetadata alloc] init];
12 | packageMetadata.deploymentKey = manifest[@"deploymentKey"];
13 | packageMetadata.packageDescription = manifest[@"description"];
14 | packageMetadata.label = manifest[@"label"];
15 | packageMetadata.appVersion = manifest[@"appVersion"];
16 | packageMetadata.isMandatory = manifest[@"isMandatory"];
17 | packageMetadata.packageHash = manifest[@"packageHash"];
18 | packageMetadata.packageSize = manifest[@"packageSize"];
19 | packageMetadata.nativeBuildTime = manifest[@"nativeBuildTime"];
20 | packageMetadata.localPath = manifest[@"localPath"];
21 | return packageMetadata;
22 | }
23 | }
24 |
25 | return nil;
26 | }
27 |
28 | @end
--------------------------------------------------------------------------------
/ios/Plugin/CodePushPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | //! Project version number for Plugin.
4 | FOUNDATION_EXPORT double PluginVersionNumber;
5 |
6 | //! Project version string for Plugin.
7 | FOUNDATION_EXPORT const unsigned char PluginVersionString[];
8 |
9 | // In this header, you should import all the public headers of your framework using statements like #import
10 |
--------------------------------------------------------------------------------
/ios/Plugin/CodePushPlugin.m:
--------------------------------------------------------------------------------
1 | //
2 | // CodePushPlugin.m
3 | // CapacitorCodepush
4 | //
5 | // Created by 허상민 on 2021/02/04.
6 | //
7 |
8 | #import
9 | #import
10 |
11 | // Define the plugin using the CAP_PLUGIN Macro, and
12 | // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
13 | CAP_PLUGIN(CodePushPlugin, "CodePush",
14 | CAP_PLUGIN_METHOD(getServerURL, CAPPluginReturnPromise);
15 | CAP_PLUGIN_METHOD(getDeploymentKey, CAPPluginReturnPromise);
16 | CAP_PLUGIN_METHOD(getNativeBuildTime, CAPPluginReturnPromise);
17 | CAP_PLUGIN_METHOD(getAppVersion, CAPPluginReturnPromise);
18 | CAP_PLUGIN_METHOD(install, CAPPluginReturnPromise);
19 | CAP_PLUGIN_METHOD(preInstall, CAPPluginReturnPromise);
20 | CAP_PLUGIN_METHOD(isFailedUpdate, CAPPluginReturnPromise);
21 | CAP_PLUGIN_METHOD(isFirstRun, CAPPluginReturnPromise);
22 | CAP_PLUGIN_METHOD(isPendingUpdate, CAPPluginReturnPromise);
23 | CAP_PLUGIN_METHOD(notifyApplicationReady, CAPPluginReturnPromise);
24 | CAP_PLUGIN_METHOD(reportFailed, CAPPluginReturnPromise);
25 | CAP_PLUGIN_METHOD(reportSucceeded, CAPPluginReturnPromise);
26 | CAP_PLUGIN_METHOD(restartApplication, CAPPluginReturnNone);
27 | CAP_PLUGIN_METHOD(getBinaryHash, CAPPluginReturnPromise);
28 | CAP_PLUGIN_METHOD(getPackageHash, CAPPluginReturnPromise);
29 | CAP_PLUGIN_METHOD(decodeSignature, CAPPluginReturnPromise);
30 | CAP_PLUGIN_METHOD(getPublicKey, CAPPluginReturnPromise);
31 | CAP_PLUGIN_METHOD(unzip, CAPPluginReturnPromise);
32 | )
33 |
--------------------------------------------------------------------------------
/ios/Plugin/CodePushReportingManager.h:
--------------------------------------------------------------------------------
1 | #import "StatusReport.h"
2 |
3 | @interface CodePushReportingManager : NSObject
4 |
5 | + (void)reportStatus:(StatusReport*)statusReport withWebView:(UIView*)webView;
6 | + (BOOL)hasFailedReport;
7 | + (StatusReport*)getFailedReport;
8 | + (StatusReport*)getAndClearFailedReport;
9 | + (void)saveFailedReport:(StatusReport*)statusReport;
10 | + (void)saveSuccessfulReport:(StatusReport*)statusReport;
11 |
12 | @end
--------------------------------------------------------------------------------
/ios/Plugin/InstallMode.h:
--------------------------------------------------------------------------------
1 | enum {
2 | IMMEDIATE = 0,
3 | ON_NEXT_RESTART = 1,
4 | ON_NEXT_RESUME = 2
5 | };
6 | typedef NSInteger InstallMode;
7 |
8 |
--------------------------------------------------------------------------------
/ios/Plugin/InstallOptions.h:
--------------------------------------------------------------------------------
1 | #import "InstallMode.h"
2 |
3 | @interface InstallOptions : NSObject
4 |
5 | @property InstallMode installMode;
6 | @property int minimumBackgroundDuration;
7 |
8 | -(void)encodeWithCoder:(NSCoder*)encoder;
9 | -(id)initWithCoder:(NSCoder*)decoder;
10 |
11 | @end
--------------------------------------------------------------------------------
/ios/Plugin/InstallOptions.m:
--------------------------------------------------------------------------------
1 | #import "InstallOptions.h"
2 |
3 | @implementation InstallOptions
4 |
5 | NSString* const InstallModeKey = @"installMode";
6 | NSString* const MinimumBackgroundDurationKey = @"minimumBackgroundDuration";
7 |
8 | -(void)encodeWithCoder:(NSCoder*)encoder {
9 | [encoder encodeInteger:self.installMode forKey:InstallModeKey];
10 | [encoder encodeInteger:self.minimumBackgroundDuration forKey:MinimumBackgroundDurationKey];
11 | }
12 |
13 | -(id)initWithCoder:(NSCoder*)decoder {
14 | self.installMode = [decoder decodeIntegerForKey:InstallModeKey];
15 | self.minimumBackgroundDuration = (int)[decoder decodeIntegerForKey:MinimumBackgroundDurationKey];
16 | return self;
17 | }
18 |
19 | @end
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Base/CodePushJWTAlgorithm.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithm.h
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTDeprecations.h"
11 |
12 | @protocol JWTAlgorithm
13 |
14 | @required
15 | /**
16 | Signs data using provided secret data.
17 | @param hash The data to sign.
18 | @param key The secret to use for signing.
19 | @param error The inout error.
20 | */
21 | - (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing*)error;
22 | /**
23 | Verifies data using.
24 | @param hash The data to sign.
25 | @param signature The secret to use for signing.
26 | @param error The inout error.
27 | */
28 | - (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing*)error;
29 |
30 | //@required
31 |
32 | @property (nonatomic, readonly, copy) NSString *name;
33 |
34 | /**
35 | Encodes and encrypts the provided payload using the provided secret key
36 | @param theString The string to encode
37 | @param theSecret The secret to use for encryption
38 | @return An NSData object containing the encrypted payload, or nil if something went wrong.
39 | */
40 | - (NSData *)encodePayload:(NSString *)theString withSecret:(NSString *)theSecret __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);
41 |
42 | /**
43 | Verifies the provided signature using the signed input and verification key
44 | @param input The header and payload encoded string
45 | @param signature The JWT provided signature
46 | @param verificationKey The key to use for verifying the signature
47 | @return YES if the provided signature is valid, NO otherwise
48 | */
49 | - (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKey:(NSString *)verificationKey __deprecated_and_will_be_removed_in_release_version(JWTVersion_3_0_0);
50 |
51 | @optional
52 |
53 | /**
54 | Encodes and encrypts the provided payload using the provided secret key
55 | @param theStringData The data to encode
56 | @param theSecretData The secret data to use for encryption
57 | @return An NSData object containing the encrypted payload, or nil if something went wrong.
58 | */
59 | - (NSData *)encodePayloadData:(NSData *)theStringData withSecret:(NSData *)theSecretData;
60 |
61 | /**
62 | Verifies the provided signature using the signed input and verification key (as data)
63 | @param input The header and payload encoded string
64 | @param signature The JWT provided signature
65 | @param verificationKeyData The key data to use for verifying the signature
66 | @return YES if the provided signature is valid, NO otherwise
67 | */
68 | - (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKeyData:(NSData *)verificationKeyData;
69 | @end
70 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Base/CodePushJWTAlgorithmFactory.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmFactory.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 07.10.15.
6 | // Copyright © 2015 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTAlgorithm.h"
11 | @interface JWTAlgorithmFactory : NSObject
12 |
13 | + (NSArray *)algorithms;
14 | + (id)algorithmByName:(NSString *)name;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Base/CodePushJWTAlgorithmFactory.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmFactory.m
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 07.10.15.
6 | // Copyright © 2015 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTAlgorithmFactory.h"
10 | #import "CodePushJWTAlgorithmHSBase.h"
11 | #import "CodePushJWTAlgorithmRSBase.h"
12 | #import "CodePushJWTAlgorithmNone.h"
13 |
14 | // not implemented.
15 | NSString *const JWTAlgorithmNameES256 = @"ES256";
16 | NSString *const JWTAlgorithmNameES384 = @"ES384";
17 | NSString *const JWTAlgorithmNameES512 = @"ES512";
18 |
19 | @implementation JWTAlgorithmFactory
20 |
21 | + (NSArray *)algorithms {
22 | return @[
23 | [JWTAlgorithmNone new],
24 | [JWTAlgorithmHSBase algorithm256],
25 | [JWTAlgorithmHSBase algorithm384],
26 | [JWTAlgorithmHSBase algorithm512],
27 | [JWTAlgorithmRSBase algorithm256],
28 | [JWTAlgorithmRSBase algorithm384],
29 | [JWTAlgorithmRSBase algorithm512]
30 | ];
31 |
32 | }
33 |
34 | + (id)algorithmByName:(NSString *)name {
35 | id algorithm = nil;
36 |
37 | NSString *algName = [name copy];
38 |
39 | NSUInteger index = [[self algorithms] indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
40 | // lowercase comparison
41 | return [obj.name.lowercaseString isEqualToString:algName.lowercaseString];
42 | }];
43 |
44 | if (index != NSNotFound) {
45 | algorithm = [self algorithms][index];
46 | }
47 |
48 | return algorithm;
49 | }
50 |
51 | @end
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Base/CodePushJWTAlgorithmNone.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmNone.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 16.10.15.
6 | // Copyright © 2015 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTAlgorithm.h"
11 | extern NSString *const JWTAlgorithmNameNone;
12 |
13 | @interface JWTAlgorithmNone : NSObject
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Base/CodePushJWTAlgorithmNone.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmNone.m
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 16.10.15.
6 | // Copyright © 2015 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTAlgorithmNone.h"
10 | NSString *const JWTAlgorithmNameNone = @"none";
11 |
12 | @implementation JWTAlgorithmNone
13 |
14 | - (NSString *)name {
15 | return JWTAlgorithmNameNone;
16 | }
17 |
18 | - (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {
19 | return [NSData data];
20 | }
21 |
22 | - (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {
23 | //if a secret is provided, this isn't the None algorithm
24 | if (key && key.length > 0) {
25 | return NO;
26 | }
27 |
28 | //If the signature isn't blank, this isn't the None algorithm
29 | if (signature && signature.length > 0) {
30 | return NO;
31 | }
32 |
33 | return YES;
34 | }
35 |
36 | - (NSData *)encodePayload:(NSString *)theString withSecret:(NSString *)theSecret {
37 | return [self encodePayloadData:[theSecret dataUsingEncoding:NSUTF8StringEncoding] withSecret:[theSecret dataUsingEncoding:NSUTF8StringEncoding]];
38 | }
39 |
40 | - (NSData *)encodePayloadData:(NSData *)theStringData withSecret:(NSData *)theSecretData
41 | {
42 | return [self signHash:theStringData key:theSecretData error:nil];
43 | }
44 |
45 | - (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKey:(NSString *)verificationKey
46 | {
47 | return [self verifySignedInput:input withSignature:signature verificationKeyData:verificationKey];
48 | }
49 |
50 | - (BOOL)verifySignedInput:(NSString *)input withSignature:(NSString *)signature verificationKeyData:(NSData *)verificationKeyData
51 | {
52 | return [self verifyHash:[input dataUsingEncoding:NSUTF8StringEncoding] signature:[signature dataUsingEncoding:NSUTF8StringEncoding] key:verificationKeyData error:nil];
53 | }
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/ESFamily/CodePushJWTAlgorithmESBase.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmESBase.h
3 | // Pods
4 | //
5 | // Created by Lobanov Dmitry on 12.02.17.
6 | //
7 | //
8 |
9 | #import
10 | #import "CodePushJWTRSAlgorithm.h"
11 | extern NSString *const JWTAlgorithmNameES256;
12 | extern NSString *const JWTAlgorithmNameES384;
13 | extern NSString *const JWTAlgorithmNameES512;
14 | @interface JWTAlgorithmESBase : NSObject @end
15 |
16 | @interface JWTAlgorithmESBase (JWTAsymmetricKeysAlgorithm) @end
17 |
18 | @interface JWTAlgorithmESBase (Create)
19 |
20 | + (instancetype)algorithm256;
21 | + (instancetype)algorithm384;
22 | + (instancetype)algorithm512;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/ESFamily/CodePushJWTAlgorithmESBase.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmESBase.m
3 | // Pods
4 | //
5 | // Created by Lobanov Dmitry on 12.02.17.
6 | //
7 | //
8 |
9 | #import "CodePushJWTAlgorithmESBase.h"
10 | #import
11 | @interface JWTAlgorithmESBase ()
12 |
13 | @end
14 | @implementation JWTAlgorithmESBase
15 | @synthesize keyExtractorType;
16 | @synthesize signKey;
17 | @synthesize verifyKey;
18 | @end
19 |
20 | // thanks! https://github.com/soyersoyer/SwCrypt
21 | @interface JWTAlgorithmESBase (ImportKeys)
22 | - (void)importKey;
23 | //importKey(publicKey, format: .importKeyBinary, keyType: .keyPublic)
24 | @end
25 | @implementation JWTAlgorithmESBase (ImportKeys)
26 | - (void)importKey {
27 | return;
28 | }
29 | @end
30 |
31 | @implementation JWTAlgorithmESBase (JWTAsymmetricKeysAlgorithm)
32 | - (NSString *)name {
33 | return @"ESBase";
34 | }
35 | - (NSData *)signHash:(NSData *)hash key:(NSData *)key error:(NSError *__autoreleasing *)error {
36 | return nil;
37 | }
38 | - (BOOL)verifyHash:(NSData *)hash signature:(NSData *)signature key:(NSData *)key error:(NSError *__autoreleasing *)error {
39 | return NO;
40 | }
41 | @end
42 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/HSFamily/CodePushJWTAlgorithmHSBase.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmHSBase.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 13.03.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTAlgorithm.h"
11 | extern NSString *const JWTAlgorithmNameHS256;
12 | extern NSString *const JWTAlgorithmNameHS384;
13 | extern NSString *const JWTAlgorithmNameHS512;
14 |
15 | @interface JWTAlgorithmHSBase : NSObject
16 |
17 | @property (assign, nonatomic, readonly) size_t ccSHANumberDigestLength;
18 | @property (assign, nonatomic, readonly) uint32_t ccHmacAlgSHANumber;
19 |
20 | @end
21 |
22 | @interface JWTAlgorithmHSBase (Create)
23 |
24 | + (instancetype)algorithm256;
25 | + (instancetype)algorithm384;
26 | + (instancetype)algorithm512;
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/Holders/CodePushJWTAlgorithmDataHolderChain.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmDataHolderChain.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 02.10.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTAlgorithmDataHolder.h"
11 |
12 | @interface JWTAlgorithmDataHolderChain : NSObject
13 |
14 | @property (strong, nonatomic, readonly) NSArray *holders;
15 |
16 | #pragma mark - Initialization
17 | - (instancetype)initWithHolders:(NSArray *)holders;
18 | - (instancetype)initWithHolder:(id)holder;
19 |
20 | #pragma mark - Appending
21 | - (instancetype)chainByAppendingChain:(JWTAlgorithmDataHolderChain *)chain;
22 | - (instancetype)chainByAppendingHolders:(NSArray *)holders;
23 | - (instancetype)chainByAppendingHolder:(id)holder;
24 |
25 | #pragma mark - Create
26 | + (instancetype)chainWithHolders:(NSArray *)holders;
27 | + (instancetype)chainWithHolder:(id)holder;
28 | @end
29 |
30 | @interface JWTAlgorithmDataHolderChain (HoldersPopulation)
31 | - (NSArray *)singleAlgorithm:(id)algorithm withManySecretData:(NSArray *)secretsData;
32 | - (NSArray *)singleSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms;
33 |
34 | - (instancetype)chainByPopulatingAlgorithm:(id)algorithm withManySecretData:(NSArray *)secretsData;
35 | - (instancetype)chainByPopulatingSecretData:(NSData *)secretData withManyAlgorithms:(NSArray *)algorithms;
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/RSFamily/CodePushJWTAlgorithmRSBase.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTAlgorithmRSBase.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 13.03.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTRSAlgorithm.h"
11 | extern NSString *const JWTAlgorithmNameRS256;
12 | extern NSString *const JWTAlgorithmNameRS384;
13 | extern NSString *const JWTAlgorithmNameRS512;
14 |
15 | @interface JWTAlgorithmRSBase : NSObject
16 |
17 | @property (assign, nonatomic, readonly) size_t ccSHANumberDigestLength;
18 | @property (assign, nonatomic, readonly) uint32_t secPaddingPKCS1SHANumber;
19 | - (unsigned char *)CC_SHANumberWithData:(const void *)data withLength:(uint32_t)len withHashBytes:(unsigned char *)hashBytes;
20 |
21 | @end
22 |
23 | @interface JWTAlgorithmRSBase (Create)
24 |
25 | + (instancetype)algorithm256;
26 | + (instancetype)algorithm384;
27 | + (instancetype)algorithm512;
28 | + (instancetype)mutableAlgorithm __deprecated;
29 |
30 | @end
31 |
32 | /*
33 | // when you can't live without mutability, uncomment.
34 | @class JWTAlgorithmRSFamilyMemberMutable;
35 | */
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/RSFamily/CodePushJWTRSAlgorithm.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Marcelo Schroeder on 12/03/2016.
3 | // Copyright (c) 2016 Karma. All rights reserved.
4 | //
5 |
6 | #import
7 | #import "CodePushJWTAlgorithm.h"
8 | @protocol JWTCryptoKeyProtocol;
9 |
10 | @protocol JWTAsymmetricKeysAlgorithm
11 |
12 | @optional
13 | @property(nonatomic, readwrite, copy) NSString *keyExtractorType;
14 | @property(nonatomic, readwrite, strong) id signKey;
15 | @property(nonatomic, readwrite, strong) id verifyKey;
16 |
17 | @end
18 |
19 | @protocol JWTRSAlgorithm
20 |
21 | @required
22 | @property(nonatomic, readwrite, copy) NSString *privateKeyCertificatePassphrase;
23 | @end
24 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/RSFamily/RSKeys/CodePushJWTCryptoKey.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTCryptoKey.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 04.02.17.
6 | // Copyright © 2017 JWTIO. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @protocol JWTCryptoKeyProtocol
13 | @property (copy, nonatomic, readonly) NSString *tag;
14 | @property (assign, nonatomic, readonly) SecKeyRef key;
15 | @property (copy, nonatomic, readonly) NSData *rawKey;
16 | @end
17 |
18 | @protocol JWTCryptoKey__Generator__Protocol
19 | - (instancetype)initWithData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER
20 | - (instancetype)initWithBase64String:(NSString *)base64String parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
21 | - (instancetype)initWithPemEncoded:(NSString *)encoded parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
22 | - (instancetype)initWithPemAtURL:(NSURL *)url parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
23 | @end
24 |
25 | @interface JWTCryptoKeyBuilder : NSObject
26 | @property (assign, nonatomic, readonly) NSString *keyType;
27 | - (instancetype)keyTypeRSA;
28 | - (instancetype)keyTypeEC;
29 | @end
30 |
31 | /*
32 | Don't use it directly, use subclasses instead!
33 | */
34 | @interface JWTCryptoKey : NSObject @end
35 |
36 | // Check that Security key is retrieved.
37 | // Could be used as additional step in key data verification.
38 | @interface JWTCryptoKey (Check)
39 | - (instancetype)checkedWithError:(NSError *__autoreleasing*)error;
40 | @end
41 |
42 | @interface JWTCryptoKey (Parameters)
43 | + (NSString *)parametersKeyBuilder;
44 | @end
45 |
46 | @interface JWTCryptoKeyPublic : JWTCryptoKey
47 | - (instancetype)initWithCertificateData:(NSData *)certificateData parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER;
48 | - (instancetype)initWithCertificateBase64String:(NSString *)certificateString parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
49 | @end
50 |
51 | @interface JWTCryptoKeyPrivate : JWTCryptoKey
52 | - (instancetype)initWithP12Data:(NSData *)p12Data withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error; //NS_DESIGNATED_INITIALIZER;
53 | - (instancetype)initWithP12AtURL:(NSURL *)url withPassphrase:(NSString *)passphrase parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
54 | @end
55 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/RSFamily/RSKeys/CodePushJWTCryptoKeyExtractor.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTCryptoKeyExtractor.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 04.02.17.
6 | // Copyright © 2017 JWTIO. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @protocol JWTCryptoKeyProtocol;
13 | @protocol JWTCryptoKeyExtractorProtocol
14 | @optional
15 | - (id)keyFromString:(NSString *)string parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
16 | - (id)keyFromData:(NSData *)data parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing*)error;
17 | @end
18 |
19 | @interface JWTCryptoKeyExtractor : NSObject
20 | @property (copy, nonatomic, readonly) NSString *type;
21 | + (NSString *)type;
22 | + (NSString *)parametersKeyCertificatePassphrase;
23 | @end
24 |
25 | @interface JWTCryptoKeyExtractor (ClassCluster)
26 | + (instancetype)publicKeyWithCertificate;
27 | + (instancetype)privateKeyInP12;
28 | + (instancetype)publicKeyWithPEMBase64;
29 | + (instancetype)privateKeyWithPEMBase64;
30 | + (instancetype)createWithType:(NSString *)type;
31 | @end
32 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Algorithms/RSFamily/RSKeys/CodePushJWTCryptoSecurity.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTCryptoSecurity.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 04.02.17.
6 | // Copyright © 2017 JWTIO. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | // Thanks for https://github.com/TakeScoop/SwiftyRSA!
12 | @interface JWTCryptoSecurity : NSObject
13 | + (NSString *)keyTypeRSA;
14 | + (NSString *)keyTypeEC;
15 | + (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)public tag:(NSString *)tag type:(NSString *)type error:(NSError *__autoreleasing*)error;
16 | + (SecKeyRef)addKeyWithData:(NSData *)data asPublic:(BOOL)public tag:(NSString *)tag error:(NSError *__autoreleasing*)error;
17 | + (SecKeyRef)keyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error;
18 | + (void)removeKeyByTag:(NSString *)tag error:(NSError *__autoreleasing*)error;
19 | @end
20 |
21 | @interface JWTCryptoSecurity (Certificates)
22 | + (OSStatus)extractIdentityAndTrustFromPKCS12:(CFDataRef)inPKCS12Data password:(CFStringRef)password identity:(SecIdentityRef *)outIdentity trust:(SecTrustRef *)outTrust;
23 | + (SecKeyRef)publicKeyFromCertificate:(NSData *)certificateData;
24 | @end
25 |
26 | @interface JWTCryptoSecurity (Pem)
27 | + (NSString *)certificateFromPemFileContent:(NSString *)content;
28 | + (NSString *)keyFromPemFileContent:(NSString *)content;
29 | + (NSArray *)itemsFromPemFileContent:(NSString *)content byRegex:(NSRegularExpression *)expression;
30 | + (NSString *)certificateFromPemFileWithName:(NSString *)name;
31 | + (NSString *)keyFromPemFileWithName:(NSString *)name;
32 | + (NSArray *)itemsFromPemFileWithName:(NSString *)name byRegex:(NSRegularExpression *)expression;
33 | + (NSString *)stringByRemovingPemHeadersFromString:(NSString *)string;
34 | @end
35 |
36 | @interface JWTCryptoSecurity (PublicKey)
37 | + (NSData *)dataByRemovingPublicKeyHeader:(NSData *)data error:(NSError *__autoreleasing*)error;
38 | @end
39 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaim.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaim.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 13.02.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface JWTClaim : NSObject
12 |
13 | + (NSString *)name;
14 | + (instancetype)claimByName:(NSString *)name;
15 | + (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue;
16 | - (BOOL)verifyValue:(NSObject *)value withTrustedValue:(NSObject *)trustedValue;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSet.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSet.h
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface JWTClaimsSet : NSObject
12 |
13 | @property (nonatomic, readwrite, copy) NSString *issuer;
14 | @property (nonatomic, readwrite, copy) NSString *subject;
15 | @property (nonatomic, readwrite, copy) NSString *audience;
16 | @property (nonatomic, readwrite, copy) NSDate *expirationDate;
17 | @property (nonatomic, readwrite, copy) NSDate *notBeforeDate;
18 | @property (nonatomic, readwrite, copy) NSDate *issuedAt;
19 | @property (nonatomic, readwrite, copy) NSString *identifier;
20 | @property (nonatomic, readwrite, copy) NSString *type;
21 | @property (nonatomic, readwrite, copy) NSString *scope;
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSet.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSet.m
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTClaimsSet.h"
10 |
11 | @implementation JWTClaimsSet
12 |
13 | - (id)copyWithZone:(NSZone *)zone {
14 | JWTClaimsSet *newClaimsSet = [[self.class alloc] init];
15 |
16 | newClaimsSet.issuer = self.issuer;
17 | newClaimsSet.subject = self.subject;
18 | newClaimsSet.audience = self.audience;
19 | newClaimsSet.expirationDate = self.expirationDate;
20 | newClaimsSet.notBeforeDate = self.notBeforeDate;
21 | newClaimsSet.issuedAt = self.issuedAt;
22 | newClaimsSet.identifier = self.identifier;
23 | newClaimsSet.type = self.type;
24 | newClaimsSet.scope = self.scope;
25 |
26 | return newClaimsSet;
27 | }
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSetSerializer.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSetSerializer.h
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "CodePushJWTClaimsSet.h"
12 |
13 | @interface JWTClaimsSetSerializer : NSObject
14 |
15 | + (NSArray *)claimsSetKeys;
16 | + (NSDictionary *)dictionaryWithClaimsSet:(JWTClaimsSet *)theClaimsSet;
17 | + (JWTClaimsSet *)claimsSetWithDictionary:(NSDictionary *)theDictionary;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSetSerializer.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSetSerializer.m
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTClaimsSetSerializer.h"
10 |
11 | @implementation JWTClaimsSetSerializer
12 |
13 | + (NSArray *)claimsSetKeys
14 | {
15 | return @[@"iss", @"sub", @"aud", @"exp", @"nbf", @"iat", @"jti", @"typ", @"scope"];
16 | }
17 |
18 | + (NSDictionary *)dictionaryWithClaimsSet:(JWTClaimsSet *)theClaimsSet;
19 | {
20 | NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
21 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.issuer forKey:@"iss"];
22 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.subject forKey:@"sub"];
23 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.audience forKey:@"aud"];
24 | [self dictionary:dictionary setDateIfNotNil:theClaimsSet.expirationDate forKey:@"exp"];
25 | [self dictionary:dictionary setDateIfNotNil:theClaimsSet.notBeforeDate forKey:@"nbf"];
26 | [self dictionary:dictionary setDateIfNotNil:theClaimsSet.issuedAt forKey:@"iat"];
27 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.identifier forKey:@"jti"];
28 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.type forKey:@"typ"];
29 | [self dictionary:dictionary setObjectIfNotNil:theClaimsSet.scope forKey:@"scope"];
30 |
31 | return [dictionary copy];
32 | }
33 |
34 | + (JWTClaimsSet *)claimsSetWithDictionary:(NSDictionary *)theDictionary;
35 | {
36 | JWTClaimsSet *claimsSet = [[JWTClaimsSet alloc] init];
37 | claimsSet.issuer = [theDictionary objectForKey:@"iss"];
38 | claimsSet.subject = [theDictionary objectForKey:@"sub"];
39 | claimsSet.audience = [theDictionary objectForKey:@"aud"];
40 | claimsSet.expirationDate = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@"exp"] doubleValue]];
41 | claimsSet.notBeforeDate = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@"nbf"] doubleValue]];
42 | claimsSet.issuedAt = [NSDate dateWithTimeIntervalSince1970:[[theDictionary objectForKey:@"iat"] doubleValue]];
43 | claimsSet.identifier = [theDictionary objectForKey:@"jti"];
44 | claimsSet.type = [theDictionary objectForKey:@"typ"];
45 | claimsSet.scope = [theDictionary objectForKey:@"scope"];
46 |
47 | return claimsSet;
48 | }
49 |
50 | + (void)dictionary:(NSMutableDictionary *)theDictionary setObjectIfNotNil:(id)theObject forKey:(id)theKey;
51 | {
52 | if (!theObject)
53 | return;
54 |
55 | [theDictionary setObject:theObject forKey:theKey];
56 | }
57 |
58 | + (void)dictionary:(NSMutableDictionary *)theDictionary setDateIfNotNil:(NSDate*)date forKey:(id)theKey;
59 | {
60 | if (!date)
61 | return;
62 | NSNumber* value = @((unsigned long)[date timeIntervalSince1970]);
63 |
64 | [theDictionary setObject:value forKey:theKey];
65 | }
66 |
67 |
68 | @end
69 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSetVerifier.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSetVerifier.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 13.02.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "CodePushJWTClaimsSet.h"
11 |
12 | @interface JWTClaimsSetVerifier : NSObject
13 |
14 | + (BOOL)verifyClaimsSet:(JWTClaimsSet *)theClaimsSet withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet;
15 |
16 | + (BOOL)verifyClaimsSetDictionary:(NSDictionary *)theClaimsSetDictionary withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/ClaimSet/CodePushJWTClaimsSetVerifier.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWTClaimsSetVerifier.m
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 13.02.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTClaimsSetVerifier.h"
10 | #import "CodePushJWTClaimsSetSerializer.h"
11 | #import "CodePushJWTClaim.h"
12 |
13 | @implementation JWTClaimsSetVerifier
14 |
15 | + (BOOL)verifyDictionary:(NSDictionary *)dictionary withTrustedDictionary:(NSDictionary *)trustedDictionary byKey:(NSString *)key {
16 | NSObject *value = dictionary[key];
17 | NSObject *trustedValue = trustedDictionary[key];
18 |
19 | BOOL result = YES;
20 |
21 | if (trustedValue) {
22 | result = [[JWTClaim claimByName:key] verifyValue:value withTrustedValue:trustedValue];
23 | }
24 |
25 | return result;
26 | }
27 |
28 | + (BOOL)verifyClaimsSetDictionary:(NSDictionary *)theClaimsSetDictionary withTrustedClaimsSetDictionary:(NSDictionary *)trustedClaimsSetDictionary {
29 |
30 | NSArray *claimsSets = [JWTClaimsSetSerializer claimsSetKeys];
31 |
32 | if (!trustedClaimsSetDictionary) {
33 | return YES;
34 | }
35 |
36 | if (!theClaimsSetDictionary) {
37 | return NO;
38 | }
39 |
40 | BOOL result = YES;
41 |
42 | for (NSString *key in claimsSets) {
43 | result = result && [self verifyDictionary:theClaimsSetDictionary withTrustedDictionary:trustedClaimsSetDictionary byKey:key];
44 | }
45 |
46 | return result;
47 | }
48 |
49 |
50 | + (BOOL)verifyClaimsSet:(JWTClaimsSet *)theClaimsSet withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet {
51 |
52 | NSDictionary *dictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:theClaimsSet];
53 |
54 | NSDictionary *trustedDictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:trustedClaimsSet];
55 |
56 | NSArray *claimsSets = [JWTClaimsSetSerializer claimsSetKeys];
57 |
58 | BOOL result = YES;
59 | for (NSString *key in claimsSets) {
60 | result = result && [self verifyDictionary:dictionary withTrustedDictionary:trustedDictionary byKey:key];
61 | }
62 |
63 | return result;
64 | }
65 |
66 | + (BOOL)verifyClaimsSetDictionary:(NSDictionary *)theClaimsSetDictionary withTrustedClaimsSet:(JWTClaimsSet *)trustedClaimsSet {
67 | NSDictionary *trustedDictionary = [JWTClaimsSetSerializer dictionaryWithClaimsSet:trustedClaimsSet];
68 |
69 | return [self verifyClaimsSetDictionary:theClaimsSetDictionary withTrustedClaimsSetDictionary:trustedDictionary];
70 | }
71 |
72 | @end
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Coding/CodePushJWTCoding+ResultTypes.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTCoding+ResultTypes.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 30.11.16.
6 | // Copyright © 2016 JWTIO. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTCoding.h"
10 | @class JWTClaimsSet;
11 |
12 | extern NSString *JWTCodingResultHeaders;
13 | extern NSString *JWTCodingResultPayload;
14 |
15 | @interface JWT (ResultTypes) @end
16 |
17 | /*
18 | ResultType
19 | /\
20 | / \
21 | / \
22 | Success Error
23 |
24 | Protocols: Mutable and Immutable (?!?)
25 | */
26 |
27 | // Public
28 | @protocol JWTCodingResultTypeSuccessEncodedProtocol
29 | @property (copy, nonatomic, readonly) NSString *encoded;
30 | - (instancetype)initWithEncoded:(NSString *)encoded;
31 | @property (copy, nonatomic, readonly) NSString *token;
32 | - (instancetype)initWithToken:(NSString *)token;
33 | @end
34 |
35 | // Public
36 | @protocol JWTCodingResultTypeSuccessDecodedProtocol
37 | @property (copy, nonatomic, readonly) NSDictionary *headers;
38 | @property (copy, nonatomic, readonly) NSDictionary *payload;
39 |
40 | // dictionary @{
41 | // JWTCodingResultHeaders : self.headers,
42 | // JWTCodingResultPayload : self.payload
43 | //}
44 | @property (copy, nonatomic, readonly) NSDictionary *headerAndPayloadDictionary;
45 |
46 | @property (nonatomic, readonly) JWTClaimsSet *claimsSet;
47 | - (instancetype)initWithHeadersAndPayload:(NSDictionary *)headersAndPayloadDictionary;
48 | - (instancetype)initWithHeaders:(NSDictionary *)headers withPayload:(NSDictionary *)payload;
49 | - (instancetype)initWithClaimsSet:(JWTClaimsSet *)claimsSet;
50 | @end
51 |
52 | // Public
53 | @interface JWTCodingResultTypeSuccess : NSObject @end
54 |
55 | // Public
56 | @protocol JWTCodingResultTypeErrorProtocol
57 | @property (copy, nonatomic, readonly) NSError *error;
58 | - (instancetype)initWithError:(NSError *)error;
59 | @end
60 |
61 | @interface JWTCodingResultTypeError : NSObject @end
62 |
63 | @interface JWTCodingResultType : NSObject
64 | - (instancetype)initWithSuccessResult:(JWTCodingResultTypeSuccess *)success;
65 | - (instancetype)initWithErrorResult:(JWTCodingResultTypeError *)error;
66 | @property (strong, nonatomic, readonly) JWTCodingResultTypeSuccess *successResult;
67 | @property (strong, nonatomic, readonly) JWTCodingResultTypeError *errorResult;
68 | @end
69 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Coding/CodePushJWTCoding.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWT.h
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 | /**
11 | @discussion JWT is a general interface for decoding and encoding.
12 | Now it is to complex and fat to support.
13 | Possible solution: split interface into several pieces.
14 |
15 | JWT_1_0 -> JWT with plain old functions.
16 | JWT_2_0 -> JWT with builder usage.
17 | JWT_3_0 -> JWT with splitted apart algorithm data and payload data.
18 | */
19 | @interface JWT : NSObject @end
20 |
21 | typedef NS_OPTIONS(NSInteger, JWTCodingDecodingOptions) {
22 | JWTCodingDecodingOptionsNone = 0,
23 | JWTCodingDecodingOptionsSkipVerification = 1
24 | };
25 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Coding/CodePushJWTCoding.m:
--------------------------------------------------------------------------------
1 | //
2 | // JWT.m
3 | // JWT
4 | //
5 | // Created by Klaas Pieter Annema on 31-05-13.
6 | // Copyright (c) 2013 Karma. All rights reserved.
7 | //
8 |
9 | #import "CodePushJWTCoding.h"
10 |
11 | @implementation JWT @end
12 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/FrameworkSupplement/CodePushJWT.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWT.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 23.10.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for JWT.
12 | FOUNDATION_EXPORT double JWTVersionNumber;
13 |
14 | //! Project version string for JWT.
15 | FOUNDATION_EXPORT const unsigned char JWTVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import "PublicHeader.h"
18 |
19 | // Coding
20 | #import "CodePushJWTCoding.h"
21 | #import "CodePushJWTCoding+ResultTypes.h"
22 | #import "CodePushJWTCoding+VersionOne.h"
23 | #import "CodePushJWTCoding+VersionTwo.h"
24 | #import "CodePushJWTCoding+VersionThree.h"
25 |
26 | // Algorithms
27 | #import "CodePushJWTAlgorithm.h"
28 | #import "CodePushJWTRSAlgorithm.h"
29 | #import "CodePushJWTAlgorithmFactory.h"
30 | #import "CodePushJWTAlgorithmNone.h"
31 | #import "CodePushJWTAlgorithmHSBase.h"
32 | #import "CodePushJWTAlgorithmRSBase.h"
33 |
34 | // Holders
35 | #import "CodePushJWTAlgorithmDataHolder.h"
36 | #import "CodePushJWTAlgorithmDataHolderChain.h"
37 |
38 | // Claims
39 | #import "CodePushJWTClaimsSet.h"
40 | #import "CodePushJWTClaim.h"
41 | #import "CodePushJWTClaimsSetSerializer.h"
42 | #import "CodePushJWTClaimsSetVerifier.h"
43 |
44 | // Supplement
45 | #import "CodePushJWTDeprecations.h"
46 | #import "CodePushJWTBase64Coder.h"
47 | #import "CodePushJWTErrorDescription.h"
48 |
49 | // Crypto
50 | #import "CodePushJWTCryptoKey.h"
51 | #import "CodePushJWTCryptoKeyExtractor.h"
52 | #import "CodePushJWTCryptoSecurity.h"
53 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Supplement/CodePushJWTBase64Coder.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTBase64Coder.h
3 | // Pods
4 | //
5 | // Created by Lobanov Dmitry on 05.10.16.
6 | //
7 | //
8 |
9 | #import
10 |
11 | @protocol JWTStringCoder__Protocol
12 | - (NSString *)stringWithData:(NSData *)data;
13 | - (NSData *)dataWithString:(NSString *)string;
14 | @end
15 |
16 | @interface JWTBase64Coder : NSObject
17 | + (NSString *)base64UrlEncodedStringWithData:(NSData *)data;
18 | + (NSData *)dataWithBase64UrlEncodedString:(NSString *)urlEncodedString;
19 | @end
20 |
21 | @interface JWTBase64Coder (JWTStringCoder__Protocol) @end
22 |
23 |
24 | @interface JWTStringCoder__For__Encoding : NSObject
25 | @property (assign, nonatomic, readwrite) NSStringEncoding stringEncoding;
26 | + (instancetype)utf8Encoding;
27 | @end
28 | @interface JWTStringCoder__For__Encoding (JWTStringCoder__Protocol) @end
29 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Supplement/CodePushJWTDeprecations.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTDeprecations.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 31.08.16.
6 | // Copyright © 2016 Karma. All rights reserved.
7 | //
8 |
9 | #ifndef JWTDeprecations_h
10 | #define JWTDeprecations_h
11 |
12 | #define STR(str) #str
13 | #define JWTVersion_2_1_0 2.1
14 | #define JWTVersion_2_2_0 2.2
15 | #define JWTVersion_3_0_0 3.0
16 | #define __first_deprecated_in_release_version(version) __deprecated_msg("first deprecated in release version: " STR(version))
17 | #define __deprecated_and_will_be_removed_in_release_version(version) __deprecated_msg("deprecated. will be removed in release version: "STR(version))
18 | #define __available_in_release_version(version) __deprecated_msg("will be introduced in release version: " STR(version))
19 |
20 | #define __jwt_technical_debt(debt) __deprecated_msg("Don't forget to inspect it later." STR(debt))
21 |
22 | #endif /* JWTDeprecations_h */
23 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/Core/Supplement/CodePushJWTErrorDescription.h:
--------------------------------------------------------------------------------
1 | //
2 | // JWTErrorDescription.h
3 | // JWT
4 | //
5 | // Created by Lobanov Dmitry on 27.11.16.
6 | // Copyright © 2016 JWTIO. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | extern NSString *JWTErrorDomain;
12 |
13 | typedef NS_ENUM(NSInteger, JWTError) {
14 | JWTInvalidFormatError = -100,
15 | JWTUnsupportedAlgorithmError,
16 | JWTAlgorithmNameMismatchError,
17 | JWTInvalidSignatureError,
18 | JWTNoPayloadError,
19 | JWTNoHeaderError,
20 | JWTEncodingHeaderError,
21 | JWTEncodingPayloadError,
22 | JWTEncodingSigningError,
23 | JWTClaimsSetVerificationFailed,
24 | JWTInvalidSegmentSerializationError,
25 | JWTUnspecifiedAlgorithmError,
26 | JWTBlacklistedAlgorithmError,
27 | JWTDecodingHeaderError,
28 | JWTDecodingPayloadError,
29 | JWTDecodingHoldersChainEmptyError
30 | };
31 |
32 | @interface JWTErrorDescription : NSObject
33 | + (NSError *)errorWithCode:(JWTError)code;
34 | @end
35 |
--------------------------------------------------------------------------------
/ios/Plugin/JWT/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2013 Karma Mobility, Inc.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/ios/Plugin/StatusReport.h:
--------------------------------------------------------------------------------
1 | enum {
2 | STORE_VERSION = 0,
3 | UPDATE_CONFIRMED = 1,
4 | UPDATE_ROLLED_BACK = 2
5 | };
6 | typedef NSInteger ReportingStatus;
7 |
8 | @interface StatusReport : NSObject
9 |
10 | @property ReportingStatus status;
11 | @property NSString* label;
12 | @property NSString* appVersion;
13 | @property NSString* deploymentKey;
14 |
15 | // Optional properties.
16 | @property NSString* lastVersionLabelOrAppVersion;
17 | @property NSString* lastVersionDeploymentKey;
18 |
19 | - (id)initWithStatus:(ReportingStatus)status andLabel:(NSString*)label andAppVersion:(NSString*)appVersion andDeploymentKey:(NSString*)deploymentKey;
20 |
21 | - (id)initWithStatus:(ReportingStatus)status andLabel:(NSString*)label andAppVersion:(NSString*)appVersion andDeploymentKey:(NSString*)deploymentKey andLastVersionLabelOrAppVersion:(NSString*)lastVersionLabelOrAppVersion andLastVersionDeploymentKey:(NSString*)lastVersionDeploymentKey;
22 |
23 | - (id)initWithDictionary:(NSDictionary*)dict;
24 |
25 | - (NSDictionary*)toDictionary;
26 |
27 | @end
--------------------------------------------------------------------------------
/ios/Plugin/StatusReport.m:
--------------------------------------------------------------------------------
1 | #import "StatusReport.h"
2 |
3 | @implementation StatusReport
4 |
5 | const NSString* StatusKey = @"status";
6 | const NSString* LabelKey = @"label";
7 | const NSString* AppVersionKey = @"appVersion";
8 | const NSString* DeploymentKeyKey = @"deploymentKey";
9 | const NSString* LastVersionLabelOrAppVersionKey = @"lastVersionLabelOrAppVersion";
10 | const NSString* LastVersionDeploymentKeyKey = @"lastVersionDeploymentKey";
11 |
12 | - (id)initWithStatus:(ReportingStatus)status andLabel:(NSString*)label andAppVersion:(NSString*)appVersion andDeploymentKey:(NSString*)deploymentKey {
13 | return [self initWithStatus:status andLabel:label andAppVersion:appVersion andDeploymentKey:deploymentKey andLastVersionLabelOrAppVersion:nil andLastVersionDeploymentKey:nil];
14 | }
15 |
16 |
17 | - (id)initWithStatus:(ReportingStatus)status andLabel:(NSString*)label andAppVersion:(NSString*)appVersion andDeploymentKey:(NSString*)deploymentKey andLastVersionLabelOrAppVersion:(NSString*)lastVersionLabelOrAppVersion andLastVersionDeploymentKey:(NSString*)lastVersionDeploymentKey {
18 | self = [super init];
19 | if (self) {
20 | _status = status;
21 | _label = label;
22 | _appVersion = appVersion;
23 | _deploymentKey = deploymentKey;
24 | _lastVersionLabelOrAppVersion = lastVersionLabelOrAppVersion;
25 | _lastVersionDeploymentKey = lastVersionDeploymentKey;
26 | }
27 |
28 | return self;
29 | }
30 |
31 | - (id)initWithDictionary:(NSDictionary*)dict {
32 | return [self initWithStatus:[dict[StatusKey] longValue] andLabel:dict[LabelKey] andAppVersion:dict[AppVersionKey] andDeploymentKey:dict[DeploymentKeyKey] andLastVersionLabelOrAppVersion:dict[LastVersionLabelOrAppVersionKey] andLastVersionDeploymentKey:dict[LastVersionDeploymentKeyKey]];
33 | }
34 |
35 | - (NSDictionary*)toDictionary {
36 | NSMutableDictionary* dict = [[NSMutableDictionary alloc] init];
37 | dict[StatusKey] = @(_status);
38 | if (_label) dict[LabelKey] = _label;
39 | if (_appVersion) dict[AppVersionKey] = _appVersion;
40 | if (_deploymentKey) dict[DeploymentKeyKey] = _deploymentKey;
41 | if (_lastVersionLabelOrAppVersion) dict[LastVersionLabelOrAppVersionKey] = _lastVersionLabelOrAppVersion;
42 | if (_lastVersionDeploymentKey) dict[LastVersionDeploymentKeyKey] = _lastVersionDeploymentKey;
43 | return dict;
44 | }
45 |
46 | @end
--------------------------------------------------------------------------------
/ios/Plugin/UpdateHashUtils.h:
--------------------------------------------------------------------------------
1 | @interface UpdateHashUtils : NSObject
2 |
3 | + (NSString*)getBinaryHash:(NSError**)error;
4 | + (NSString*)getHashForPath:(NSString*)path error:(NSError**)error;
5 |
6 | @end
--------------------------------------------------------------------------------
/ios/Plugin/Utilities.h:
--------------------------------------------------------------------------------
1 | @interface Utilities : NSObject
2 |
3 | + (NSString*)getApplicationVersion;
4 | + (NSString*)getApplicationTimestamp;
5 | + (NSDate*)getApplicationBuildTime;
6 | + (BOOL)CDVWebViewEngineAvailable;
7 |
8 | @end
--------------------------------------------------------------------------------
/ios/Plugin/Utilities.m:
--------------------------------------------------------------------------------
1 | #import "Utilities.h"
2 |
3 | @implementation Utilities
4 |
5 | static NSNumber* CDVWebViewEngineExists = nil;
6 |
7 | + (NSString*)getApplicationVersion{
8 | return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
9 | }
10 |
11 | + (NSString*)getApplicationTimestamp{
12 | NSDate* applicationBuildTime = [self getApplicationBuildTime];
13 | if (applicationBuildTime){
14 | NSNumber* timestamp = [[NSNumber alloc] initWithDouble: floor([applicationBuildTime timeIntervalSince1970] * 1000)];
15 | return [timestamp stringValue];
16 | }
17 |
18 | return nil;
19 | }
20 |
21 | + (NSDate*)getApplicationBuildTime{
22 | //get path for plist file to check modification date because iOS10.2 failed to get modification date of main bundle
23 | NSString *appPlistPath = [[NSBundle mainBundle] pathForResource:nil ofType:@"plist"];
24 | NSDictionary *executableAttributes = [[NSFileManager defaultManager] attributesOfItemAtPath:appPlistPath error:nil];
25 | NSDate *fileDate = [executableAttributes objectForKey:@"NSFileModificationDate"];
26 | return fileDate;
27 | }
28 |
29 | + (BOOL)CDVWebViewEngineAvailable{
30 | if(CDVWebViewEngineExists == nil) {
31 | BOOL value = NSClassFromString(@"CDVWebViewEngine") != nil;
32 | CDVWebViewEngineExists = [NSNumber numberWithBool:value];
33 | }
34 | return [CDVWebViewEngineExists boolValue];
35 | }
36 |
37 | void CPLog(NSString *formatString, ...) {
38 | va_list args;
39 | va_start(args, formatString);
40 | NSString *prependedFormatString = [NSString stringWithFormat:@"\n[CodePush] %@", formatString];
41 | NSLogv(prependedFormatString, args);
42 | va_end(args);
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/ios/PluginTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ios/PluginTests/PluginTests.swift:
--------------------------------------------------------------------------------
1 | import XCTest
2 | import Capacitor
3 | @testable import Plugin
4 |
5 | class PluginTests: XCTestCase {
6 |
7 | override func setUp() {
8 | super.setUp()
9 | // Put setup code here. This method is called before the invocation of each test method in the class.
10 | }
11 |
12 | override func tearDown() {
13 | // Put teardown code here. This method is called after the invocation of each test method in the class.
14 | super.tearDown()
15 | }
16 |
17 | func testEcho() {
18 | // This is an example of a functional test case for a plugin.
19 | // Use XCTAssert and related functions to verify your tests produce the correct results.
20 |
21 | let value = "Hello, World!"
22 | let plugin = MyPlugin()
23 |
24 | let call = CAPPluginCall(callbackId: "test", options: [
25 | "value": value
26 | ], success: { (result, _) in
27 | let resultValue = result!.data["value"] as? String
28 | XCTAssertEqual(value, resultValue)
29 | }, error: { (_) in
30 | XCTFail("Error shouldn't have been called")
31 | })
32 |
33 | plugin.echo(call!)
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '12.0'
2 |
3 | def capacitor_pods
4 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
5 | use_frameworks!
6 | pod 'Capacitor', :path => '../node_modules/@capacitor/ios'
7 | pod 'CapacitorCordova', :path => '../node_modules/@capacitor/ios'
8 | end
9 |
10 | target 'Plugin' do
11 | capacitor_pods
12 | pod 'SSZipArchive'
13 | end
14 |
15 | target 'PluginTests' do
16 | capacitor_pods
17 | end
18 |
--------------------------------------------------------------------------------
/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Capacitor (3.0.0-beta.1):
3 | - CapacitorCordova
4 | - CapacitorCordova (3.0.0-beta.1)
5 | - naveridlogin-sdk-ios (4.1.3)
6 |
7 | DEPENDENCIES:
8 | - "Capacitor (from `../node_modules/@capacitor/ios`)"
9 | - "CapacitorCordova (from `../node_modules/@capacitor/ios`)"
10 | - naveridlogin-sdk-ios (= 4.1.3)
11 |
12 | SPEC REPOS:
13 | trunk:
14 | - naveridlogin-sdk-ios
15 |
16 | EXTERNAL SOURCES:
17 | Capacitor:
18 | :path: "../node_modules/@capacitor/ios"
19 | CapacitorCordova:
20 | :path: "../node_modules/@capacitor/ios"
21 |
22 | SPEC CHECKSUMS:
23 | Capacitor: 6cc2d51ca434c0ec2371c813f08d8dddf7905ef1
24 | CapacitorCordova: 226d15069f4d3c8caa639b5aaa7ad14ffdc4f06e
25 | naveridlogin-sdk-ios: b9d7c20677981177ed994ecb1c8c2b49f223277d
26 |
27 | PODFILE CHECKSUM: 7724088071fbeb8a7b4001fcc1d903a203616cef
28 |
29 | COCOAPODS: 1.9.3
30 |
--------------------------------------------------------------------------------
/ios/Pods/Local Podspecs/Capacitor.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Capacitor",
3 | "version": "3.0.0-beta.1",
4 | "summary": "Capacitor for iOS",
5 | "social_media_url": "https://twitter.com/capacitorjs",
6 | "license": "MIT",
7 | "homepage": "https://capacitorjs.com/",
8 | "platforms": {
9 | "ios": "12.0"
10 | },
11 | "authors": {
12 | "Ionic Team": "hi@ionicframework.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/ionic-team/capacitor.git",
16 | "tag": "3.0.0-beta.1"
17 | },
18 | "source_files": [
19 | "Capacitor/Capacitor/*.{swift,h,m}",
20 | "Capacitor/Capacitor/Plugins/*.{swift,h,m}",
21 | "Capacitor/Capacitor/Plugins/**/*.{swift,h,m}"
22 | ],
23 | "module_map": "Capacitor/Capacitor/Capacitor.modulemap",
24 | "dependencies": {
25 | "CapacitorCordova": [
26 |
27 | ]
28 | },
29 | "swift_versions": "5.0",
30 | "swift_version": "5.0"
31 | }
32 |
--------------------------------------------------------------------------------
/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "CapacitorCordova",
3 | "module_name": "Cordova",
4 | "version": "3.0.0-beta.1",
5 | "summary": "Capacitor Cordova Compatibility Layer",
6 | "homepage": "https://capacitorjs.com",
7 | "license": "MIT",
8 | "authors": {
9 | "Ionic Team": "hi@ionicframework.com"
10 | },
11 | "source": {
12 | "git": "https://github.com/ionic-team/capacitor",
13 | "tag": "3.0.0-beta.1"
14 | },
15 | "platforms": {
16 | "ios": "12.0"
17 | },
18 | "source_files": "CapacitorCordova/**/*.{h,m}",
19 | "public_header_files": [
20 | "CapacitorCordova/CapacitorCordova/Classes/Public/*.h",
21 | "CapacitorCordova/CapacitorCordova/CapacitorCordova.h"
22 | ],
23 | "module_map": "CapacitorCordova/CapacitorCordova/CapacitorCordova.modulemap",
24 | "requires_arc": true,
25 | "frameworks": "WebKit"
26 | }
27 |
--------------------------------------------------------------------------------
/ios/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Capacitor (3.0.0-beta.1):
3 | - CapacitorCordova
4 | - CapacitorCordova (3.0.0-beta.1)
5 | - naveridlogin-sdk-ios (4.1.3)
6 |
7 | DEPENDENCIES:
8 | - "Capacitor (from `../node_modules/@capacitor/ios`)"
9 | - "CapacitorCordova (from `../node_modules/@capacitor/ios`)"
10 | - naveridlogin-sdk-ios (= 4.1.3)
11 |
12 | SPEC REPOS:
13 | trunk:
14 | - naveridlogin-sdk-ios
15 |
16 | EXTERNAL SOURCES:
17 | Capacitor:
18 | :path: "../node_modules/@capacitor/ios"
19 | CapacitorCordova:
20 | :path: "../node_modules/@capacitor/ios"
21 |
22 | SPEC CHECKSUMS:
23 | Capacitor: 6cc2d51ca434c0ec2371c813f08d8dddf7905ef1
24 | CapacitorCordova: 226d15069f4d3c8caa639b5aaa7ad14ffdc4f06e
25 | naveridlogin-sdk-ios: b9d7c20677981177ed994ecb1c8c2b49f223277d
26 |
27 | PODFILE CHECKSUM: 7724088071fbeb8a7b4001fcc1d903a203616cef
28 |
29 | COCOAPODS: 1.9.3
30 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/Capacitor.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/CapacitorCordova.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/Pods-Plugin.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/naveridlogin-sdk-ios.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
44 |
45 |
46 |
52 |
53 |
55 |
56 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ios/Pods/Pods.xcodeproj/xcuserdata/sangmin.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Capacitor.xcscheme
8 |
9 | isShown
10 |
11 |
12 | CapacitorCordova.xcscheme
13 |
14 | isShown
15 |
16 |
17 | Pods-Plugin.xcscheme
18 |
19 | isShown
20 |
21 |
22 | Pods-PluginTests.xcscheme
23 |
24 | isShown
25 |
26 |
27 | naveridlogin-sdk-ios.xcscheme
28 |
29 | isShown
30 |
31 |
32 |
33 | SuppressBuildableAutocreation
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Capacitor : NSObject
3 | @end
4 | @implementation PodsDummy_Capacitor
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Capacitor
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap:
--------------------------------------------------------------------------------
1 | framework module Capacitor {
2 | umbrella header "Capacitor.h"
3 | exclude header "CAPBridgedJSTypes.h"
4 |
5 | export *
6 | module * { export * }
7 | }
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Capacitor
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
5 | PODS_BUILD_DIR = ${BUILD_DIR}
6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
7 | PODS_ROOT = ${SRCROOT}
8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios
9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
10 | SKIP_INSTALL = YES
11 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
12 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_CapacitorCordova : NSObject
3 | @end
4 | @implementation PodsDummy_CapacitorCordova
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "WebKit"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap:
--------------------------------------------------------------------------------
1 | framework module Cordova {
2 | umbrella header "CapacitorCordova.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "WebKit"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../node_modules/@capacitor/ios
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
11 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_Plugin : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_Plugin
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_PluginVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_PluginVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig:
--------------------------------------------------------------------------------
1 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" "${PODS_ROOT}/naveridlogin-sdk-ios"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "CoreGraphics" -framework "Foundation" -framework "NaverThirdPartyLogin" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "WebKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_Plugin {
2 | umbrella header "Pods-Plugin-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig:
--------------------------------------------------------------------------------
1 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" "${PODS_ROOT}/naveridlogin-sdk-ios"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers"
5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
6 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "CoreGraphics" -framework "Foundation" -framework "NaverThirdPartyLogin" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "WebKit"
7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
8 | PODS_BUILD_DIR = ${BUILD_DIR}
9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
11 | PODS_ROOT = ${SRCROOT}/Pods
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_PluginTests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_PluginTests
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_PluginTestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_PluginTestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" "${PODS_ROOT}/naveridlogin-sdk-ios"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "CoreGraphics" -framework "Foundation" -framework "NaverThirdPartyLogin" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "WebKit"
8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
14 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_PluginTests {
2 | umbrella header "Pods-PluginTests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig:
--------------------------------------------------------------------------------
1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
2 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova" "${PODS_ROOT}/naveridlogin-sdk-ios"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Capacitor/Capacitor.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/CapacitorCordova/Cordova.framework/Headers"
6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
7 | OTHER_LDFLAGS = $(inherited) -framework "Capacitor" -framework "Cordova" -framework "CoreGraphics" -framework "Foundation" -framework "NaverThirdPartyLogin" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "WebKit"
8 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS
9 | PODS_BUILD_DIR = ${BUILD_DIR}
10 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
11 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
12 | PODS_ROOT = ${SRCROOT}/Pods
13 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
14 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/naveridlogin-sdk-ios/naveridlogin-sdk-ios.debug.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/naveridlogin-sdk-ios
2 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/naveridlogin-sdk-ios"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/naveridlogin-sdk-ios
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/ios/Pods/Target Support Files/naveridlogin-sdk-ios/naveridlogin-sdk-ios.release.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/naveridlogin-sdk-ios
2 | EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64
3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/naveridlogin-sdk-ios"
4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
5 | OTHER_LDFLAGS = $(inherited) -framework "CoreGraphics" -framework "Foundation" -framework "QuartzCore" -framework "SafariServices" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/naveridlogin-sdk-ios
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
13 |
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Headers/NaverThirdPartyConstantsForApp.h:
--------------------------------------------------------------------------------
1 | //
2 | // NaverThirdPartyConstantsForApp.h
3 | // NaverOAuthSample
4 | //
5 | // Created by min sujin on 12. 3. 28..
6 | // Modified by TY Kim on 14. 8. 20..
7 | // Copyright 2014 Naver Corp. All rights reserved.
8 | //
9 |
10 | #define kCheckResultPage @"thirdPartyLoginResult"
11 | #define kThirdParty_IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
12 |
13 | typedef enum {
14 | SUCCESS = 0,
15 | PARAMETERNOTSET = 1,
16 | CANCELBYUSER = 2,
17 | NAVERAPPNOTINSTALLED = 3 ,
18 | NAVERAPPVERSIONINVALID = 4,
19 | OAUTHMETHODNOTSET = 5,
20 | INVALIDREQUEST = 6,
21 | CLIENTNETWORKPROBLEM = 7,
22 | UNAUTHORIZEDCLIENT = 8,
23 | UNSUPPORTEDRESPONSETYPE = 9,
24 | NETWORKERROR = 10,
25 | UNKNOWNERROR = 11
26 | } THIRDPARTYLOGIN_RECEIVE_TYPE;
27 |
28 | typedef enum {
29 | NEED_INIT = 0,
30 | NEED_LOGIN,
31 | NEED_REFRESH_ACCESS_TOKEN,
32 | OK
33 | } OAuthLoginState;
34 |
35 | #define kServiceAppUrlScheme @"thirdparty20samplegame"
36 |
37 | #define kConsumerKey @"jyvqXeaVOVmV"
38 | #define kConsumerSecret @"527300A0_COq1_XV33cf"
39 | #define kServiceAppName @"네이버 아이디로 로그인"
40 |
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Headers/NaverThirdPartyLogin.h:
--------------------------------------------------------------------------------
1 | //
2 | // NaverThirdPartyLogin.h
3 | // NaverThirdPartyLogin
4 | //
5 | // Created by Naver on 2017. 10. 24..
6 | //
7 |
8 | #import
9 |
10 | //! Project version number for NaverThirdPartyLogin.
11 | FOUNDATION_EXPORT double NaverThirdPartyLoginVersionNumber;
12 |
13 | //! Project version string for NaverThirdPartyLogin.
14 | FOUNDATION_EXPORT const unsigned char NaverThirdPartyLoginVersionString[];
15 |
16 | // In this header, you should import all the public headers of your framework using statements like #import
17 |
18 |
19 | #import
20 | #import
21 |
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Headers/NaverThirdPartyLoginConnection.h:
--------------------------------------------------------------------------------
1 | //
2 | // NaverThirdPartyLoginConnection.h
3 | // NaverOAuthSample
4 | //
5 | // Created by TY Kim on 2014. 2. 3..
6 | // Copyright 2014 Naver Corp. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "NaverThirdPartyConstantsForApp.h"
12 |
13 | @protocol NaverThirdPartyLoginConnectionDelegate;
14 | @interface NaverThirdPartyLoginConnection : NSObject
15 | @property (nonatomic, weak) id delegate;
16 |
17 | @property (nonatomic) BOOL isNaverAppOauthEnable;
18 | @property (nonatomic) BOOL isInAppOauthEnable;
19 |
20 | @property (nonatomic, strong) NSString *consumerKey;
21 | @property (nonatomic, strong) NSString *consumerSecret;
22 | @property (nonatomic, strong) NSString *appName;
23 | @property (nonatomic, strong) NSString *serviceUrlScheme;
24 |
25 | @property (nonatomic, strong) NSString *accessToken;
26 | @property (nonatomic, strong) NSDate *accessTokenExpireDate;
27 | @property (nonatomic, strong) NSString *refreshToken;
28 | @property (nonatomic, strong) NSString *tokenType;
29 |
30 | + (NaverThirdPartyLoginConnection *)getSharedInstance;
31 |
32 | - (NSString *)getVersion;
33 |
34 | - (OAuthLoginState)state;
35 |
36 | - (void)requestThirdPartyLogin;
37 | - (void)requestAccessTokenWithRefreshToken;
38 | - (void)requestDeleteToken;
39 |
40 | - (BOOL)isValidAccessTokenExpireTimeNow;
41 |
42 | - (THIRDPARTYLOGIN_RECEIVE_TYPE)receiveAccessToken:(NSURL *)url;
43 | - (void)resetToken;
44 |
45 | - (void)setOnlyPortraitSupportInIphone:(BOOL)flag;
46 |
47 | - (BOOL)isOnlyPortraitSupportedInIphone;
48 |
49 | - (NSString *)userAgentForThirdPartyLogin;
50 |
51 | - (void)removeNaverLoginCookie;
52 |
53 | - (BOOL)isPossibleToOpenNaverApp;
54 | - (void)openAppStoreForNaverApp;
55 |
56 |
57 | + (CGSize)sizeWithText:(NSString *)originText withFont:(UIFont *)textFont;
58 |
59 | - (BOOL)isNaverThirdPartyLoginAppschemeURL:(NSURL *) url;
60 | // iOS13 Scendelegate
61 | - (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URLContexts API_AVAILABLE(ios(13.0));
62 |
63 | @end
64 |
65 | @protocol NaverThirdPartyLoginConnectionDelegate
66 | - (void)oauth20ConnectionDidFinishRequestACTokenWithAuthCode;
67 | - (void)oauth20ConnectionDidFinishRequestACTokenWithRefreshToken;
68 | - (void)oauth20ConnectionDidFinishDeleteToken;
69 | - (void)oauth20Connection:(NaverThirdPartyLoginConnection *)oauthConnection didFailWithError:(NSError *)error;
70 | @optional
71 | - (void)oauth20Connection:(NaverThirdPartyLoginConnection *)oauthConnection didFailAuthorizationWithRecieveType:(THIRDPARTYLOGIN_RECEIVE_TYPE)receiveType;
72 | - (void)oauth20Connection:(NaverThirdPartyLoginConnection *)oauthConnection didFinishAuthorizationWithResult:(THIRDPARTYLOGIN_RECEIVE_TYPE)receiveType;
73 |
74 | @end
75 |
76 |
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Info.plist
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module NaverThirdPartyLogin {
2 | umbrella header "NaverThirdPartyLogin.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/btn_notice_close_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/btn_notice_close_normal@2x.png
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/en.lproj/NaverAuth.strings:
--------------------------------------------------------------------------------
1 | /*
2 | NaverAuth.strings
3 |
4 | Created by Taeyeon Kim on 15. 7. 23..
5 | Copyright (c) 2015 Naver Corp. All rights reserved.
6 |
7 | 영어용 NSLocalizableString
8 |
9 | */
10 |
11 | // 타이틀 바용 레이블 텍스트
12 | "NaverAuthBannerMessage" = "Get NAVER App and sign in faster";
13 | "NaverAuthBannerDownloadLinkMessage" = "Download App";
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/ko.lproj/NaverAuth.strings:
--------------------------------------------------------------------------------
1 | /*
2 | NaverAuth.strings
3 |
4 | Created by Taeyeon Kim on 15. 7. 23..
5 | Copyright (c) 2015 Naver Corp. All rights reserved.
6 |
7 | 한국어용 NSLocalizableString
8 |
9 | */
10 |
11 | // 타이틀 바용 레이블 텍스트
12 | "NaverAuthBannerMessage" = "네이버 앱으로 더욱 간편하게 로그인!";
13 | "NaverAuthBannerDownloadLinkMessage" = "앱 다운로드";
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_banner_btn_close@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_banner_btn_close@2x.png
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_banner_btn_close@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_banner_btn_close@3x.png
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_naverapp_logo@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_naverapp_logo@2x.png
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_naverapp_logo@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/login_naverapp_logo@3x.png
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/zh-Hans.lproj/NaverAuth.strings:
--------------------------------------------------------------------------------
1 | /*
2 | NaverAuth.strings
3 |
4 | Created by Taeyeon Kim on 15. 7. 23..
5 | Copyright (c) 2015 Naver Corp. All rights reserved.
6 |
7 | 중국어 간체용 NSLocalizableString
8 |
9 | */
10 |
11 | // 타이틀 바용 레이블 텍스트
12 | "NaverAuthBannerMessage" = "通过NAVER App 便捷登录";
13 | "NaverAuthBannerDownloadLinkMessage" = "下载APP";
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverAuth.bundle/zh-Hant.lproj/NaverAuth.strings:
--------------------------------------------------------------------------------
1 | /*
2 | NaverAuth.strings
3 |
4 | Created by Taeyeon Kim on 15. 7. 23..
5 | Copyright (c) 2015 Naver Corp. All rights reserved.
6 |
7 | 중국어 번체용 NSLocalizableString
8 |
9 | */
10 |
11 | // 타이틀 바용 레이블 텍스트
12 | "NaverAuthBannerMessage" = "通過NAVER App 便捷登錄";
13 | "NaverAuthBannerDownloadLinkMessage" = "下載APP";
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverThirdPartyLogin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/ios/Pods/naveridlogin-sdk-ios/NaverThirdPartyLogin.framework/NaverThirdPartyLogin
--------------------------------------------------------------------------------
/ios/Pods/naveridlogin-sdk-ios/README.md:
--------------------------------------------------------------------------------
1 | # Naver ID Login SDK for iOS
2 | iOS용 네이버 ID 로그인 라이브러리 및 예제 프로젝트를 포함하고있습니다.
3 | 자세한 내용은 [개발자 센터 튜토리얼](https://developers.naver.com/docs/login/ios/)에서 확인하실 수 있습니다.
4 |
5 |
6 | 샘플앱 실행 방법
7 | ```
8 | pod try naveridlogin-sdk-ios
9 | ```
10 |
11 | Podfile 적용
12 | ```
13 | pod 'naveridlogin-sdk-ios'
14 | ```
15 |
16 | # License
17 | See [LICENSE](LICENSE) for full license text.
18 |
19 | Copyright 2017 Naver Corp.
20 |
21 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
22 |
23 | http://www.apache.org/licenses/LICENSE-2.0
24 |
25 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
26 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "capacitor-codepush",
3 | "version": "1.0.0",
4 | "description": "CodePush Plugin for Capacitor",
5 | "module": "dist/esm/index.js",
6 | "types": "dist/esm/index.d.ts",
7 | "homepage": "https://github.com/mapiacompany/capacitor-codepush",
8 | "repository": "github:mapiacompany/capacitor-codepush",
9 | "publishConfig": {
10 | "registry": "https://npm.pkg.github.com/"
11 | },
12 | "scripts": {
13 | "lint": "npm run prettier -- --check && npm run swiftlint -- lint",
14 | "prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
15 | "swiftlint": "node-swiftlint",
16 | "build": "npm run clean && tsc && rollup -c rollup.config.js",
17 | "clean": "rimraf ./dist",
18 | "watch": "tsc --watch",
19 | "prepublishOnly": "npm run build"
20 | },
21 | "keywords": [
22 | "capacitor",
23 | "code",
24 | "push",
25 | "ecosystem:capacitor",
26 | "capacitor-android",
27 | "capacitor-ios"
28 | ],
29 | "author": "MAPIACOMPANY",
30 | "license": "MIT",
31 | "devDependencies": {
32 | "@capacitor-community/http": "^1.0.0",
33 | "@capacitor/cli": "^3.0.0",
34 | "@capacitor/device": "^1.0.0",
35 | "@capacitor/dialog": "^1.0.0",
36 | "@capacitor/filesystem": "^1.0.0",
37 | "@commitlint/cli": "^11.0.0",
38 | "@commitlint/config-conventional": "^11.0.0",
39 | "@rollup/plugin-node-resolve": "^11.1.0",
40 | "@semantic-release/git": "^9.0.0",
41 | "@types/assert": "^1.5.4",
42 | "@types/cordova": "0.0.34",
43 | "@types/mkdirp": "^1.0.1",
44 | "@types/mocha": "^8.2.0",
45 | "@types/node": "^14.14.22",
46 | "@types/power-assert": "^1.5.3",
47 | "@types/q": "^1.5.4",
48 | "archiver": "^5.2.0",
49 | "body-parser": "^1.19.0",
50 | "del": "^6.0.0",
51 | "express": "^4.17.1",
52 | "gulp": "^4.0.2",
53 | "gulp-insert": "^0.5.0",
54 | "gulp-tslint": "^8.1.4",
55 | "gulp-typescript": "^5.0.1",
56 | "husky": "^4.3.8",
57 | "mkdirp": "^1.0.4",
58 | "mocha": "^8.2.1",
59 | "mocha-junit-reporter": "^2.0.0",
60 | "q": "^1.5.1",
61 | "replace": "^1.2.0",
62 | "rollup": "^2.38.0",
63 | "run-sequence": "^2.2.1",
64 | "semantic-release": "^17.3.7",
65 | "tslint": "^6.1.3",
66 | "typescript": "~4.2.4"
67 | },
68 | "dependencies": {
69 | "code-push": "^4.0.2"
70 | },
71 | "peerDependencies": {
72 | "@capacitor-community/http": "^1.0.0",
73 | "@capacitor/core": "^3.0.0",
74 | "@capacitor/device": "^1.0.0",
75 | "@capacitor/dialog": "^1.0.0",
76 | "@capacitor/filesystem": "^1.0.0"
77 | },
78 | "capacitor": {
79 | "android": {
80 | "src": "android"
81 | },
82 | "ios": {
83 | "src": "ios"
84 | }
85 | },
86 | "husky": {
87 | "hooks": {
88 | "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | import nodeResolve from '@rollup/plugin-node-resolve';
2 |
3 | export default {
4 | input: 'dist/esm/index.js',
5 | output: {
6 | file: 'dist/plugin.js',
7 | format: 'iife',
8 | name: 'capacitorPlugin', // TODO: change this
9 | globals: {
10 | '@capacitor/core': 'capacitorExports',
11 | },
12 | sourcemap: true,
13 | },
14 | plugins: [
15 | nodeResolve({
16 | // allowlist of dependencies to bundle in
17 | // @see https://github.com/rollup/plugins/tree/master/packages/node-resolve#resolveonly
18 | resolveOnly: ['lodash'],
19 | }),
20 | ],
21 | };
22 |
--------------------------------------------------------------------------------
/samples/.gitignore:
--------------------------------------------------------------------------------
1 | */platforms
2 | */plugins
3 |
--------------------------------------------------------------------------------
/samples/advanced/README.md:
--------------------------------------------------------------------------------
1 | # Cordova CodePush Sample App - Advanced
2 |
3 | This is a sample application demonstrating a more advanced way you could integrate CodePush in your Cordova application. All the CodePush specific code is found in [index.js](/samples/advanced/www/js/index.js). The CodePush configuration is found in [config.xml](/samples/advanced/config.xml).
4 |
5 | When the application loads, on the `deviceready` event, we poll the CodePush server for an update. If an update is available, we prompt the user to install it. If the user approves it, the update is installed and the application is reloaded.
6 |
7 | For more information on how to get started see our [Getting Started](/README.md#getting-started) section.
8 |
--------------------------------------------------------------------------------
/samples/advanced/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodePushAdvanced
4 |
5 | A sample Apache Cordova application that uses the CodePush service.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/samples/advanced/www/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/samples/advanced/www/img/logo.png
--------------------------------------------------------------------------------
/samples/advanced/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
32 |
33 |
34 |
35 |
36 |
37 | Hello World
38 |
39 |
40 |
41 |
Hello, CodePush (Version 1)
42 |
43 |
Connecting to Device
44 |
Device is Ready
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/samples/basic/README.md:
--------------------------------------------------------------------------------
1 | # Cordova CodePush Sample App - Basic
2 |
3 | This is a sample application demonstrating the CodePush sync operation. This operation offers a very easy way of integrating CodePush in your application, by invoking only one function. All the CodePush specific code is found in [index.js](/samples/basic/www/js/index.js). The CodePush configuration is found in [config.xml](/samples/basic/config.xml).
4 |
5 | When the application loads, on the `deviceready` event, we invoke sync. This checks for an update, and if one is available, the user will be prompted to install it. Once the user accepts it, the update is installed and the application reloaded. See [SyncOptions](/README.md#syncoptions) in our documentation for customizing the sync behavior.
6 |
7 | For more information on how to get started see our [Getting Started](/README.md#getting-started) section.
8 |
--------------------------------------------------------------------------------
/samples/basic/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CodePushBasic
4 |
5 | A sample Apache Cordova application that uses the CodePush service.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/samples/basic/www/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mpaghq/capacitor-codepush/037174d2c00fa1a095f1ed2a445a31ccd70815df/samples/basic/www/img/logo.png
--------------------------------------------------------------------------------
/samples/basic/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
32 |
33 |
34 |
35 |
36 |
37 | Hello World
38 |
39 |
40 |
41 |
Hello, CodePush (Version 1)
42 |
43 |
Connecting to Device
44 |
Device is Ready
45 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/callbackUtil.ts:
--------------------------------------------------------------------------------
1 | export interface Callback { (error: Error | null | undefined, parameter: T): void; }
2 | export interface SuccessCallback { (result?: T): void; }
3 | export interface ErrorCallback { (error?: Error | null | undefined): void; }
4 |
--------------------------------------------------------------------------------
/src/codePushUtil.ts:
--------------------------------------------------------------------------------
1 | import { Callback, ErrorCallback, SuccessCallback } from "./callbackUtil";
2 |
3 | /**
4 | * Callback / error / logging utilities.
5 | */
6 | export class CodePushUtil {
7 |
8 | /**
9 | * Tag used for logging to the console.
10 | */
11 | private static TAG: string = "[CodePush]";
12 |
13 | /**
14 | * Performs a copy of all members of fromParameter to toParameter, with the condition that they are unassigned or null in toParameter.
15 | */
16 | public static copyUnassignedMembers(fromParameter: any, toParameter: any) {
17 | for (let key in fromParameter) {
18 | if ((toParameter)[key] === undefined || (toParameter)[key] === null) {
19 | (toParameter)[key] = (fromParameter)[key];
20 | }
21 | }
22 | }
23 |
24 | /**
25 | * Given two Cordova style callbacks for success and error, this function returns a node.js
26 | * style callback where the error is the first parameter and the result the second.
27 | */
28 | public static getNodeStyleCallbackFor(successCallback: SuccessCallback, errorCallback: { (error?: any): void; }): Callback {
29 | return (error: any, result: T) => {
30 | if (error) {
31 | errorCallback && errorCallback(error);
32 | } else {
33 | successCallback && successCallback(result);
34 | }
35 | };
36 | }
37 |
38 | /**
39 | * Gets the message of an error, if any. Otherwise it returns the empty string.
40 | */
41 | public static getErrorMessage(e: Error | undefined): string {
42 | return e && e.message || e && e.toString() || "";
43 | }
44 |
45 | /**
46 | * Logs the error to the console and then forwards it to the provided ErrorCallback, if any.
47 | * TODO: remove me
48 | */
49 | public static invokeErrorCallback = (error: Error, errorCallback: ErrorCallback): void => {
50 | CodePushUtil.logError(null, error);
51 | errorCallback && errorCallback(error);
52 | }
53 |
54 | /**
55 | * Logs the error to the console and then throws the error.
56 | */
57 | public static throwError = (error: Error): void => {
58 | CodePushUtil.logError(null, error);
59 | throw error;
60 | }
61 |
62 | /**
63 | * Logs a message using the CodePush tag.
64 | */
65 | public static logMessage(msg: string): void {
66 | console.log(CodePushUtil.TAG + " " + msg);
67 | }
68 |
69 | /**
70 | * Logs an error message using the CodePush tag.
71 | */
72 | public static logError(message: String, error?: Error): void {
73 | const errorMessage = `${message || ""} ${CodePushUtil.getErrorMessage(error)}`;
74 | const stackTrace = error && error.stack ? `. StackTrace: ${error.stack}` : "";
75 | console.error(`${CodePushUtil.TAG} ${errorMessage}${stackTrace}`);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/http.ts:
--------------------------------------------------------------------------------
1 | import { Callback } from "./callbackUtil";
2 |
3 | export const enum Verb {
4 | GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH
5 | }
6 |
7 | export interface Response {
8 | statusCode: number;
9 | body?: string;
10 | }
11 |
12 | export interface Requester {
13 | request(verb: Verb, url: string, callback: Callback): void;
14 | request(verb: Verb, url: string, requestBody: string, callback: Callback): void;
15 | }
16 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./codePush";
2 | export * from "./installMode";
3 | export * from "./installOptions";
4 | export { CodePush } from "./nativeCodePushPlugin";
5 |
--------------------------------------------------------------------------------
/src/installMode.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the available install modes for updates.
3 | */
4 | export enum InstallMode {
5 | /**
6 | * The update will be applied to the running application immediately. The application will be reloaded with the new content immediately.
7 | */
8 | IMMEDIATE,
9 |
10 | /**
11 | * The update is downloaded but not installed immediately. The new content will be available the next time the application is started.
12 | */
13 | ON_NEXT_RESTART,
14 |
15 | /**
16 | * The udpate is downloaded but not installed immediately. The new content will be available the next time the application is resumed or restarted, whichever event happends first.
17 | */
18 | ON_NEXT_RESUME
19 | }
20 |
--------------------------------------------------------------------------------
/src/installOptions.ts:
--------------------------------------------------------------------------------
1 | import { InstallMode } from "./installMode";
2 |
3 | /**
4 | * Defines the install operation options.
5 | */
6 | export interface InstallOptions {
7 | /**
8 | * Used to specify the InstallMode used for the install operation. This is optional and defaults to InstallMode.ON_NEXT_RESTART.
9 | */
10 | installMode?: InstallMode;
11 |
12 | /**
13 | * If installMode === ON_NEXT_RESUME, the minimum amount of time (in seconds) which needs to pass with the app in the background before an update install occurs when the app is resumed.
14 | */
15 | minimumBackgroundDuration?: number;
16 |
17 | /**
18 | * Used to specify the InstallMode used for the install operation if the update is mandatory. This is optional and defaults to InstallMode.IMMEDIATE.
19 | */
20 | mandatoryInstallMode?: InstallMode;
21 | }
22 |
--------------------------------------------------------------------------------
/src/nativeCodePushPlugin.ts:
--------------------------------------------------------------------------------
1 | // Type definitions for Apache Cordova CodePush plugin.
2 | // Project: https://github.com/Microsoft/cordova-plugin-code-push
3 | //
4 | // Copyright (c) Microsoft Corporation
5 | // All rights reserved.
6 | // Licensed under the MIT license.
7 |
8 | import { InstallOptions } from "./installOptions";
9 | import { registerPlugin } from "@capacitor/core";
10 |
11 | interface StatusReport {
12 | status: number;
13 | label: string;
14 | appVersion: string;
15 | deploymentKey: string;
16 | lastVersionLabelOrAppVersion: string;
17 | lastVersionDeploymentKey: string;
18 | }
19 |
20 | interface PluginCallResponse {
21 | value: T;
22 | }
23 |
24 | interface NativeDecodeSignatureOptions {
25 | publicKey: string;
26 | signature: string;
27 | }
28 |
29 | interface NativePathOptions {
30 | path: string;
31 | }
32 |
33 | interface NativeHashOptions {
34 | packageHash: string;
35 | }
36 |
37 | interface NativeInstallOptions extends InstallOptions {
38 | startLocation: string;
39 | }
40 |
41 | interface NativeUnzipOptions extends InstallOptions {
42 | zipFile: string;
43 | targetDirectory: string;
44 | }
45 |
46 | interface NativeStatusReportOptions {
47 | statusReport: StatusReport;
48 | }
49 |
50 | export interface NativeCodePushPlugin {
51 | getDeploymentKey(): Promise>;
52 | getServerURL(): Promise>;
53 | getPublicKey(): Promise>;
54 | decodeSignature(options: NativeDecodeSignatureOptions): Promise>;
55 | getBinaryHash(): Promise>;
56 | getPackageHash(options: NativePathOptions): Promise>;
57 | notifyApplicationReady(): Promise;
58 | isFirstRun(options: NativeHashOptions): Promise>;
59 | isPendingUpdate(): Promise>;
60 | isFailedUpdate(options: NativeHashOptions): Promise>;
61 | install(options: NativeInstallOptions): Promise;
62 | reportFailed(options: NativeStatusReportOptions): Promise;
63 | reportSucceeded(options: NativeStatusReportOptions): Promise;
64 | restartApplication(): Promise;
65 | preInstall(options: NativeInstallOptions): Promise;
66 | getAppVersion(): Promise>;
67 | getNativeBuildTime(): Promise>;
68 | unzip(options: NativeUnzipOptions): Promise;
69 |
70 | addListener(eventName: "codePushStatus", listenerFunc: (info: any) => void): void;
71 | }
72 |
73 | export const CodePush = /*#__PURE__*/ registerPlugin("CodePush");
74 |
--------------------------------------------------------------------------------
/src/syncStatus.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Defines the possible result and intermediate statuses of the window.codePush.sync operation.
3 | * The result statuses are final, mutually exclusive statuses of the sync operation. The operation will end with only one of the possible result statuses.
4 | * The intermediate statuses are not final, one or more of them can happen before sync ends, based on the options you use and user interaction.
5 | *
6 | * NOTE: Adding new statuses or changing old statuses requires an update to CodePush.sync(), which must know which callbacks are results and which are not!
7 | * Also, don't forget to change the TestMessage module in ServerUtils!
8 | * AND THE codePush.d.ts (typings) file!!!
9 | */
10 | export enum SyncStatus {
11 | /**
12 | * Result status - the application is up to date.
13 | */
14 | UP_TO_DATE,
15 |
16 | /**
17 | * Result status - an update is available, it has been downloaded, unzipped and copied to the deployment folder.
18 | * After the completion of the callback invoked with SyncStatus.UPDATE_INSTALLED, the application will be reloaded with the updated code and resources.
19 | */
20 | UPDATE_INSTALLED,
21 |
22 | /**
23 | * Result status - an optional update is available, but the user declined to install it. The update was not downloaded.
24 | */
25 | UPDATE_IGNORED,
26 |
27 | /**
28 | * Result status - an error happened during the sync operation. This might be an error while communicating with the server, downloading or unziping the update.
29 | * The console logs should contain more information about what happened. No update has been applied in this case.
30 | */
31 | ERROR,
32 |
33 | /**
34 | * Result status - there is an ongoing sync in progress, so this attempt to sync has been aborted.
35 | */
36 | IN_PROGRESS,
37 |
38 | /**
39 | * Intermediate status - the plugin is about to check for updates.
40 | */
41 | CHECKING_FOR_UPDATE,
42 |
43 | /**
44 | * Intermediate status - a user dialog is about to be displayed. This status will be reported only if user interaction is enabled.
45 | */
46 | AWAITING_USER_ACTION,
47 |
48 | /**
49 | * Intermediate status - the update packages is about to be downloaded.
50 | */
51 | DOWNLOADING_PACKAGE,
52 |
53 | /**
54 | * Intermediate status - the update package is about to be installed.
55 | */
56 | INSTALLING_UPDATE
57 | }
58 |
--------------------------------------------------------------------------------
/test/template/build.json:
--------------------------------------------------------------------------------
1 | { "ios": { "debug": { "buildFlag": [ "-UseModernBuildSystem=0" ] }, "release": { "buildFlag": [ "-UseModernBuildSystem=0" ] } } }
2 |
--------------------------------------------------------------------------------
/test/template/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "com.microsoft.codepush.test",
3 | "displayName": "CodePushTest",
4 | "description": "A sample Apache Cordova application that is used for testing the CodePush plugin.",
5 | "keywords": [
6 | "ecosystem:cordova"
7 | ],
8 | "author": "Microsoft Corporation",
9 | "license": "MIT"
10 | }
11 |
--------------------------------------------------------------------------------
/test/template/www/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Hello World
9 |
10 |
11 |
12 |
13 |
Hello, CodePush (CODE_PUSH_APP_VERSION)
14 |
Waiting for device...
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/test/template/www/js/scenarioCheckForUpdate.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - check for update)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError);
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
30 | app.sendTestMessage("CHECK_UPDATE_AVAILABLE", [remotePackage]);
31 | }
32 | },
33 | checkError: function (error) {
34 | console.log("An error occured while checking for updates.");
35 | app.sendTestMessage("CHECK_ERROR");
36 | },
37 | sendTestMessage: function (message, args) {
38 | var xhr = new XMLHttpRequest();
39 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
40 | var body = JSON.stringify({ message: message, args: args });
41 | console.log("Sending test message body: " + body);
42 |
43 | xhr.setRequestHeader("Content-type", "application/json");
44 |
45 | xhr.send(body);
46 | }
47 | };
48 |
49 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioCheckForUpdateCustomKey.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - check for update)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError, "CUSTOM-DEPLOYMENT-KEY");
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
30 | app.sendTestMessage("CHECK_UPDATE_AVAILABLE", [remotePackage]);
31 | }
32 | },
33 | checkError: function (error) {
34 | console.log("An error occured while checking for updates.");
35 | app.sendTestMessage("CHECK_ERROR");
36 | },
37 | sendTestMessage: function (message, args) {
38 | var xhr = new XMLHttpRequest();
39 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
40 | var body = JSON.stringify({ message: message, args: args });
41 | console.log("Sending test message body: " + body);
42 |
43 | xhr.setRequestHeader("Content-type", "application/json");
44 |
45 | xhr.send(body);
46 | }
47 | };
48 |
49 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioDownloadUpdate.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - download update)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError);
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
30 | console.log("Downloading package...");
31 | remotePackage.download(app.downloadSuccess, app.downloadError);
32 | }
33 | },
34 | checkError: function (error) {
35 | console.log("An error occured while checking for updates.");
36 | app.sendTestMessage("CHECK_ERROR");
37 | },
38 | downloadSuccess: function (localPackage) {
39 | console.log("Download succeeded.");
40 | app.sendTestMessage("DOWNLOAD_SUCCEEDED", [localPackage]);
41 | },
42 | downloadError: function (error) {
43 | console.log("Download error.");
44 | app.sendTestMessage("DOWNLOAD_ERROR");
45 | },
46 | sendTestMessage: function (message, args) {
47 | var xhr = new XMLHttpRequest();
48 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
49 | var body = JSON.stringify({ message: message, args: args });
50 | console.log("Sending test message body: " + body);
51 |
52 | xhr.setRequestHeader("Content-type", "application/json");
53 |
54 | xhr.send(body);
55 | }
56 | };
57 |
58 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioInstall.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - install immediately)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError);
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
30 | console.log("Downloading package...");
31 | remotePackage.download(app.downloadSuccess, app.downloadError);
32 | }
33 | },
34 | checkError: function (error) {
35 | console.log("An error occured while checking for updates.");
36 | app.sendTestMessage("CHECK_ERROR");
37 | },
38 | downloadSuccess: function (localPackage) {
39 | console.log("Download succeeded.");
40 | localPackage.install(app.installSuccess, app.installError, { installMode: InstallMode.IMMEDIATE });
41 | },
42 | downloadError: function (error) {
43 | console.log("Download error.");
44 | app.sendTestMessage("DOWNLOAD_ERROR");
45 | },
46 | installSuccess: function () {
47 | console.log("Update installed.");
48 | app.sendTestMessage("UPDATE_INSTALLED");
49 | },
50 | installError: function (error) {
51 | console.log("Install error.");
52 | app.sendTestMessage("INSTALL_ERROR");
53 | },
54 | sendTestMessage: function (message, args) {
55 | var xhr = new XMLHttpRequest();
56 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
57 | var body = JSON.stringify({ message: message, args: args });
58 | console.log("Sending test message body: " + body);
59 |
60 | xhr.setRequestHeader("Content-type", "application/json");
61 |
62 | xhr.send(body);
63 | }
64 | };
65 |
66 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioInstallOnRestartWithRevert.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - install on next restart)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError);
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | if (remotePackage.failedInstall) {
30 | app.sendTestMessage("UPDATE_FAILED_PREVIOUSLY");
31 | } else {
32 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
33 | console.log("Downloading package...");
34 | remotePackage.download(app.downloadSuccess, app.downloadError);
35 | }
36 | }
37 | },
38 | checkError: function (error) {
39 | console.log("An error occured while checking for updates.");
40 | app.sendTestMessage("CHECK_ERROR");
41 | },
42 | downloadSuccess: function (localPackage) {
43 | console.log("Download succeeded.");
44 | localPackage.install(app.installSuccess, app.installError, { installMode: InstallMode.ON_NEXT_RESTART });
45 | },
46 | downloadError: function (error) {
47 | console.log("Download error.");
48 | app.sendTestMessage("DOWNLOAD_ERROR");
49 | },
50 | installSuccess: function () {
51 | console.log("Update installed.");
52 | app.sendTestMessage("UPDATE_INSTALLED");
53 | },
54 | installError: function (error) {
55 | console.log("Install error.");
56 | app.sendTestMessage("INSTALL_ERROR");
57 | },
58 | sendTestMessage: function (message, args) {
59 | var xhr = new XMLHttpRequest();
60 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
61 | var body = JSON.stringify({ message: message, args: args });
62 | console.log("Sending test message body: " + body);
63 |
64 | xhr.setRequestHeader("Content-type", "application/json");
65 |
66 | xhr.send(body);
67 | }
68 | };
69 |
70 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioInstallOnResumeWithRevert.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | app.checkForUpdates();
12 | },
13 | // Update DOM on a Received Event
14 | receivedDeviceReady: function () {
15 | document.getElementById("deviceready").innerText = "Device is ready (scenario - install on next resume)";
16 | console.log('Received Event: deviceready');
17 | },
18 | checkForUpdates: function () {
19 | console.log("Checking for updates...");
20 | window.codePush.checkForUpdate(app.checkSuccess, app.checkError);
21 | },
22 | checkSuccess: function (remotePackage) {
23 | if (!remotePackage) {
24 | // A null remotePackage means that the server successfully responded, but there is no update available.
25 | console.log("The application is up to date.");
26 | app.sendTestMessage("CHECK_UP_TO_DATE");
27 | }
28 | else {
29 | if (remotePackage.failedInstall) {
30 | app.sendTestMessage("UPDATE_FAILED_PREVIOUSLY");
31 | } else {
32 | console.log("There is an update available. Remote package:" + JSON.stringify(remotePackage));
33 | console.log("Downloading package...");
34 | remotePackage.download(app.downloadSuccess, app.downloadError);
35 | }
36 | }
37 | },
38 | checkError: function (error) {
39 | console.log("An error occured while checking for updates.");
40 | app.sendTestMessage("CHECK_ERROR");
41 | },
42 | downloadSuccess: function (localPackage) {
43 | console.log("Download succeeded.");
44 | localPackage.install(app.installSuccess, app.installError, { installMode: InstallMode.ON_NEXT_RESUME });
45 | },
46 | downloadError: function (error) {
47 | console.log("Download error.");
48 | app.sendTestMessage("DOWNLOAD_ERROR");
49 | },
50 | installSuccess: function () {
51 | console.log("Update installed.");
52 | app.sendTestMessage("UPDATE_INSTALLED");
53 | },
54 | installError: function (error) {
55 | console.log("Install error.");
56 | app.sendTestMessage("INSTALL_ERROR");
57 | },
58 | sendTestMessage: function (message, args) {
59 | var xhr = new XMLHttpRequest();
60 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
61 | var body = JSON.stringify({ message: message, args: args });
62 | console.log("Sending test message body: " + body);
63 |
64 | xhr.setRequestHeader("Content-type", "application/json");
65 |
66 | xhr.send(body);
67 | }
68 | };
69 |
70 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSetup.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - setup)";
15 | console.log('Received Event: deviceready');
16 | }
17 | };
18 |
19 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSync.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | app.sendTestMessage("SYNC_STATUS", [status]);
20 | },
21 | {
22 | installMode: InstallMode.IMMEDIATE
23 | });
24 | },
25 | sendTestMessage: function (message, args) {
26 | var xhr = new XMLHttpRequest();
27 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
28 | var body = JSON.stringify({ message: message, args: args });
29 | console.log("Sending test message body: " + body);
30 |
31 | xhr.setRequestHeader("Content-type", "application/json");
32 | xhr.send(body);
33 | }
34 | };
35 |
36 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSync2x.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync 2x)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | app.sendTestMessage("SYNC_STATUS", [status]);
20 | },
21 | {
22 | installMode: InstallMode.IMMEDIATE
23 | });
24 | /* Only send the sync status of the second sync as a test message */
25 | window.codePush.sync(
26 | function (status) {
27 | app.sendTestMessage("SYNC_STATUS", [status]);
28 | },
29 | {
30 | installMode: InstallMode.IMMEDIATE
31 | });
32 | },
33 | sendTestMessage: function (message, args) {
34 | var xhr = new XMLHttpRequest();
35 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
36 | var body = JSON.stringify({ message: message, args: args });
37 | console.log("Sending test message body: " + body);
38 |
39 | xhr.setRequestHeader("Content-type", "application/json");
40 | xhr.send(body);
41 | }
42 | };
43 |
44 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncMandatoryDefault.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync mandatory)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | switch(status) {
20 | case SyncStatus.UP_TO_DATE:
21 | case SyncStatus.UPDATE_INSTALLED:
22 | case SyncStatus.UPDATE_IGNORED:
23 | case SyncStatus.ERROR:
24 | case SyncStatus.IN_PROGRESS:
25 | app.sendTestMessage("SYNC_STATUS", [status]);
26 | default:
27 | break;
28 | }
29 | },
30 | {
31 | installMode: InstallMode.ON_NEXT_RESTART
32 | });
33 | },
34 | sendTestMessage: function (message, args) {
35 | var xhr = new XMLHttpRequest();
36 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
37 | var body = JSON.stringify({ message: message, args: args });
38 | console.log("Sending test message body: " + body);
39 |
40 | xhr.setRequestHeader("Content-type", "application/json");
41 | xhr.send(body);
42 | }
43 | };
44 |
45 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncMandatoryRestart.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync mandatory)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | switch(status) {
20 | case SyncStatus.UP_TO_DATE:
21 | case SyncStatus.UPDATE_INSTALLED:
22 | case SyncStatus.UPDATE_IGNORED:
23 | case SyncStatus.ERROR:
24 | case SyncStatus.IN_PROGRESS:
25 | app.sendTestMessage("SYNC_STATUS", [status]);
26 | default:
27 | break;
28 | }
29 | },
30 | {
31 | installMode: InstallMode.IMMEDIATE,
32 | mandatoryInstallMode: InstallMode.ON_NEXT_RESTART
33 | });
34 | },
35 | sendTestMessage: function (message, args) {
36 | var xhr = new XMLHttpRequest();
37 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
38 | var body = JSON.stringify({ message: message, args: args });
39 | console.log("Sending test message body: " + body);
40 |
41 | xhr.setRequestHeader("Content-type", "application/json");
42 | xhr.send(body);
43 | }
44 | };
45 |
46 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncMandatoryResume.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync mandatory)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | switch(status) {
20 | case SyncStatus.UP_TO_DATE:
21 | case SyncStatus.UPDATE_INSTALLED:
22 | case SyncStatus.UPDATE_IGNORED:
23 | case SyncStatus.ERROR:
24 | case SyncStatus.IN_PROGRESS:
25 | app.sendTestMessage("SYNC_STATUS", [status]);
26 | default:
27 | break;
28 | }
29 | },
30 | {
31 | installMode: InstallMode.ON_NEXT_RESTART,
32 | mandatoryInstallMode: InstallMode.ON_NEXT_RESUME
33 | });
34 | },
35 | sendTestMessage: function (message, args) {
36 | var xhr = new XMLHttpRequest();
37 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
38 | var body = JSON.stringify({ message: message, args: args });
39 | console.log("Sending test message body: " + body);
40 |
41 | xhr.setRequestHeader("Content-type", "application/json");
42 | xhr.send(body);
43 | }
44 | };
45 |
46 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncRestartDelay.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync on restart with minbackdur)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | // only output result statuses
20 | switch(status) {
21 | case SyncStatus.UP_TO_DATE:
22 | case SyncStatus.UPDATE_INSTALLED:
23 | case SyncStatus.UPDATE_IGNORED:
24 | case SyncStatus.ERROR:
25 | case SyncStatus.IN_PROGRESS:
26 | app.sendTestMessage("SYNC_STATUS", [status]);
27 | default:
28 | break;
29 | }
30 | },
31 | {
32 | installMode: InstallMode.ON_NEXT_RESTART,
33 | minimumBackgroundDuration: 15
34 | });
35 | },
36 | sendTestMessage: function (message, args) {
37 | var xhr = new XMLHttpRequest();
38 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
39 | var body = JSON.stringify({ message: message, args: args });
40 | console.log("Sending test message body: " + body);
41 |
42 | xhr.setRequestHeader("Content-type", "application/json");
43 | xhr.send(body);
44 | }
45 | };
46 |
47 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncResume.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync on resume with no minbackdur)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | // only output result statuses
20 | switch(status) {
21 | case SyncStatus.UP_TO_DATE:
22 | case SyncStatus.UPDATE_INSTALLED:
23 | case SyncStatus.UPDATE_IGNORED:
24 | case SyncStatus.ERROR:
25 | case SyncStatus.IN_PROGRESS:
26 | app.sendTestMessage("SYNC_STATUS", [status]);
27 | default:
28 | break;
29 | }
30 | },
31 | {
32 | installMode: InstallMode.ON_NEXT_RESUME
33 | });
34 | },
35 | sendTestMessage: function (message, args) {
36 | var xhr = new XMLHttpRequest();
37 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
38 | var body = JSON.stringify({ message: message, args: args });
39 | console.log("Sending test message body: " + body);
40 |
41 | xhr.setRequestHeader("Content-type", "application/json");
42 | xhr.send(body);
43 | }
44 | };
45 |
46 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/scenarioSyncResumeDelay.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - sync on resume with minbackdur)";
15 | console.log('Received Event: deviceready');
16 | /* invoke sync with no UI options */
17 | window.codePush.sync(
18 | function (status) {
19 | // only output result statuses
20 | switch(status) {
21 | case SyncStatus.UP_TO_DATE:
22 | case SyncStatus.UPDATE_INSTALLED:
23 | case SyncStatus.UPDATE_IGNORED:
24 | case SyncStatus.ERROR:
25 | case SyncStatus.IN_PROGRESS:
26 | app.sendTestMessage("SYNC_STATUS", [status]);
27 | default:
28 | break;
29 | }
30 | },
31 | {
32 | installMode: InstallMode.ON_NEXT_RESUME,
33 | minimumBackgroundDuration: 5
34 | });
35 | },
36 | sendTestMessage: function (message, args) {
37 | var xhr = new XMLHttpRequest();
38 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
39 | var body = JSON.stringify({ message: message, args: args });
40 | console.log("Sending test message body: " + body);
41 |
42 | xhr.setRequestHeader("Content-type", "application/json");
43 | xhr.send(body);
44 | }
45 | };
46 |
47 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/updateDeviceReady.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - updateDeviceReady)";
15 | console.log('Received Event: deviceready');
16 | app.sendTestMessage("DEVICE_READY_AFTER_UPDATE");
17 | },
18 | sendTestMessage: function (message, args) {
19 | var xhr = new XMLHttpRequest();
20 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
21 | var body = JSON.stringify({ message: message, args: args });
22 | console.log("Sending test message body: " + body);
23 |
24 | xhr.setRequestHeader("Content-type", "application/json");
25 |
26 | xhr.send(body);
27 | }
28 | };
29 |
30 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/updateNotifyApplicationReady.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - updateNotifyApplicationReady)";
15 | console.log('Received Event: deviceready');
16 | app.sendTestMessage("DEVICE_READY_AFTER_UPDATE");
17 |
18 | var notifySucceeded = function () {
19 | app.sendTestMessage("NOTIFY_APP_READY_SUCCESS");
20 | };
21 |
22 | var notifyFailed = function () {
23 | app.sendTestMessage("NOTIFY_APP_READY_FAILURE");
24 | };
25 |
26 | window.codePush.notifyApplicationReady(notifySucceeded, notifyFailed);
27 | },
28 | sendTestMessage: function (message, args) {
29 | var xhr = new XMLHttpRequest();
30 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
31 | var body = JSON.stringify({ message: message, args: args });
32 | console.log("Sending test message body: " + body);
33 |
34 | xhr.setRequestHeader("Content-type", "application/json");
35 |
36 | xhr.send(body);
37 | }
38 | };
39 |
40 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/updateSync.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - update sync)";
15 | console.log('Received Event: deviceready');
16 | app.sendTestMessage("DEVICE_READY_AFTER_UPDATE");
17 | /* invoke sync with UI options such that the update will not be installed */
18 | window.codePush.sync();
19 | },
20 | sendTestMessage: function (message, args) {
21 | var xhr = new XMLHttpRequest();
22 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
23 | var body = JSON.stringify({ message: message, args: args });
24 | console.log("Sending test message body: " + body);
25 |
26 | xhr.setRequestHeader("Content-type", "application/json");
27 | xhr.send(body);
28 | }
29 | };
30 |
31 | app.initialize();
--------------------------------------------------------------------------------
/test/template/www/js/updateSync2x.js:
--------------------------------------------------------------------------------
1 | var app = {
2 | // Application Constructor
3 | initialize: function () {
4 | this.bindEvents();
5 | },
6 | bindEvents: function () {
7 | document.addEventListener('deviceready', this.onDeviceReady, false);
8 | },
9 | onDeviceReady: function () {
10 | app.receivedDeviceReady();
11 | },
12 | // Update DOM on a Received Event
13 | receivedDeviceReady: function () {
14 | document.getElementById("deviceready").innerText = "Device is ready (scenario - update sync 2x)";
15 | console.log('Received Event: deviceready');
16 | app.sendTestMessage("DEVICE_READY_AFTER_UPDATE");
17 | /* invoke sync with UI options such that the update will not be installed */
18 | window.codePush.sync();
19 | window.codePush.sync(
20 | function (status) {
21 | app.sendTestMessage("SYNC_STATUS", [status]);
22 | });
23 | },
24 | sendTestMessage: function (message, args) {
25 | var xhr = new XMLHttpRequest();
26 | xhr.open("POST", "CODE_PUSH_SERVER_URL/reportTestMessage", false);
27 | var body = JSON.stringify({ message: message, args: args });
28 | console.log("Sending test message body: " + body);
29 |
30 | xhr.setRequestHeader("Content-type", "application/json");
31 | xhr.send(body);
32 | }
33 | };
34 |
35 | app.initialize();
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "esModuleInterop": true,
5 | "lib": [
6 | "dom",
7 | "es2015"
8 | ],
9 | "module": "es2015",
10 | "moduleResolution": "node",
11 | "noFallthroughCasesInSwitch": true,
12 | "outDir": "dist/esm",
13 | "pretty": true,
14 | "sourceMap": true,
15 | "target": "es2015"
16 | },
17 | "files": [
18 | "src/index.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "class-name": true,
4 | "comment-format": [
5 | true,
6 | "check-space"
7 | ],
8 | "indent": [
9 | true,
10 | "spaces"
11 | ],
12 | "one-line": [
13 | true,
14 | "check-open-brace"
15 | ],
16 | "quotemark": [
17 | true,
18 | "double"
19 | ],
20 | "semicolon": true,
21 | "whitespace": [
22 | true,
23 | "check-branch",
24 | "check-operator",
25 | "check-separator",
26 | "check-type"
27 | ],
28 | "strict-null-checks": false,
29 | "typedef-whitespace": [
30 | true,
31 | {
32 | "call-signature": "nospace",
33 | "index-signature": "nospace",
34 | "parameter": "nospace",
35 | "property-declaration": "nospace",
36 | "variable-declaration": "nospace"
37 | },
38 | {
39 | "call-signature": "onespace",
40 | "index-signature": "onespace",
41 | "parameter": "onespace",
42 | "property-declaration": "onespace",
43 | "variable-declaration": "onespace"
44 | }
45 | ]
46 | }
47 | }
--------------------------------------------------------------------------------
/typings/replace.d.ts:
--------------------------------------------------------------------------------
1 | interface ReplaceOptions {
2 | regex: string;
3 | replacement: string;
4 | paths: Array;
5 | recursive: boolean;
6 | silent: boolean;
7 | }
8 |
9 | declare module "replace" {
10 | function replace(options: ReplaceOptions): void;
11 |
12 | export = replace;
13 | }
--------------------------------------------------------------------------------