├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── demo
├── .gitignore
├── app
│ ├── App_Resources
│ │ ├── Android
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── app.gradle
│ │ │ ├── before-plugins.gradle
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── drawable-ldpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── drawable-nodpi
│ │ │ │ └── splash_screen.xml
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── background.png
│ │ │ │ ├── icon.png
│ │ │ │ └── logo.png
│ │ │ ├── values-v21
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ └── iOS
│ │ │ ├── Assets.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── icon-1024.png
│ │ │ │ ├── icon-29.png
│ │ │ │ ├── icon-29@2x.png
│ │ │ │ ├── icon-29@3x.png
│ │ │ │ ├── icon-40.png
│ │ │ │ ├── icon-40@2x.png
│ │ │ │ ├── icon-40@3x.png
│ │ │ │ ├── icon-60@2x.png
│ │ │ │ ├── icon-60@3x.png
│ │ │ │ ├── icon-76.png
│ │ │ │ ├── icon-76@2x.png
│ │ │ │ └── icon-83.5@2x.png
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.launchimage
│ │ │ │ ├── Contents.json
│ │ │ │ ├── Default-1125h.png
│ │ │ │ ├── Default-568h@2x.png
│ │ │ │ ├── Default-667h@2x.png
│ │ │ │ ├── Default-736h@3x.png
│ │ │ │ ├── Default-Landscape-X.png
│ │ │ │ ├── Default-Landscape.png
│ │ │ │ ├── Default-Landscape@2x.png
│ │ │ │ ├── Default-Landscape@3x.png
│ │ │ │ ├── Default-Portrait.png
│ │ │ │ ├── Default-Portrait@2x.png
│ │ │ │ ├── Default.png
│ │ │ │ └── Default@2x.png
│ │ │ ├── LaunchScreen.AspectFill.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-AspectFill.png
│ │ │ │ └── LaunchScreen-AspectFill@2x.png
│ │ │ └── LaunchScreen.Center.imageset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── LaunchScreen-Center.png
│ │ │ │ └── LaunchScreen-Center@2x.png
│ │ │ ├── Info.plist
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── build.xcconfig
│ ├── app-root.xml
│ ├── app.css
│ ├── app.js
│ ├── bundle-config.js
│ ├── image.json
│ ├── main-page.js
│ ├── main-page.xml
│ ├── main-view-model.js
│ ├── package.json
│ └── references.d.ts
├── nsconfig.json
└── package.json
├── publish
├── pack.sh
├── package.json
└── publish.sh
└── src
├── .npmignore
├── .npmrc
├── index.android.js
├── index.ios.js
├── lib
└── hooks
│ ├── after-prepare.js
│ ├── before-buildAndroidPlugin.js
│ └── before-prepare.js
├── package.json
├── platforms-cache
├── android
│ ├── .gradle
│ │ └── 4.3
│ │ │ ├── fileChanges
│ │ │ └── last-build.bin
│ │ │ └── fileHashes
│ │ │ ├── fileHashes.bin
│ │ │ └── fileHashes.lock
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.buildship.core.prefs
│ ├── build.gradle
│ └── java
│ │ ├── AuthenticationToken.java
│ │ ├── BuildHelper.java
│ │ ├── CallbackContext.java
│ │ ├── CallbackMap.java
│ │ ├── Config.java
│ │ ├── ConfigXmlParser.java
│ │ ├── CordovaActivity.java
│ │ ├── CordovaArgs.java
│ │ ├── CordovaBridge.java
│ │ ├── CordovaClientCertRequest.java
│ │ ├── CordovaDialogsHelper.java
│ │ ├── CordovaHttpAuthHandler.java
│ │ ├── CordovaInterface.java
│ │ ├── CordovaInterfaceImpl.java
│ │ ├── CordovaPlugin.java
│ │ ├── CordovaPluginManager.java
│ │ ├── CordovaPreferences.java
│ │ ├── CordovaResourceApi.java
│ │ ├── CordovaWebView.java
│ │ ├── CordovaWebViewEngine.java
│ │ ├── CordovaWebViewImpl.java
│ │ ├── CoreAndroid.java
│ │ ├── ExposedJsApi.java
│ │ ├── ICordovaClientCertRequest.java
│ │ ├── ICordovaCookieManager.java
│ │ ├── ICordovaHttpAuthHandler.java
│ │ ├── LOG.java
│ │ ├── NativeScriptCordovaInterface.java
│ │ ├── NativeToJsMessageQueue.java
│ │ ├── NativescriptCordovaBridge.java
│ │ ├── PermissionHelper.java
│ │ ├── PluginEntry.java
│ │ ├── PluginManager.java
│ │ ├── PluginResult.java
│ │ ├── ResumeCallback.java
│ │ ├── Whitelist.java
│ │ └── engine
│ │ ├── SystemCookieManager.java
│ │ ├── SystemExposedJsApi.java
│ │ ├── SystemWebChromeClient.java
│ │ ├── SystemWebView.java
│ │ ├── SystemWebViewClient.java
│ │ └── SystemWebViewEngine.java
└── ios
│ └── src
│ ├── Cordova
│ ├── CDV.h
│ ├── CDVAppDelegate.h
│ ├── CDVAppDelegate.m
│ ├── CDVAvailability.h
│ ├── CDVCommandDelegate.h
│ ├── CDVCommandDelegateImpl.h
│ ├── CDVCommandDelegateImpl.m
│ ├── CDVCommandQueue.h
│ ├── CDVCommandQueue.m
│ ├── CDVConfigParser.h
│ ├── CDVConfigParser.m
│ ├── CDVDebug.h
│ ├── CDVInvokedUrlCommand.h
│ ├── CDVInvokedUrlCommand.m
│ ├── CDVJSON_private.h
│ ├── CDVJSON_private.m
│ ├── CDVLocalStorage
│ │ ├── CDVLocalStorage.h
│ │ └── CDVLocalStorage.m
│ ├── CDVLogger
│ │ ├── CDVLogger.h
│ │ └── CDVLogger.m
│ ├── CDVPlugin+Private.h
│ ├── CDVPlugin.h
│ ├── CDVPlugin.m
│ ├── CDVPluginResult.h
│ ├── CDVPluginResult.m
│ ├── CDVScreenOrientationDelegate.h
│ ├── CDVTimer.h
│ ├── CDVTimer.m
│ ├── CDVUserAgentUtil.h
│ ├── CDVUserAgentUtil.m
│ ├── CDVViewController.h
│ ├── CDVViewController.m
│ ├── CDVWebViewEngineProtocol.h
│ ├── NSDictionary+CordovaPreferences.h
│ ├── NSDictionary+CordovaPreferences.m
│ ├── NSMutableArray+QueueAdditions.h
│ ├── NSMutableArray+QueueAdditions.m
│ ├── UIResponder+CordovaAppDelegateProperties.h
│ ├── UIResponder+CordovaAppDelegateProperties.m
│ ├── UIViewController+TopMostController.h
│ └── UIViewController+TopMostController.m
│ └── module.modulemap
├── postinstall.js
└── preuninstall.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = false
3 |
4 | [*.js]
5 | indent_style = space
6 | indent_size = 4
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | package-lock.json
3 | package/
4 |
--------------------------------------------------------------------------------
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | hooks
3 | platforms
4 | package-lock.json
5 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/app.gradle:
--------------------------------------------------------------------------------
1 | // Add your native dependencies here:
2 |
3 | // Uncomment to add recyclerview-v7 dependency
4 | //dependencies {
5 | // compile 'com.android.support:recyclerview-v7:+'
6 | //}
7 |
8 | android {
9 | defaultConfig {
10 | generatedDensities = []
11 | applicationId = "org.nativescript.cdvNativeTest"
12 | multiDexEnabled true
13 |
14 | //override supported platforms
15 | // ndk {
16 | // abiFilters.clear()
17 | // abiFilters "armeabi-v7a"
18 | // }
19 |
20 | }
21 | aaptOptions {
22 | additionalParameters "--no-version-vectors"
23 | }
24 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/before-plugins.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | supportVersion = "28+"
3 | }
4 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-hdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-hdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-hdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-hdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-ldpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-ldpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-ldpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-ldpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-ldpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-ldpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-mdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-mdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-mdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-mdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-mdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-nodpi/splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 | -
3 |
4 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxxhdpi/background.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxxhdpi/icon.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/Android/drawable-xxxhdpi/logo.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/values-v21/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3d5afe
4 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
11 |
14 |
15 |
16 |
19 |
20 |
23 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F5F5F5
4 | #757575
5 | #33B5E5
6 | #272734
7 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/Android/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
21 |
22 |
23 |
31 |
32 |
34 |
35 |
36 |
42 |
43 |
45 |
46 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "29x29",
5 | "idiom" : "iphone",
6 | "filename" : "icon-29.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "29x29",
11 | "idiom" : "iphone",
12 | "filename" : "icon-29@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "icon-29@3x.png",
19 | "scale" : "3x"
20 | },
21 | {
22 | "size" : "40x40",
23 | "idiom" : "iphone",
24 | "filename" : "icon-40@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "40x40",
29 | "idiom" : "iphone",
30 | "filename" : "icon-40@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "60x60",
35 | "idiom" : "iphone",
36 | "filename" : "icon-60@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "60x60",
41 | "idiom" : "iphone",
42 | "filename" : "icon-60@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "29x29",
47 | "idiom" : "ipad",
48 | "filename" : "icon-29.png",
49 | "scale" : "1x"
50 | },
51 | {
52 | "size" : "29x29",
53 | "idiom" : "ipad",
54 | "filename" : "icon-29@2x.png",
55 | "scale" : "2x"
56 | },
57 | {
58 | "size" : "40x40",
59 | "idiom" : "ipad",
60 | "filename" : "icon-40.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "40x40",
65 | "idiom" : "ipad",
66 | "filename" : "icon-40@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "76x76",
71 | "idiom" : "ipad",
72 | "filename" : "icon-76.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "76x76",
77 | "idiom" : "ipad",
78 | "filename" : "icon-76@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "83.5x83.5",
83 | "idiom" : "ipad",
84 | "filename" : "icon-83.5@2x.png",
85 | "scale" : "2x"
86 | },
87 | {
88 | "size" : "1024x1024",
89 | "idiom" : "ios-marketing",
90 | "filename" : "icon-1024.png",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "extent" : "full-screen",
5 | "idiom" : "iphone",
6 | "subtype" : "2436h",
7 | "filename" : "Default-1125h.png",
8 | "minimum-system-version" : "11.0",
9 | "orientation" : "portrait",
10 | "scale" : "3x"
11 | },
12 | {
13 | "orientation" : "landscape",
14 | "idiom" : "iphone",
15 | "extent" : "full-screen",
16 | "filename" : "Default-Landscape-X.png",
17 | "minimum-system-version" : "11.0",
18 | "subtype" : "2436h",
19 | "scale" : "3x"
20 | },
21 | {
22 | "extent" : "full-screen",
23 | "idiom" : "iphone",
24 | "subtype" : "736h",
25 | "filename" : "Default-736h@3x.png",
26 | "minimum-system-version" : "8.0",
27 | "orientation" : "portrait",
28 | "scale" : "3x"
29 | },
30 | {
31 | "extent" : "full-screen",
32 | "idiom" : "iphone",
33 | "subtype" : "736h",
34 | "filename" : "Default-Landscape@3x.png",
35 | "minimum-system-version" : "8.0",
36 | "orientation" : "landscape",
37 | "scale" : "3x"
38 | },
39 | {
40 | "extent" : "full-screen",
41 | "idiom" : "iphone",
42 | "subtype" : "667h",
43 | "filename" : "Default-667h@2x.png",
44 | "minimum-system-version" : "8.0",
45 | "orientation" : "portrait",
46 | "scale" : "2x"
47 | },
48 | {
49 | "orientation" : "portrait",
50 | "idiom" : "iphone",
51 | "filename" : "Default@2x.png",
52 | "extent" : "full-screen",
53 | "minimum-system-version" : "7.0",
54 | "scale" : "2x"
55 | },
56 | {
57 | "extent" : "full-screen",
58 | "idiom" : "iphone",
59 | "subtype" : "retina4",
60 | "filename" : "Default-568h@2x.png",
61 | "minimum-system-version" : "7.0",
62 | "orientation" : "portrait",
63 | "scale" : "2x"
64 | },
65 | {
66 | "orientation" : "portrait",
67 | "idiom" : "ipad",
68 | "filename" : "Default-Portrait.png",
69 | "extent" : "full-screen",
70 | "minimum-system-version" : "7.0",
71 | "scale" : "1x"
72 | },
73 | {
74 | "orientation" : "landscape",
75 | "idiom" : "ipad",
76 | "filename" : "Default-Landscape.png",
77 | "extent" : "full-screen",
78 | "minimum-system-version" : "7.0",
79 | "scale" : "1x"
80 | },
81 | {
82 | "orientation" : "portrait",
83 | "idiom" : "ipad",
84 | "filename" : "Default-Portrait@2x.png",
85 | "extent" : "full-screen",
86 | "minimum-system-version" : "7.0",
87 | "scale" : "2x"
88 | },
89 | {
90 | "orientation" : "landscape",
91 | "idiom" : "ipad",
92 | "filename" : "Default-Landscape@2x.png",
93 | "extent" : "full-screen",
94 | "minimum-system-version" : "7.0",
95 | "scale" : "2x"
96 | },
97 | {
98 | "orientation" : "portrait",
99 | "idiom" : "iphone",
100 | "filename" : "Default.png",
101 | "extent" : "full-screen",
102 | "scale" : "1x"
103 | },
104 | {
105 | "orientation" : "portrait",
106 | "idiom" : "iphone",
107 | "filename" : "Default@2x.png",
108 | "extent" : "full-screen",
109 | "scale" : "2x"
110 | },
111 | {
112 | "orientation" : "portrait",
113 | "idiom" : "iphone",
114 | "filename" : "Default-568h@2x.png",
115 | "extent" : "full-screen",
116 | "subtype" : "retina4",
117 | "scale" : "2x"
118 | },
119 | {
120 | "orientation" : "portrait",
121 | "idiom" : "ipad",
122 | "extent" : "to-status-bar",
123 | "scale" : "1x"
124 | },
125 | {
126 | "orientation" : "portrait",
127 | "idiom" : "ipad",
128 | "filename" : "Default-Portrait.png",
129 | "extent" : "full-screen",
130 | "scale" : "1x"
131 | },
132 | {
133 | "orientation" : "landscape",
134 | "idiom" : "ipad",
135 | "extent" : "to-status-bar",
136 | "scale" : "1x"
137 | },
138 | {
139 | "orientation" : "landscape",
140 | "idiom" : "ipad",
141 | "filename" : "Default-Landscape.png",
142 | "extent" : "full-screen",
143 | "scale" : "1x"
144 | },
145 | {
146 | "orientation" : "portrait",
147 | "idiom" : "ipad",
148 | "extent" : "to-status-bar",
149 | "scale" : "2x"
150 | },
151 | {
152 | "orientation" : "portrait",
153 | "idiom" : "ipad",
154 | "filename" : "Default-Portrait@2x.png",
155 | "extent" : "full-screen",
156 | "scale" : "2x"
157 | },
158 | {
159 | "orientation" : "landscape",
160 | "idiom" : "ipad",
161 | "extent" : "to-status-bar",
162 | "scale" : "2x"
163 | },
164 | {
165 | "orientation" : "landscape",
166 | "idiom" : "ipad",
167 | "filename" : "Default-Landscape@2x.png",
168 | "extent" : "full-screen",
169 | "scale" : "2x"
170 | }
171 | ],
172 | "info" : {
173 | "version" : 1,
174 | "author" : "xcode"
175 | }
176 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-1125h.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-667h@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-736h@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-X.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape@3x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-AspectFill.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-AspectFill@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchScreen-Center.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchScreen-Center@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/demo/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiresFullScreen
28 |
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UISupportedInterfaceOrientations~ipad
40 |
41 | UIInterfaceOrientationPortrait
42 | UIInterfaceOrientationPortraitUpsideDown
43 | UIInterfaceOrientationLandscapeLeft
44 | UIInterfaceOrientationLandscapeRight
45 |
46 | NSCameraUsageDescription
47 | "Scan barcodes?"
48 |
49 |
50 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/demo/app/App_Resources/iOS/build.xcconfig:
--------------------------------------------------------------------------------
1 | // You can add custom settings here
2 | // for example you can uncomment the following line to force distribution code signing
3 | // CODE_SIGN_IDENTITY = iPhone Distribution
4 | // To build for device with Xcode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html
5 | // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
8 | ADDITIONAL_CORDOVA_LDFLAGS = -framework AudioToolbox -lsqlite3 -lz
9 |
10 | OTHER_CPLUSPLUSFLAGS = $(inherited) -Wno-invalid-partial-specialization
11 |
--------------------------------------------------------------------------------
/demo/app/app-root.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/demo/app/app.css:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.css file is where you place CSS rules that
3 | you would like to apply to your entire application. Check out
4 | http://docs.nativescript.org/ui/styling for a full list of the CSS
5 | selectors and properties you can use to style UI components.
6 |
7 | /*
8 | In many cases you may want to use the NativeScript core theme instead
9 | of writing your own CSS rules. For a full list of class names in the theme
10 | refer to http://docs.nativescript.org/ui/theme.
11 | The imported CSS rules must precede all other types of rules.
12 | */
13 | @import '~nativescript-theme-core/css/core.light.css';
14 |
15 | /*
16 | The following CSS rule changes the font size of all UI
17 | components that have the btn class name.
18 | */
19 | .btn {
20 | font-size: 18;
21 | }
22 |
--------------------------------------------------------------------------------
/demo/app/app.js:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, the app.js file is the entry point to your application.
3 | You can use this file to perform app-level initialization, but the primary
4 | purpose of the file is to pass control to the app’s first module.
5 | */
6 |
7 | require("./bundle-config");
8 | var application = require("application");
9 |
10 | application.run({ moduleName: "app-root" });
11 |
12 | /*
13 | Do not place any code after the application has been started as it will not
14 | be executed on iOS.
15 | */
16 |
--------------------------------------------------------------------------------
/demo/app/bundle-config.js:
--------------------------------------------------------------------------------
1 | if (global.TNS_WEBPACK) {
2 | // Register tns-core-modules UI framework modules
3 | require("bundle-entry-points");
4 |
5 | // Register application modules
6 | // This will register each `root`, `page`, `fragment` postfixed xml, css, js, ts, scss file in the app/ folder
7 | const context = require.context("~/", true, /(root|page|fragment)\.(xml|css|js|ts|scss|less|sass)$/);
8 | global.registerWebpackModules(context);
9 | }
10 |
--------------------------------------------------------------------------------
/demo/app/main-page.js:
--------------------------------------------------------------------------------
1 | /*
2 | In NativeScript, a file with the same name as an XML file is known as
3 | a code-behind file. The code-behind is a great place to place your view
4 | logic, and to set up your page’s data binding.
5 | */
6 |
7 | /*
8 | NativeScript adheres to the CommonJS specification for dealing with
9 | JavaScript modules. The CommonJS require() function is how you import
10 | JavaScript modules defined in other files.
11 | */
12 | var createViewModel = require("./main-view-model").createViewModel;
13 |
14 | function onNavigatingTo(args) {
15 | /*
16 | This gets a reference this page’s UI component. You can
17 | view the API reference of the Page to see what’s available at
18 | https://docs.nativescript.org/api-reference/classes/_ui_page_.page.html
19 | */
20 | var page = args.object;
21 |
22 | /*
23 | A page’s bindingContext is an object that should be used to perform
24 | data binding between XML markup and JavaScript code. Properties
25 | on the bindingContext can be accessed using the {{ }} syntax in XML.
26 | In this example, the {{ message }} and {{ onTap }} bindings are resolved
27 | against the object returned by createViewModel().
28 |
29 | You can learn more about data binding in NativeScript at
30 | https://docs.nativescript.org/core-concepts/data-binding.
31 | */
32 | page.bindingContext = createViewModel(args);
33 | }
34 |
35 | /*
36 | Exporting a function in a NativeScript code-behind file makes it accessible
37 | to the file’s corresponding XML file. In this case, exporting the onNavigatingTo
38 | function here makes the navigatingTo="onNavigatingTo" binding in this page’s XML
39 | file work.
40 | */
41 | exports.onNavigatingTo = onNavigatingTo;
42 |
--------------------------------------------------------------------------------
/demo/app/main-page.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
14 |
15 |
16 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/demo/app/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "android": {
3 | "v8Flags": "--expose_gc"
4 | },
5 | "main": "app.js",
6 | "name": "tns-template-hello-world",
7 | "version": "4.0.0"
8 | }
--------------------------------------------------------------------------------
/demo/app/references.d.ts:
--------------------------------------------------------------------------------
1 | /// Enable smart suggestions and completions in Visual Studio Code JavaScript projects.
2 |
--------------------------------------------------------------------------------
/demo/nsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "useLegacyWorkflow": true
3 | }
--------------------------------------------------------------------------------
/demo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "NativeScript Application",
3 | "license": "SEE LICENSE IN ",
4 | "readme": "NativeScript Application",
5 | "repository": "",
6 | "nativescript": {
7 | "id": "org.nativescript.cdvNativeTest",
8 | "cordova": {
9 | "plugin-variables": {
10 | "cordova-plugin-telerik-imagepicker": {
11 | "PHOTO_LIBRARY_USAGE_DESCRIPTION": "Pick images from gallery"
12 | },
13 | "phonegap-plugin-barcodescanner": {
14 | "CAMERA_USAGE_DESCRIPTION": "Scan barcodes"
15 | }
16 | }
17 | },
18 | "tns-ios": {
19 | "version": "5.4.0"
20 | },
21 | "tns-android": {
22 | "version": "5.4.0"
23 | }
24 | },
25 | "dependencies": {
26 | "cordova-plugin-camera": "^4.0.3",
27 | "cordova-plugin-email-composer": "^0.8.15",
28 | "cordova-plugin-telerik-imagepicker": "2.1.10",
29 | "cordova-plugin-tensorflow": "https://github.com/Mitko-Kerezov/cordova-plugin-tensorflow/archive/0.0.1-fixed.tar.gz",
30 | "cordova-plugin-x-socialsharing": "^5.4.0",
31 | "cordova-sqlite-storage": "2.3.1",
32 | "nativescript-cordova-support": "file:../src",
33 | "nativescript-theme-core": "~1.0.4",
34 | "phonegap-plugin-barcodescanner": "https://github.com/mbektchiev/phonegap-plugin-barcodescanner/archive/7.1.2-fixed.tar.gz",
35 | "tns-core-modules": "^5.4.1"
36 | },
37 | "devDependencies": {
38 | "babel-traverse": "6.4.5",
39 | "babel-types": "6.4.5",
40 | "babylon": "6.4.5",
41 | "cordova": "^8.0.0",
42 | "lazy": "1.0.11"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/publish/pack.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | SOURCE_DIR=../src;
4 | TO_SOURCE_DIR=src;
5 | PACK_DIR=package;
6 | ROOT_DIR=..;
7 | PUBLISH=--publish
8 |
9 | install(){
10 | npm i
11 | }
12 |
13 | pack() {
14 |
15 | echo 'Clearing /src and /package...'
16 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
17 | node_modules/.bin/rimraf "$PACK_DIR"
18 |
19 | # copy src
20 | echo 'Copying src...'
21 | node_modules/.bin/ncp "$SOURCE_DIR" "$TO_SOURCE_DIR"
22 |
23 | # copy README & LICENSE to src
24 | echo 'Copying README and LICENSE to /src...'
25 | node_modules/.bin/ncp "$ROOT_DIR"/LICENSE "$TO_SOURCE_DIR"/LICENSE
26 | node_modules/.bin/ncp "$ROOT_DIR"/README.md "$TO_SOURCE_DIR"/README.md
27 |
28 | echo 'Creating package...'
29 | # create package dir
30 | mkdir "$PACK_DIR"
31 |
32 | # create the package
33 | cd "$PACK_DIR"
34 | npm pack ../"$TO_SOURCE_DIR"
35 |
36 | # delete source directory used to create the package
37 | cd ..
38 | node_modules/.bin/rimraf "$TO_SOURCE_DIR"
39 | }
40 |
41 | install && pack
42 |
--------------------------------------------------------------------------------
/publish/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nativescript-publish",
3 | "version": "1.0.0",
4 | "description": "Publish helper",
5 | "devDependencies": {
6 | "ncp": "^2.0.0",
7 | "rimraf": "^2.5.0"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/publish/publish.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | PACK_DIR=package;
4 |
5 | publish() {
6 | cd $PACK_DIR
7 | echo 'Publishing to npm...'
8 | npm publish *.tgz
9 | }
10 |
11 | ./pack.sh && publish
--------------------------------------------------------------------------------
/src/.npmignore:
--------------------------------------------------------------------------------
1 | .idea
2 | demo
--------------------------------------------------------------------------------
/src/.npmrc:
--------------------------------------------------------------------------------
1 | package-lock = false
2 | bin-links = false
3 |
--------------------------------------------------------------------------------
/src/lib/hooks/after-prepare.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const rimraf = require("rimraf");
3 | const fs = require('fs');
4 |
5 | module.exports = function ($projectData, hookArgs) {
6 | const pluginPlatformsAndroid = path.join(__dirname, "..", "..", "platforms", "android");
7 | const libsPath = path.join(pluginPlatformsAndroid, "libs");
8 | const includeGradlePath = path.join(pluginPlatformsAndroid, "include.gradle");
9 |
10 | rimraf.sync(includeGradlePath);
11 | // Remove all jar dependencies as they are already included in this plugin's built .aar
12 | rimraf.sync(path.join(libsPath, "*.jar"));
13 | }
--------------------------------------------------------------------------------
/src/lib/hooks/before-buildAndroidPlugin.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const fs = require('fs');
3 | const fse = require('fs-extra')
4 |
5 | const BUILD_GRADLE_FILE_NAME = "build.gradle";
6 | const skipDirs = ["java", "res", "AndroidManifest.xml", BUILD_GRADLE_FILE_NAME];
7 |
8 | module.exports = function (hookArgs) {
9 | const pluginRoot = path.join(__dirname, "..", "..");
10 | const currentPluginPlatformsDir = path.join(pluginRoot, "platforms", "android");
11 |
12 | const pluginDir = hookArgs.pluginBuildSettings.pluginDir;
13 | const pluginDirFiles = fs.readdirSync(pluginDir);
14 | const currentPluginPlatformFiles = fs.readdirSync(currentPluginPlatformsDir);
15 | for (const currentPluginPlatformFile of currentPluginPlatformFiles) {
16 | // Do not copy file if it is amongst the skipdirs or if it is already present in the destination
17 | if (skipDirs.indexOf(currentPluginPlatformFile) !== -1 || pluginDirFiles.indexOf(currentPluginPlatformFile) !== -1) {
18 | continue;
19 | }
20 |
21 | const fullSrcPath = path.join(currentPluginPlatformsDir, currentPluginPlatformFile);
22 | const fullDestPath = path.join(pluginDir, currentPluginPlatformFile);
23 | fse.copySync(fullSrcPath, fullDestPath);
24 | }
25 |
26 | fs.appendFileSync(path.join(pluginDir, BUILD_GRADLE_FILE_NAME), '\napply from: "./include.gradle"')
27 | }
28 |
--------------------------------------------------------------------------------
/src/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.1.0",
3 | "name": "nativescript-cordova-support",
4 | "description": "This plugin enables using cordova plugins inside a nativescript project",
5 | "issue": "",
6 | "keywords": [
7 | "NativeScript",
8 | "JavaScript",
9 | "Android",
10 | "iOS",
11 | "Cordova"
12 | ],
13 | "bugs": {
14 | "url": "https://github.com/NativeScript/nativescript-cordova-support/issues"
15 | },
16 | "scripts": {
17 | "postinstall": "node postinstall.js",
18 | "preuninstall": "node preuninstall.js"
19 | },
20 | "license": "Apache-2.0",
21 | "homepage": "https://github.com/NativeScript/nativescript-cordova-support",
22 | "readmeFilename": "README.md",
23 | "nativescript": {
24 | "platforms": {
25 | "android": "4.0.0",
26 | "ios": "4.0.0"
27 | },
28 | "hooks": [
29 | {
30 | "type": "after-prepare",
31 | "script": "./lib/hooks/after-prepare.js",
32 | "inject": true
33 | },
34 | {
35 | "type": "before-prepare",
36 | "script": "./lib/hooks/before-prepare.js",
37 | "inject": true
38 | },
39 | {
40 | "type": "before-buildAndroidPlugin",
41 | "script": "./lib/hooks/before-buildAndroidPlugin.js",
42 | "inject": true
43 | }
44 | ]
45 | },
46 | "dependencies": {
47 | "fs-extra": "5.0.0",
48 | "mkdirp": "0.5.1",
49 | "nativescript-hook": "0.2.x",
50 | "rimraf": "2.6.2",
51 | "temp": "0.8.3",
52 | "xml-js": "1.6.2"
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/.gradle/4.3/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/.gradle/4.3/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/src/platforms-cache/android/.gradle/4.3/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/src/platforms-cache/android/.gradle/4.3/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NativeScript/nativescript-cordova-support/fe1bcad16d4b07e806c6f595b9502ce3999bab49/src/platforms-cache/android/.gradle/4.3/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/src/platforms-cache/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | android
4 | Project android created by Buildship.
5 |
6 |
7 |
8 |
9 | org.eclipse.buildship.core.gradleprojectbuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.buildship.core.gradleprojectnature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/.settings/org.eclipse.buildship.core.prefs:
--------------------------------------------------------------------------------
1 | #Fri May 04 14:57:41 EEST 2018
2 | connection.project.dir=
3 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/AuthenticationToken.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | /**
22 | * The Class AuthenticationToken defines the userName and password to be used for authenticating a web resource
23 | */
24 | public class AuthenticationToken {
25 | private String userName;
26 | private String password;
27 |
28 | /**
29 | * Gets the user name.
30 | *
31 | * @return the user name
32 | */
33 | public String getUserName() {
34 | return userName;
35 | }
36 |
37 | /**
38 | * Sets the user name.
39 | *
40 | * @param userName
41 | * the new user name
42 | */
43 | public void setUserName(String userName) {
44 | this.userName = userName;
45 | }
46 |
47 | /**
48 | * Gets the password.
49 | *
50 | * @return the password
51 | */
52 | public String getPassword() {
53 | return password;
54 | }
55 |
56 | /**
57 | * Sets the password.
58 | *
59 | * @param password
60 | * the new password
61 | */
62 | public void setPassword(String password) {
63 | this.password = password;
64 | }
65 |
66 |
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/BuildHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | /*
23 | * This is a utility class that allows us to get the BuildConfig variable, which is required
24 | * for the use of different providers. This is not guaranteed to work, and it's better for this
25 | * to be set in the build step in config.xml
26 | *
27 | */
28 |
29 | import android.app.Activity;
30 | import android.content.Context;
31 |
32 | import java.lang.reflect.Field;
33 |
34 |
35 | public class BuildHelper {
36 |
37 |
38 | private static String TAG="BuildHelper";
39 |
40 | /*
41 | * This needs to be implemented if you wish to use the Camera Plugin or other plugins
42 | * that read the Build Configuration.
43 | *
44 | * Thanks to Phil@Medtronic and Graham Borland for finding the answer and posting it to
45 | * StackOverflow. This is annoying as hell! However, this method does not work with
46 | * ProGuard, and you should use the config.xml to define the application_id
47 | *
48 | */
49 |
50 | public static Object getBuildConfigValue(Context ctx, String key)
51 | {
52 | try
53 | {
54 | Class> clazz = Class.forName(ctx.getPackageName() + ".BuildConfig");
55 | Field field = clazz.getField(key);
56 | return field.get(null);
57 | } catch (ClassNotFoundException e) {
58 | LOG.d(TAG, "Unable to get the BuildConfig, is this built with ANT?");
59 | e.printStackTrace();
60 | } catch (NoSuchFieldException e) {
61 | LOG.d(TAG, key + " is not a valid field. Check your build.gradle");
62 | } catch (IllegalAccessException e) {
63 | LOG.d(TAG, "Illegal Access Exception: Let's print a stack trace.");
64 | e.printStackTrace();
65 | }
66 |
67 | return null;
68 | }
69 |
70 | }
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CallbackContext.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import org.json.JSONArray;
22 |
23 | import org.apache.cordova.CordovaWebView;
24 | import org.apache.cordova.PluginResult;
25 | import org.json.JSONObject;
26 |
27 | public class CallbackContext {
28 | private static final String LOG_TAG = "CordovaPlugin";
29 |
30 | private String callbackId;
31 | private CordovaWebView webView;
32 | protected boolean finished;
33 | private int changingThreads;
34 |
35 | public CallbackContext(String callbackId, CordovaWebView webView) {
36 | this.callbackId = callbackId;
37 | this.webView = webView;
38 | }
39 |
40 | public boolean isFinished() {
41 | return finished;
42 | }
43 |
44 | public boolean isChangingThreads() {
45 | return changingThreads > 0;
46 | }
47 |
48 | public String getCallbackId() {
49 | return callbackId;
50 | }
51 |
52 | public void sendPluginResult(PluginResult pluginResult) {
53 | synchronized (this) {
54 | if (finished) {
55 | LOG.w(LOG_TAG, "Attempted to send a second callback for ID: " + callbackId + "\nResult was: " + pluginResult.getMessage());
56 | return;
57 | } else {
58 | finished = !pluginResult.getKeepCallback();
59 | }
60 | }
61 |
62 | this.webView.sendPluginResult(pluginResult, callbackId);
63 | }
64 |
65 | /**
66 | * Helper for success callbacks that just returns the Status.OK by default
67 | *
68 | * @param message The message to add to the success result.
69 | */
70 | public void success(JSONObject message) {
71 | sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
72 | }
73 |
74 | /**
75 | * Helper for success callbacks that just returns the Status.OK by default
76 | *
77 | * @param message The message to add to the success result.
78 | */
79 | public void success(String message) {
80 | sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
81 | }
82 |
83 | /**
84 | * Helper for success callbacks that just returns the Status.OK by default
85 | *
86 | * @param message The message to add to the success result.
87 | */
88 | public void success(JSONArray message) {
89 | sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
90 | }
91 |
92 | /**
93 | * Helper for success callbacks that just returns the Status.OK by default
94 | *
95 | * @param message The message to add to the success result.
96 | */
97 | public void success(byte[] message) {
98 | sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
99 | }
100 |
101 | /**
102 | * Helper for success callbacks that just returns the Status.OK by default
103 | *
104 | * @param message The message to add to the success result.
105 | */
106 | public void success(int message) {
107 | sendPluginResult(new PluginResult(PluginResult.Status.OK, message));
108 | }
109 |
110 | /**
111 | * Helper for success callbacks that just returns the Status.OK by default
112 | */
113 | public void success() {
114 | sendPluginResult(new PluginResult(PluginResult.Status.OK));
115 | }
116 |
117 | /**
118 | * Helper for error callbacks that just returns the Status.ERROR by default
119 | *
120 | * @param message The message to add to the error result.
121 | */
122 | public void error(JSONObject message) {
123 | sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
124 | }
125 |
126 | /**
127 | * Helper for error callbacks that just returns the Status.ERROR by default
128 | *
129 | * @param message The message to add to the error result.
130 | */
131 | public void error(String message) {
132 | sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
133 | }
134 |
135 | /**
136 | * Helper for error callbacks that just returns the Status.ERROR by default
137 | *
138 | * @param message The message to add to the error result.
139 | */
140 | public void error(int message) {
141 | sendPluginResult(new PluginResult(PluginResult.Status.ERROR, message));
142 | }
143 | }
144 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CallbackMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import android.util.Pair;
22 | import android.util.SparseArray;
23 |
24 | /**
25 | * Provides a collection that maps unique request codes to CordovaPlugins and Integers.
26 | * Used to ensure that when plugins make requests for runtime permissions, those requests do not
27 | * collide with requests from other plugins that use the same request code value.
28 | */
29 | public class CallbackMap {
30 | private int currentCallbackId = 0;
31 | private SparseArray> callbacks;
32 |
33 | public CallbackMap() {
34 | this.callbacks = new SparseArray>();
35 | }
36 |
37 | /**
38 | * Stores a CordovaPlugin and request code and returns a new unique request code to use
39 | * in a permission request.
40 | *
41 | * @param receiver The plugin that is making the request
42 | * @param requestCode The original request code used by the plugin
43 | * @return A unique request code that can be used to retrieve this callback
44 | * with getAndRemoveCallback()
45 | */
46 | public synchronized int registerCallback(CordovaPlugin receiver, int requestCode) {
47 | int mappedId = this.currentCallbackId++;
48 | callbacks.put(mappedId, new Pair(receiver, requestCode));
49 | return mappedId;
50 | }
51 |
52 | /**
53 | * Retrieves and removes a callback stored in the map using the mapped request code
54 | * obtained from registerCallback()
55 | *
56 | * @param mappedId The request code obtained from registerCallback()
57 | * @return The CordovaPlugin and orignal request code that correspond to the
58 | * given mappedCode
59 | */
60 | public synchronized Pair getAndRemoveCallback(int mappedId) {
61 | Pair callback = callbacks.get(mappedId);
62 | callbacks.remove(mappedId);
63 | return callback;
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/Config.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | import java.util.List;
23 |
24 | import android.app.Activity;
25 |
26 | @Deprecated // Use Whitelist, CordovaPrefences, etc. directly.
27 | public class Config {
28 | private static final String TAG = "Config";
29 |
30 | static ConfigXmlParser parser;
31 |
32 | private Config() {
33 | }
34 |
35 | public static void init(Activity action) {
36 | parser = new ConfigXmlParser();
37 | parser.parse(action);
38 | //TODO: Add feature to bring this back. Some preferences should be overridden by intents, but not all
39 | parser.getPreferences().setPreferencesBundle(action.getIntent().getExtras());
40 | }
41 |
42 | // Intended to be used for testing only; creates an empty configuration.
43 | public static void init() {
44 | if (parser == null) {
45 | parser = new ConfigXmlParser();
46 | }
47 | }
48 |
49 | public static String getStartUrl() {
50 | if (parser == null) {
51 | return "file:///android_asset/www/index.html";
52 | }
53 | return parser.getLaunchUrl();
54 | }
55 |
56 | public static String getErrorUrl() {
57 | return parser.getPreferences().getString("errorurl", null);
58 | }
59 |
60 | public static List getPluginEntries() {
61 | return parser.getPluginEntries();
62 | }
63 |
64 | public static CordovaPreferences getPreferences() {
65 | return parser.getPreferences();
66 | }
67 |
68 | public static boolean isInitialized() {
69 | return parser != null;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/ConfigXmlParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 |
20 | package org.apache.cordova;
21 |
22 | import java.io.IOException;
23 | import java.util.ArrayList;
24 | import java.util.Locale;
25 | import java.util.regex.Matcher;
26 | import java.util.regex.Pattern;
27 |
28 | import org.xmlpull.v1.XmlPullParser;
29 | import org.xmlpull.v1.XmlPullParserException;
30 |
31 | import android.content.Context;
32 |
33 | public class ConfigXmlParser {
34 | private static String TAG = "ConfigXmlParser";
35 |
36 | private String launchUrl = "file:///android_asset/www/index.html";
37 | private CordovaPreferences prefs = new CordovaPreferences();
38 | private ArrayList pluginEntries = new ArrayList(20);
39 |
40 | public CordovaPreferences getPreferences() {
41 | return prefs;
42 | }
43 |
44 | public ArrayList getPluginEntries() {
45 | return pluginEntries;
46 | }
47 |
48 | public String getLaunchUrl() {
49 | return launchUrl;
50 | }
51 |
52 | public void parse(Context action) {
53 | // First checking the class namespace for config.xml
54 | int id = action.getResources().getIdentifier("config", "xml", action.getClass().getPackage().getName());
55 | if (id == 0) {
56 | // If we couldn't find config.xml there, we'll look in the namespace from AndroidManifest.xml
57 | id = action.getResources().getIdentifier("config", "xml", action.getPackageName());
58 | if (id == 0) {
59 | LOG.e(TAG, "res/xml/config.xml is missing!");
60 | return;
61 | }
62 | }
63 | parse(action.getResources().getXml(id));
64 | }
65 |
66 | boolean insideFeature = false;
67 | String service = "", pluginClass = "", paramType = "";
68 | boolean onload = false;
69 |
70 | public void parse(XmlPullParser xml) {
71 | int eventType = -1;
72 |
73 | while (eventType != XmlPullParser.END_DOCUMENT) {
74 | if (eventType == XmlPullParser.START_TAG) {
75 | handleStartTag(xml);
76 | }
77 | else if (eventType == XmlPullParser.END_TAG)
78 | {
79 | handleEndTag(xml);
80 | }
81 | try {
82 | eventType = xml.next();
83 | } catch (XmlPullParserException e) {
84 | e.printStackTrace();
85 | } catch (IOException e) {
86 | e.printStackTrace();
87 | }
88 | }
89 | }
90 |
91 | public void handleStartTag(XmlPullParser xml) {
92 | String strNode = xml.getName();
93 | if (strNode.equals("feature")) {
94 | //Check for supported feature sets aka. plugins (Accelerometer, Geolocation, etc)
95 | //Set the bit for reading params
96 | insideFeature = true;
97 | service = xml.getAttributeValue(null, "name");
98 | }
99 | else if (insideFeature && strNode.equals("param")) {
100 | paramType = xml.getAttributeValue(null, "name");
101 | if (paramType.equals("service")) // check if it is using the older service param
102 | service = xml.getAttributeValue(null, "value");
103 | else if (paramType.equals("package") || paramType.equals("android-package"))
104 | pluginClass = xml.getAttributeValue(null,"value");
105 | else if (paramType.equals("onload"))
106 | onload = "true".equals(xml.getAttributeValue(null, "value"));
107 | }
108 | else if (strNode.equals("preference")) {
109 | String name = xml.getAttributeValue(null, "name").toLowerCase(Locale.ENGLISH);
110 | String value = xml.getAttributeValue(null, "value");
111 | prefs.set(name, value);
112 | }
113 | else if (strNode.equals("content")) {
114 | String src = xml.getAttributeValue(null, "src");
115 | if (src != null) {
116 | setStartUrl(src);
117 | }
118 | }
119 | }
120 |
121 | public void handleEndTag(XmlPullParser xml) {
122 | String strNode = xml.getName();
123 | if (strNode.equals("feature")) {
124 | pluginEntries.add(new PluginEntry(service, pluginClass, onload));
125 |
126 | service = "";
127 | pluginClass = "";
128 | insideFeature = false;
129 | onload = false;
130 | }
131 | }
132 |
133 | private void setStartUrl(String src) {
134 | Pattern schemeRegex = Pattern.compile("^[a-z-]+://");
135 | Matcher matcher = schemeRegex.matcher(src);
136 | if (matcher.find()) {
137 | launchUrl = src;
138 | } else {
139 | if (src.charAt(0) == '/') {
140 | src = src.substring(1);
141 | }
142 | launchUrl = "file:///android_asset/www/" + src;
143 | }
144 | }
145 | }
146 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CordovaArgs.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import org.json.JSONArray;
22 | import org.json.JSONException;
23 | import org.json.JSONObject;
24 |
25 | import android.util.Base64;
26 |
27 | public class CordovaArgs {
28 | private JSONArray baseArgs;
29 |
30 | public CordovaArgs(JSONArray args) {
31 | this.baseArgs = args;
32 | }
33 |
34 |
35 | // Pass through the basics to the base args.
36 | public Object get(int index) throws JSONException {
37 | return baseArgs.get(index);
38 | }
39 |
40 | public boolean getBoolean(int index) throws JSONException {
41 | return baseArgs.getBoolean(index);
42 | }
43 |
44 | public double getDouble(int index) throws JSONException {
45 | return baseArgs.getDouble(index);
46 | }
47 |
48 | public int getInt(int index) throws JSONException {
49 | return baseArgs.getInt(index);
50 | }
51 |
52 | public JSONArray getJSONArray(int index) throws JSONException {
53 | return baseArgs.getJSONArray(index);
54 | }
55 |
56 | public JSONObject getJSONObject(int index) throws JSONException {
57 | return baseArgs.getJSONObject(index);
58 | }
59 |
60 | public long getLong(int index) throws JSONException {
61 | return baseArgs.getLong(index);
62 | }
63 |
64 | public String getString(int index) throws JSONException {
65 | return baseArgs.getString(index);
66 | }
67 |
68 |
69 | public Object opt(int index) {
70 | return baseArgs.opt(index);
71 | }
72 |
73 | public boolean optBoolean(int index) {
74 | return baseArgs.optBoolean(index);
75 | }
76 |
77 | public double optDouble(int index) {
78 | return baseArgs.optDouble(index);
79 | }
80 |
81 | public int optInt(int index) {
82 | return baseArgs.optInt(index);
83 | }
84 |
85 | public JSONArray optJSONArray(int index) {
86 | return baseArgs.optJSONArray(index);
87 | }
88 |
89 | public JSONObject optJSONObject(int index) {
90 | return baseArgs.optJSONObject(index);
91 | }
92 |
93 | public long optLong(int index) {
94 | return baseArgs.optLong(index);
95 | }
96 |
97 | public String optString(int index) {
98 | return baseArgs.optString(index);
99 | }
100 |
101 | public boolean isNull(int index) {
102 | return baseArgs.isNull(index);
103 | }
104 |
105 |
106 | // The interesting custom helpers.
107 | public byte[] getArrayBuffer(int index) throws JSONException {
108 | String encoded = baseArgs.getString(index);
109 | return Base64.decode(encoded, Base64.DEFAULT);
110 | }
111 | }
112 |
113 |
114 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CordovaClientCertRequest.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import java.security.Principal;
22 | import java.security.PrivateKey;
23 | import java.security.cert.X509Certificate;
24 |
25 | import android.annotation.SuppressLint;
26 | import android.webkit.ClientCertRequest;
27 |
28 | /**
29 | * Implementation of the ICordovaClientCertRequest for Android WebView.
30 | *
31 | */
32 | public class CordovaClientCertRequest implements ICordovaClientCertRequest {
33 |
34 | private final ClientCertRequest request;
35 |
36 | public CordovaClientCertRequest(ClientCertRequest request) {
37 | this.request = request;
38 | }
39 |
40 | /**
41 | * Cancel this request
42 | */
43 | @SuppressLint("NewApi")
44 | public void cancel()
45 | {
46 | request.cancel();
47 | }
48 |
49 | /*
50 | * Returns the host name of the server requesting the certificate.
51 | */
52 | @SuppressLint("NewApi")
53 | public String getHost()
54 | {
55 | return request.getHost();
56 | }
57 |
58 | /*
59 | * Returns the acceptable types of asymmetric keys (can be null).
60 | */
61 | @SuppressLint("NewApi")
62 | public String[] getKeyTypes()
63 | {
64 | return request.getKeyTypes();
65 | }
66 |
67 | /*
68 | * Returns the port number of the server requesting the certificate.
69 | */
70 | @SuppressLint("NewApi")
71 | public int getPort()
72 | {
73 | return request.getPort();
74 | }
75 |
76 | /*
77 | * Returns the acceptable certificate issuers for the certificate matching the private key (can be null).
78 | */
79 | @SuppressLint("NewApi")
80 | public Principal[] getPrincipals()
81 | {
82 | return request.getPrincipals();
83 | }
84 |
85 | /*
86 | * Ignore the request for now. Do not remember user's choice.
87 | */
88 | @SuppressLint("NewApi")
89 | public void ignore()
90 | {
91 | request.ignore();
92 | }
93 |
94 | /*
95 | * Proceed with the specified private key and client certificate chain. Remember the user's positive choice and use it for future requests.
96 | *
97 | * @param privateKey The privateKey
98 | * @param chain The certificate chain
99 | */
100 | @SuppressLint("NewApi")
101 | public void proceed(PrivateKey privateKey, X509Certificate[] chain)
102 | {
103 | request.proceed(privateKey, chain);
104 | }
105 | }
106 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CordovaHttpAuthHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import android.webkit.HttpAuthHandler;
22 |
23 | /**
24 | * Specifies interface for HTTP auth handler object which is used to handle auth requests and
25 | * specifying user credentials.
26 | */
27 | public class CordovaHttpAuthHandler implements ICordovaHttpAuthHandler {
28 |
29 | private final HttpAuthHandler handler;
30 |
31 | public CordovaHttpAuthHandler(HttpAuthHandler handler) {
32 | this.handler = handler;
33 | }
34 |
35 | /**
36 | * Instructs the WebView to cancel the authentication request.
37 | */
38 | public void cancel () {
39 | this.handler.cancel();
40 | }
41 |
42 | /**
43 | * Instructs the WebView to proceed with the authentication with the given credentials.
44 | *
45 | * @param username
46 | * @param password
47 | */
48 | public void proceed (String username, String password) {
49 | this.handler.proceed(username, password);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CordovaInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | Licensed to the Apache Software Foundation (ASF) under one
3 | or more contributor license agreements. See the NOTICE file
4 | distributed with this work for additional information
5 | regarding copyright ownership. The ASF licenses this file
6 | to you under the Apache License, Version 2.0 (the
7 | "License"); you may not use this file except in compliance
8 | with the License. You may obtain a copy of the License at
9 |
10 | http://www.apache.org/licenses/LICENSE-2.0
11 |
12 | Unless required by applicable law or agreed to in writing,
13 | software distributed under the License is distributed on an
14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 | KIND, either express or implied. See the License for the
16 | specific language governing permissions and limitations
17 | under the License.
18 | */
19 | package org.apache.cordova;
20 |
21 | import android.app.Activity;
22 | import android.content.Context;
23 | import android.content.Intent;
24 |
25 | import org.apache.cordova.CordovaPlugin;
26 |
27 | import java.util.concurrent.ExecutorService;
28 |
29 | /**
30 | * The Activity interface that is implemented by CordovaActivity.
31 | * It is used to isolate plugin development, and remove dependency on entire Cordova library.
32 | */
33 | public interface CordovaInterface {
34 |
35 | /**
36 | * Launch an activity for which you would like a result when it finished. When this activity exits,
37 | * your onActivityResult() method will be called.
38 | *
39 | * @param command The command object
40 | * @param intent The intent to start
41 | * @param requestCode The request code that is passed to callback to identify the activity
42 | */
43 | abstract public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode);
44 |
45 | /**
46 | * Set the plugin to be called when a sub-activity exits.
47 | *
48 | * @param plugin The plugin on which onActivityResult is to be called
49 | */
50 | abstract public void setActivityResultCallback(CordovaPlugin plugin);
51 |
52 | /**
53 | * Get the Android activity.
54 | *
55 | * If a custom engine lives outside of the Activity's lifecycle the return value may be null.
56 | *
57 | * @return the Activity
58 | */
59 | public abstract Activity getActivity();
60 |
61 | /**
62 | * Get the Android context.
63 | *
64 | * @return the Context
65 | */
66 | public Context getContext();
67 |
68 | /**
69 | * Called when a message is sent to plugin.
70 | *
71 | * @param id The message id
72 | * @param data The message data
73 | * @return Object or null
74 | */
75 | public Object onMessage(String id, Object data);
76 |
77 | /**
78 | * Returns a shared thread pool that can be used for background tasks.
79 | */
80 | public ExecutorService getThreadPool();
81 |
82 | /**
83 | * Sends a permission request to the activity for one permission.
84 | */
85 | public void requestPermission(CordovaPlugin plugin, int requestCode, String permission);
86 |
87 | /**
88 | * Sends a permission request to the activity for a group of permissions
89 | */
90 | public void requestPermissions(CordovaPlugin plugin, int requestCode, String [] permissions);
91 |
92 | /**
93 | * Check for a permission. Returns true if the permission is granted, false otherwise.
94 | */
95 | public boolean hasPermission(String permission);
96 |
97 | }
98 |
--------------------------------------------------------------------------------
/src/platforms-cache/android/java/CordovaPluginManager.java:
--------------------------------------------------------------------------------
1 | package org.apache.cordova;
2 |
3 | import android.util.Log;
4 | import android.content.Intent;
5 | import java.lang.reflect.Method;
6 | import org.json.JSONArray;
7 |
8 | import android.app.Activity;
9 | import android.content.Intent;
10 | import android.os.Build;
11 | import android.content.pm.PackageManager;
12 | import java.lang.reflect.Field;
13 | import java.util.Map;
14 | import java.util.concurrent.ExecutorService;
15 | import java.util.concurrent.Executors;
16 | import java.util.HashMap;
17 | import java.lang.IllegalArgumentException;
18 | import java.io.File;
19 |
20 | public class CordovaPluginManager {
21 | private final String TAG = "CordovaPluginManager";
22 | private CordovaInterfaceImpl cordovaInterfaceImpl;
23 | private Map pluginsMap;
24 |
25 | public CordovaPluginManager() {
26 | Log.w(TAG, "Instantiated CordovaPluginManager");
27 | }
28 |
29 | public void exec(String serviceName, String actionName, JSONArray actionArgs, CallbackContext callbackContext) throws Exception {
30 | if (!this.getPluginsMap().containsKey(serviceName)) {
31 | throw new IllegalArgumentException("Key " + serviceName + " not found in plugins map. Make sure to declare it as a feature in plugin.xml");
32 | }
33 | Class> c = Class.forName(this.getPluginsMap().get(serviceName).pluginClass);
34 | Object instance = c.newInstance();
35 | Method privateInitializeMethod = instance.getClass().getMethod("privateInitialize", String.class, CordovaInterface.class, CordovaWebView.class, CordovaPreferences.class);
36 | privateInitializeMethod.invoke(instance, serviceName, this.getCordovaInterfaceImpl(), null, null);
37 | Method method = instance.getClass().getMethod("execute", String.class, JSONArray.class, CallbackContext.class);
38 | method.invoke(instance, actionName, actionArgs, callbackContext);
39 | }
40 |
41 | public void onActivityResult(int requestCode, int resultCode, Intent data) throws Exception {
42 | this.getCordovaInterfaceImpl().onActivityResult(requestCode, resultCode, data);
43 | }
44 |
45 | public CordovaInterfaceImpl getCordovaInterfaceImpl() {
46 | if (this.cordovaInterfaceImpl == null) {
47 | this.cordovaInterfaceImpl = new CordovaInterfaceImpl(this.getActivity());
48 | }
49 |
50 | return this.cordovaInterfaceImpl;
51 | }
52 |
53 | public Activity getActivity() {
54 | try {
55 | Class activityThreadClass = Class.forName("android.app.ActivityThread");
56 | Object activityThread = activityThreadClass.getMethod("currentActivityThread").invoke(null);
57 | Field activitiesField = activityThreadClass.getDeclaredField("mActivities");
58 | activitiesField.setAccessible(true);
59 |
60 | Map