capacitor-secure-storage-plugin 0.6.2 → 0.6.4-testing

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/CapacitorSecureStoragePlugin.podspec +12 -7
  2. package/README.md +2 -2
  3. package/android/build.gradle +13 -7
  4. package/android/src/main/AndroidManifest.xml +3 -5
  5. package/android/src/main/java/com/whitestein/securestorage/{SecureStoragePlugin.java → SecureStoragePluginPlugin.java} +31 -15
  6. package/android/{.gradle/5.6.4/gc.properties → src/main/res/.gitkeep} +0 -0
  7. package/dist/docs.json +93 -0
  8. package/dist/esm/definitions.js +1 -0
  9. package/dist/esm/definitions.js.map +1 -1
  10. package/dist/esm/index.js +1 -1
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/web.d.ts +2 -4
  13. package/dist/esm/web.js +15 -11
  14. package/dist/esm/web.js.map +1 -1
  15. package/dist/plugin.cjs.js +64 -0
  16. package/dist/plugin.cjs.js.map +1 -0
  17. package/dist/plugin.js +67 -0
  18. package/dist/plugin.js.map +1 -0
  19. package/ios/Plugin/{Plugin.h → SecureStoragePluginPlugin.h} +0 -0
  20. package/ios/Plugin/{Plugin.m → SecureStoragePluginPlugin.m} +0 -0
  21. package/ios/Plugin/{Plugin.swift → SecureStoragePluginPlugin.swift} +18 -9
  22. package/package.json +56 -29
  23. package/android/.gitignore +0 -72
  24. package/android/.gradle/5.6.4/executionHistory/executionHistory.bin +0 -0
  25. package/android/.gradle/5.6.4/executionHistory/executionHistory.lock +0 -0
  26. package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
  27. package/android/.gradle/5.6.4/fileContent/fileContent.lock +0 -0
  28. package/android/.gradle/5.6.4/fileHashes/fileHashes.bin +0 -0
  29. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  30. package/android/.gradle/5.6.4/fileHashes/resourceHashesCache.bin +0 -0
  31. package/android/.gradle/5.6.4/javaCompile/classAnalysis.bin +0 -0
  32. package/android/.gradle/5.6.4/javaCompile/jarAnalysis.bin +0 -0
  33. package/android/.gradle/5.6.4/javaCompile/javaCompile.lock +0 -0
  34. package/android/.gradle/5.6.4/javaCompile/taskHistory.bin +0 -0
  35. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  36. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  37. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  38. package/android/.gradle/vcs-1/gc.properties +0 -0
  39. package/android/.idea/.gitignore +0 -3
  40. package/android/.idea/compiler.xml +0 -6
  41. package/android/.idea/gradle.xml +0 -20
  42. package/android/.idea/jarRepositories.xml +0 -30
  43. package/android/.idea/libraries/Gradle__androidx_activity_activity_1_2_0_aar.xml +0 -16
  44. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +0 -13
  45. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_experimental_1_0_0_aar.xml +0 -13
  46. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_2_0_aar.xml +0 -16
  47. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_2_0_aar.xml +0 -13
  48. package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
  49. package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
  50. package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
  51. package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_1_0_aar.xml +0 -16
  52. package/android/.idea/libraries/Gradle__androidx_core_core_1_3_2_aar.xml +0 -16
  53. package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
  54. package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
  55. package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
  56. package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_3_0_aar.xml +0 -16
  57. package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
  58. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_3_0.xml +0 -11
  59. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
  60. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_3_0_aar.xml +0 -13
  61. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_3_0_aar.xml +0 -13
  62. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_3_0_aar.xml +0 -13
  63. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_savedstate_2_3_0_aar.xml +0 -13
  64. package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
  65. package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_1_0_aar.xml +0 -13
  66. package/android/.idea/libraries/Gradle__androidx_test_core_1_2_0_aar.xml +0 -15
  67. package/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml +0 -15
  68. package/android/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml +0 -15
  69. package/android/.idea/libraries/Gradle__androidx_test_ext_junit_1_1_1_aar.xml +0 -15
  70. package/android/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml +0 -15
  71. package/android/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml +0 -15
  72. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
  73. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
  74. package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
  75. package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
  76. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml +0 -9
  77. package/android/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1.xml +0 -13
  78. package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
  79. package/android/.idea/libraries/Gradle__junit_junit_4_12.xml +0 -13
  80. package/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_1_10_18.xml +0 -13
  81. package/android/.idea/libraries/Gradle__net_bytebuddy_byte_buddy_agent_1_10_18.xml +0 -13
  82. package/android/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0.xml +0 -13
  83. package/android/.idea/libraries/Gradle__org_apache_cordova_framework_7_0_0_aar.xml +0 -13
  84. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml +0 -13
  85. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3.xml +0 -13
  86. package/android/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3.xml +0 -13
  87. package/android/.idea/libraries/Gradle__org_json_json_20140107.xml +0 -13
  88. package/android/.idea/libraries/Gradle__org_mockito_mockito_core_3_6_28.xml +0 -13
  89. package/android/.idea/libraries/Gradle__org_mockito_mockito_inline_3_6_28.xml +0 -13
  90. package/android/.idea/libraries/Gradle__org_objenesis_objenesis_3_1.xml +0 -13
  91. package/android/.idea/misc.xml +0 -9
  92. package/android/.idea/modules/1586507569/android.capacitor-android.iml +0 -93
  93. package/android/.idea/modules/android.iml +0 -65
  94. package/android/.idea/modules.xml +0 -9
  95. package/android/.idea/runConfigurations.xml +0 -10
  96. package/android/.idea/vcs.xml +0 -6
  97. package/android/.npmignore +0 -1
  98. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  99. package/android/gradle/wrapper/gradle-wrapper.properties +0 -6
  100. package/android/gradle.properties +0 -21
  101. package/android/gradlew +0 -160
  102. package/android/gradlew.bat +0 -90
  103. package/android/local.properties +0 -8
  104. package/android/proguard-rules.pro +0 -21
  105. package/android/settings.gradle +0 -2
  106. package/android/src/androidTest/java/com/getcapacitor/android/ExampleInstrumentedTest.java +0 -121
  107. package/android/src/main/res/layout/bridge_layout_main.xml +0 -15
  108. package/android/src/main/res/values/colors.xml +0 -3
  109. package/android/src/main/res/values/strings.xml +0 -3
  110. package/android/src/main/res/values/styles.xml +0 -3
  111. package/android/src/test/java/com/getcapacitor/ExampleUnitTest.java +0 -17
  112. package/ios/Plugin.xcodeproj/project.pbxproj +0 -735
  113. package/ios/Plugin.xcodeproj/xcshareddata/xcschemes/Plugin.xcscheme +0 -77
  114. package/ios/Plugin.xcodeproj/xcshareddata/xcschemes/TestApp.xcscheme +0 -88
  115. package/ios/Plugin.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/xcschememanagement.plist +0 -37
  116. package/ios/Plugin.xcworkspace/contents.xcworkspacedata +0 -10
  117. package/ios/Plugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  118. package/ios/Plugin.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +0 -5
  119. package/ios/Plugin.xcworkspace/xcuserdata/mka.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  120. package/ios/Plugin.xcworkspace/xcuserdata/mka.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -24
  121. package/ios/PluginTests/Info.plist +0 -22
  122. package/ios/PluginTests/PluginTests.swift +0 -245
  123. package/ios/Podfile +0 -18
  124. package/ios/Podfile.lock +0 -29
  125. package/ios/Pods/CapacitorCordova/LICENSE +0 -23
  126. package/ios/Pods/CapacitorCordova/README.md +0 -37
  127. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h +0 -21
  128. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.h +0 -8
  129. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/AppDelegate.m +0 -5
  130. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h +0 -28
  131. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVAvailability.h +0 -109
  132. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegate.h +0 -51
  133. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.h +0 -39
  134. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVCommandDelegateImpl.m +0 -154
  135. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.h +0 -31
  136. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVConfigParser.m +0 -81
  137. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.h +0 -52
  138. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVInvokedUrlCommand.m +0 -116
  139. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.h +0 -81
  140. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPlugin.m +0 -154
  141. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.h +0 -25
  142. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginManager.m +0 -77
  143. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.h +0 -82
  144. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVPluginResult.m +0 -216
  145. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVScreenOrientationDelegate.h +0 -33
  146. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.h +0 -41
  147. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUIWebViewDelegate.m +0 -399
  148. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.h +0 -27
  149. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVURLProtocol.m +0 -74
  150. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.h +0 -27
  151. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVUserAgentUtil.m +0 -156
  152. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.h +0 -30
  153. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDVViewController.m +0 -34
  154. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.h +0 -35
  155. package/ios/Pods/CapacitorCordova/ios/CapacitorCordova/CapacitorCordova/Classes/Public/NSDictionary+CordovaPreferences.m +0 -63
  156. package/ios/Pods/Local Podspecs/Capacitor.podspec.json +0 -34
  157. package/ios/Pods/Local Podspecs/CapacitorCordova.podspec.json +0 -26
  158. package/ios/Pods/Manifest.lock +0 -29
  159. package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -1512
  160. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Capacitor.xcscheme +0 -58
  161. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/CapacitorCordova.xcscheme +0 -58
  162. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Pods-Plugin.xcscheme +0 -58
  163. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/Pods-PluginTests.xcscheme +0 -58
  164. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/SwiftKeychainWrapper.xcscheme +0 -58
  165. package/ios/Pods/Pods.xcodeproj/xcuserdata/mka.xcuserdatad/xcschemes/xcschememanagement.plist +0 -36
  166. package/ios/Pods/SwiftKeychainWrapper/LICENSE +0 -22
  167. package/ios/Pods/SwiftKeychainWrapper/README.md +0 -168
  168. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/KeychainItemAccessibility.swift +0 -123
  169. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/KeychainWrapper.swift +0 -447
  170. package/ios/Pods/SwiftKeychainWrapper/SwiftKeychainWrapper/SwiftKeychainWrapper.h +0 -37
  171. package/ios/Pods/Target Support Files/Capacitor/Capacitor-Info.plist +0 -26
  172. package/ios/Pods/Target Support Files/Capacitor/Capacitor-dummy.m +0 -5
  173. package/ios/Pods/Target Support Files/Capacitor/Capacitor-prefix.pch +0 -12
  174. package/ios/Pods/Target Support Files/Capacitor/Capacitor-umbrella.h +0 -23
  175. package/ios/Pods/Target Support Files/Capacitor/Capacitor.debug.xcconfig +0 -13
  176. package/ios/Pods/Target Support Files/Capacitor/Capacitor.modulemap +0 -7
  177. package/ios/Pods/Target Support Files/Capacitor/Capacitor.release.xcconfig +0 -13
  178. package/ios/Pods/Target Support Files/Capacitor/Capacitor.xcconfig +0 -10
  179. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-Info.plist +0 -26
  180. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-dummy.m +0 -5
  181. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-prefix.pch +0 -12
  182. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova-umbrella.h +0 -33
  183. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.debug.xcconfig +0 -12
  184. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.modulemap +0 -6
  185. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.release.xcconfig +0 -12
  186. package/ios/Pods/Target Support Files/CapacitorCordova/CapacitorCordova.xcconfig +0 -9
  187. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-Info.plist +0 -26
  188. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.markdown +0 -83
  189. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-acknowledgements.plist +0 -127
  190. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-dummy.m +0 -5
  191. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin-umbrella.h +0 -16
  192. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.debug.xcconfig +0 -13
  193. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.modulemap +0 -6
  194. package/ios/Pods/Target Support Files/Pods-Plugin/Pods-Plugin.release.xcconfig +0 -13
  195. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-Info.plist +0 -26
  196. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.markdown +0 -83
  197. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-acknowledgements.plist +0 -127
  198. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-dummy.m +0 -5
  199. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-frameworks.sh +0 -189
  200. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests-umbrella.h +0 -16
  201. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.debug.xcconfig +0 -14
  202. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.modulemap +0 -6
  203. package/ios/Pods/Target Support Files/Pods-PluginTests/Pods-PluginTests.release.xcconfig +0 -14
  204. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-Info.plist +0 -26
  205. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-dummy.m +0 -5
  206. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-prefix.pch +0 -12
  207. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper-umbrella.h +0 -17
  208. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.debug.xcconfig +0 -12
  209. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.modulemap +0 -6
  210. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.release.xcconfig +0 -12
  211. package/ios/Pods/Target Support Files/SwiftKeychainWrapper/SwiftKeychainWrapper.xcconfig +0 -9
  212. package/ios/TestApp/AppDelegate.swift +0 -37
  213. package/ios/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  214. package/ios/TestApp/Assets.xcassets/Contents.json +0 -6
  215. package/ios/TestApp/Base.lproj/LaunchScreen.storyboard +0 -25
  216. package/ios/TestApp/Base.lproj/Main.storyboard +0 -24
  217. package/ios/TestApp/ContentView.swift +0 -21
  218. package/ios/TestApp/Info.plist +0 -60
  219. package/ios/TestApp/Preview Content/Preview Assets.xcassets/Contents.json +0 -6
  220. package/ios/TestApp/SceneDelegate.swift +0 -64
  221. package/ios/TestApp/TestApp/AppDelegate.swift +0 -46
  222. package/ios/TestApp/TestApp/Assets.xcassets/AppIcon.appiconset/Contents.json +0 -98
  223. package/ios/TestApp/TestApp/Assets.xcassets/Contents.json +0 -6
  224. package/ios/TestApp/TestApp/Base.lproj/LaunchScreen.storyboard +0 -25
  225. package/ios/TestApp/TestApp/Base.lproj/Main.storyboard +0 -24
  226. package/ios/TestApp/TestApp/Info.plist +0 -45
  227. package/ios/TestApp/TestApp/TestApp.entitlements +0 -10
  228. package/ios/TestApp/TestApp/ViewController.swift +0 -20
  229. package/ios/TestApp/TestApp.entitlements +0 -8
  230. package/ios/TestApp/ViewController.swift +0 -20
@@ -1,13 +1,18 @@
1
+ require 'json'
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
+
1
5
  Pod::Spec.new do |s|
2
6
  s.name = 'CapacitorSecureStoragePlugin'
3
- s.version = '0.6.2'
4
- s.summary = 'securely store secrets such as usernames, passwords, tokens, certificates or other sensitive information (strings) on iOS & Android'
5
- s.license = 'MIT'
6
- s.homepage = 'https://github.com/martinkasa/capacitor-secure-storage-plugin.git'
7
- s.author = 'martinkasa'
8
- s.source = { :git => 'https://github.com/martinkasa/capacitor-secure-storage-plugin.git', :tag => s.version.to_s }
7
+ s.version = package['version']
8
+ s.summary = package['description']
9
+ s.license = package['license']
10
+ s.homepage = package['repository']['url']
11
+ s.author = package['author']
12
+ s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
9
13
  s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
10
14
  s.ios.deployment_target = '12.0'
11
15
  s.dependency 'Capacitor'
12
16
  s.dependency 'SwiftKeychainWrapper'
13
- end
17
+ s.swift_version = '5.1'
18
+ end
package/README.md CHANGED
@@ -42,9 +42,9 @@ First line is needed because of web part of the plugin (current behavior of Capa
42
42
 
43
43
  ### Android
44
44
 
45
- In Android you have to register plugins manually in MainActivity class of your app.
45
+ In Android with Capacitor v2 you have to register plugins manually in MainActivity class of your app.
46
46
 
47
- https://capacitor.ionicframework.com/docs/plugins/android/#export-to-capacitor
47
+ https://capacitorjs.com/docs/v2/plugins/android#export-to-capacitor
48
48
 
49
49
  ```
50
50
  import com.whitestein.securestorage.SecureStoragePlugin;
@@ -1,7 +1,8 @@
1
1
  ext {
2
- junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.12'
3
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.1'
4
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.2.0'
2
+ junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.2.0'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.2'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.3.0'
5
6
  }
6
7
 
7
8
  buildscript {
@@ -10,17 +11,17 @@ buildscript {
10
11
  jcenter()
11
12
  }
12
13
  dependencies {
13
- classpath 'com.android.tools.build:gradle:3.6.1'
14
+ classpath 'com.android.tools.build:gradle:4.2.1'
14
15
  }
15
16
  }
16
17
 
17
18
  apply plugin: 'com.android.library'
18
19
 
19
20
  android {
20
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 29
21
+ compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 30
21
22
  defaultConfig {
22
23
  minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 21
23
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 29
24
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 30
24
25
  versionCode 1
25
26
  versionName "1.0"
26
27
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -34,18 +35,23 @@ android {
34
35
  lintOptions {
35
36
  abortOnError false
36
37
  }
38
+ compileOptions {
39
+ sourceCompatibility JavaVersion.VERSION_1_8
40
+ targetCompatibility JavaVersion.VERSION_1_8
41
+ }
37
42
  }
38
43
 
39
44
  repositories {
40
45
  google()
41
- jcenter()
42
46
  mavenCentral()
47
+ jcenter()
43
48
  }
44
49
 
45
50
 
46
51
  dependencies {
47
52
  implementation fileTree(dir: 'libs', include: ['*.jar'])
48
53
  implementation project(':capacitor-android')
54
+ implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
49
55
  testImplementation "junit:junit:$junitVersion"
50
56
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
51
57
  androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
@@ -1,5 +1,3 @@
1
-
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.whitestein.securestorage.capacitorsecurestorageplugin">
4
- </manifest>
5
-
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.whitestein.securestorage">
3
+ </manifest>
@@ -1,7 +1,6 @@
1
1
  package com.whitestein.securestorage;
2
2
 
3
3
  import android.content.Context;
4
-
5
4
  import com.getcapacitor.JSArray;
6
5
  import com.getcapacitor.JSObject;
7
6
  import com.getcapacitor.NativePlugin;
@@ -9,12 +8,12 @@ import com.getcapacitor.Plugin;
9
8
  import com.getcapacitor.PluginCall;
10
9
  import com.getcapacitor.PluginMethod;
11
10
  import com.getcapacitor.annotation.CapacitorPlugin;
12
-
13
11
  import java.nio.charset.Charset;
14
12
  import java.util.Set;
15
13
 
16
- @CapacitorPlugin()
17
- public class SecureStoragePlugin extends Plugin {
14
+ @CapacitorPlugin(name = "SecureStoragePlugin")
15
+ public class SecureStoragePluginPlugin extends Plugin {
16
+
18
17
  private PasswordStorageHelper passwordStorageHelper;
19
18
 
20
19
  @Override
@@ -27,43 +26,52 @@ public class SecureStoragePlugin extends Plugin {
27
26
  this.passwordStorageHelper = new PasswordStorageHelper(context);
28
27
  }
29
28
 
30
- @PluginMethod()
29
+ @PluginMethod
31
30
  public void set(PluginCall call) {
32
31
  String key = call.getString("key");
33
32
  String value = call.getString("value");
33
+ if(value == null) {
34
+ value = "";
35
+ }
36
+
34
37
  try {
35
- call.resolve(this._set(key,value));
38
+ call.resolve(this._set(key, value));
36
39
  } catch (Exception exception) {
37
40
  call.reject(exception.getMessage(), exception);
38
41
  }
39
42
  }
40
43
 
41
- @PluginMethod()
44
+ @PluginMethod
42
45
  public void get(PluginCall call) {
43
46
  String key = call.getString("key");
44
47
  try {
45
- call.resolve(this._get(key));
48
+ call.resolve(this._get(key));
46
49
  } catch (Exception exception) {
47
50
  call.reject(exception.getMessage(), exception);
48
51
  }
49
52
  }
50
53
 
51
- @PluginMethod()
54
+ @PluginMethod
52
55
  public void keys(PluginCall call) {
53
56
  call.resolve(this._keys());
54
57
  }
55
58
 
56
- @PluginMethod()
59
+ @PluginMethod
57
60
  public void remove(PluginCall call) {
58
61
  String key = call.getString("key");
59
62
  try {
60
- call.resolve(this._remove(key));
63
+ if(this.has(key)) {
64
+ call.resolve(this._remove(key));
65
+ }
66
+ else {
67
+ call.reject("Item with given key does not exist");
68
+ }
61
69
  } catch (Exception exception) {
62
70
  call.reject(exception.getMessage(), exception);
63
71
  }
64
72
  }
65
73
 
66
- @PluginMethod()
74
+ @PluginMethod
67
75
  public void clear(PluginCall call) {
68
76
  try {
69
77
  call.resolve(this._clear());
@@ -72,7 +80,7 @@ public class SecureStoragePlugin extends Plugin {
72
80
  }
73
81
  }
74
82
 
75
- @PluginMethod()
83
+ @PluginMethod
76
84
  public void getPlatform(PluginCall call) {
77
85
  call.resolve(this._getPlatform());
78
86
  }
@@ -84,9 +92,18 @@ public class SecureStoragePlugin extends Plugin {
84
92
  return ret;
85
93
  }
86
94
 
95
+ public boolean has(String key) throws Exception {
96
+ byte[] buffer = this.passwordStorageHelper.getData(key);
97
+ if (buffer != null) {
98
+ return true;
99
+ } else {
100
+ return false;
101
+ }
102
+ }
103
+
87
104
  public JSObject _get(String key) throws Exception {
88
105
  byte[] buffer = this.passwordStorageHelper.getData(key);
89
- if (buffer != null && buffer.length > 0) {
106
+ if (buffer != null) {
90
107
  String value = new String(buffer, Charset.forName("UTF-8"));
91
108
  JSObject ret = new JSObject();
92
109
  ret.put("value", value);
@@ -122,5 +139,4 @@ public class SecureStoragePlugin extends Plugin {
122
139
  ret.put("value", "android");
123
140
  return ret;
124
141
  }
125
-
126
142
  }
package/dist/docs.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "api": {
3
+ "name": "SecureStoragePluginPlugin",
4
+ "slug": "securestoragepluginplugin",
5
+ "docs": "",
6
+ "tags": [],
7
+ "methods": [
8
+ {
9
+ "name": "get",
10
+ "signature": "(options: { key: string; }) => Promise<{ value: string; }>",
11
+ "parameters": [
12
+ {
13
+ "name": "options",
14
+ "docs": "",
15
+ "type": "{ key: string; }"
16
+ }
17
+ ],
18
+ "returns": "Promise<{ value: string; }>",
19
+ "tags": [],
20
+ "docs": "",
21
+ "complexTypes": [],
22
+ "slug": "get"
23
+ },
24
+ {
25
+ "name": "set",
26
+ "signature": "(options: { key: string; value: string; }) => Promise<{ value: boolean; }>",
27
+ "parameters": [
28
+ {
29
+ "name": "options",
30
+ "docs": "",
31
+ "type": "{ key: string; value: string; }"
32
+ }
33
+ ],
34
+ "returns": "Promise<{ value: boolean; }>",
35
+ "tags": [],
36
+ "docs": "",
37
+ "complexTypes": [],
38
+ "slug": "set"
39
+ },
40
+ {
41
+ "name": "remove",
42
+ "signature": "(options: { key: string; }) => Promise<{ value: boolean; }>",
43
+ "parameters": [
44
+ {
45
+ "name": "options",
46
+ "docs": "",
47
+ "type": "{ key: string; }"
48
+ }
49
+ ],
50
+ "returns": "Promise<{ value: boolean; }>",
51
+ "tags": [],
52
+ "docs": "",
53
+ "complexTypes": [],
54
+ "slug": "remove"
55
+ },
56
+ {
57
+ "name": "clear",
58
+ "signature": "() => Promise<{ value: boolean; }>",
59
+ "parameters": [],
60
+ "returns": "Promise<{ value: boolean; }>",
61
+ "tags": [],
62
+ "docs": "",
63
+ "complexTypes": [],
64
+ "slug": "clear"
65
+ },
66
+ {
67
+ "name": "keys",
68
+ "signature": "() => Promise<{ value: string[]; }>",
69
+ "parameters": [],
70
+ "returns": "Promise<{ value: string[]; }>",
71
+ "tags": [],
72
+ "docs": "",
73
+ "complexTypes": [],
74
+ "slug": "keys"
75
+ },
76
+ {
77
+ "name": "getPlatform",
78
+ "signature": "() => Promise<{ value: string; }>",
79
+ "parameters": [],
80
+ "returns": "Promise<{ value: string; }>",
81
+ "tags": [],
82
+ "docs": "",
83
+ "complexTypes": [],
84
+ "slug": "getplatform"
85
+ }
86
+ ],
87
+ "properties": []
88
+ },
89
+ "interfaces": [],
90
+ "enums": [],
91
+ "typeAliases": [],
92
+ "pluginConfigs": []
93
+ }
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=definitions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface SecureStoragePluginPlugin {\n get(options: { key: string }): Promise<{ value: string }>;\n set(options: { key: string; value: string }): Promise<{ value: boolean }>;\n remove(options: { key: string }): Promise<{ value: boolean }>;\n clear(): Promise<{ value: boolean }>;\n keys(): Promise<{ value: string[] }>;\n getPlatform(): Promise<{ value: string }>;\n}\n"]}
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
2
  const SecureStoragePlugin = registerPlugin('SecureStoragePlugin', {
3
- web: () => import('./web').then((m) => new m.SecureStoragePluginWeb()),
3
+ web: () => import('./web').then(m => new m.SecureStoragePluginWeb()),
4
4
  });
5
5
  export * from './definitions';
6
6
  export { SecureStoragePlugin };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,mBAAmB,GAAG,cAAc,CAA4B,qBAAqB,EAAE;IAC3F,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;CACvE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,mBAAmB,GAAG,cAAc,CACxC,qBAAqB,EACrB;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;CACrE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { SecureStoragePluginPlugin } from './definitions';\n\nconst SecureStoragePlugin = registerPlugin<SecureStoragePluginPlugin>(\n 'SecureStoragePlugin',\n {\n web: () => import('./web').then(m => new m.SecureStoragePluginWeb()),\n },\n);\n\nexport * from './definitions';\nexport { SecureStoragePlugin };\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,8 +1,7 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
- import { SecureStoragePluginPlugin } from './definitions';
2
+ import type { SecureStoragePluginPlugin } from './definitions';
3
3
  export declare class SecureStoragePluginWeb extends WebPlugin implements SecureStoragePluginPlugin {
4
4
  PREFIX: string;
5
- constructor();
6
5
  get(options: {
7
6
  key: string;
8
7
  }): Promise<{
@@ -29,6 +28,5 @@ export declare class SecureStoragePluginWeb extends WebPlugin implements SecureS
29
28
  value: string;
30
29
  }>;
31
30
  private addPrefix;
31
+ private removePrefix;
32
32
  }
33
- declare const SecureStoragePlugin: SecureStoragePluginWeb;
34
- export { SecureStoragePlugin };
package/dist/esm/web.js CHANGED
@@ -1,17 +1,16 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
2
  export class SecureStoragePluginWeb extends WebPlugin {
3
3
  constructor() {
4
- super({
5
- name: 'SecureStoragePlugin',
6
- platforms: ['web'],
7
- });
4
+ super(...arguments);
8
5
  this.PREFIX = 'cap_sec_';
9
6
  this.addPrefix = (key) => this.PREFIX + key;
7
+ this.removePrefix = (key) => key.replace(this.PREFIX, '');
10
8
  }
11
9
  get(options) {
12
- return localStorage.getItem(this.addPrefix(options.key)) !== null
10
+ const value = localStorage.getItem(this.addPrefix(options.key));
11
+ return value !== null
13
12
  ? Promise.resolve({
14
- value: atob(localStorage.getItem(this.addPrefix(options.key))),
13
+ value: atob(value),
15
14
  })
16
15
  : Promise.reject('Item with given key does not exist');
17
16
  }
@@ -20,8 +19,13 @@ export class SecureStoragePluginWeb extends WebPlugin {
20
19
  return Promise.resolve({ value: true });
21
20
  }
22
21
  remove(options) {
23
- localStorage.removeItem(this.addPrefix(options.key));
24
- return Promise.resolve({ value: true });
22
+ if (localStorage.getItem(this.addPrefix(options.key))) {
23
+ localStorage.removeItem(this.addPrefix(options.key));
24
+ return Promise.resolve({ value: true });
25
+ }
26
+ else {
27
+ return Promise.reject('Item with given key does not exist');
28
+ }
25
29
  }
26
30
  clear() {
27
31
  for (const key in localStorage) {
@@ -32,13 +36,13 @@ export class SecureStoragePluginWeb extends WebPlugin {
32
36
  return Promise.resolve({ value: true });
33
37
  }
34
38
  keys() {
35
- const keys = Object.keys(localStorage).filter((k) => k.indexOf(this.PREFIX) === 0);
39
+ const keys = Object.keys(localStorage)
40
+ .filter(k => k.indexOf(this.PREFIX) === 0)
41
+ .map(this.removePrefix);
36
42
  return Promise.resolve({ value: keys });
37
43
  }
38
44
  getPlatform() {
39
45
  return Promise.resolve({ value: 'web' });
40
46
  }
41
47
  }
42
- const SecureStoragePlugin = new SecureStoragePluginWeb();
43
- export { SecureStorageP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AM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;aACnC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;aACzC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1B,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3C,CAAC;CAIF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { SecureStoragePluginPlugin } from './definitions';\n\nexport class SecureStoragePluginWeb\n extends WebPlugin\n implements SecureStoragePluginPlugin {\n PREFIX = 'cap_sec_';\n\n get(options: { key: string }): Promise<{ value: string }> {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? Promise.resolve({\n value: atob(value),\n })\n : Promise.reject('Item with given key does not exist');\n }\n set(options: { key: string; value: string }): Promise<{ value: boolean }> {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return Promise.resolve({ value: true });\n }\n remove(options: { key: string }): Promise<{ value: boolean }> {\n if (localStorage.getItem(this.addPrefix(options.key))) {\n localStorage.removeItem(this.addPrefix(options.key));\n return Promise.resolve({ value: true });\n } else {\n return Promise.reject('Item with given key does not exist');\n }\n }\n clear(): Promise<{ value: boolean }> {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return Promise.resolve({ value: true });\n }\n keys(): Promise<{ value: string[] }> {\n const keys = Object.keys(localStorage)\n .filter(k => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return Promise.resolve({ value: keys });\n }\n\n getPlatform(): Promise<{ value: string }> {\n return Promise.resolve({ value: 'web' });\n }\n\n private addPrefix = (key: string) => this.PREFIX + key;\n private removePrefix = (key: string) => key.replace(this.PREFIX, '');\n}\n"]}
@@ -0,0 +1,64 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var core = require('@capacitor/core');
6
+
7
+ const SecureStoragePlugin = core.registerPlugin('SecureStoragePlugin', {
8
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.SecureStoragePluginWeb()),
9
+ });
10
+
11
+ class SecureStoragePluginWeb extends core.WebPlugin {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.PREFIX = 'cap_sec_';
15
+ this.addPrefix = (key) => this.PREFIX + key;
16
+ this.removePrefix = (key) => key.replace(this.PREFIX, '');
17
+ }
18
+ get(options) {
19
+ const value = localStorage.getItem(this.addPrefix(options.key));
20
+ return value !== null
21
+ ? Promise.resolve({
22
+ value: atob(value),
23
+ })
24
+ : Promise.reject('Item with given key does not exist');
25
+ }
26
+ set(options) {
27
+ localStorage.setItem(this.addPrefix(options.key), btoa(options.value));
28
+ return Promise.resolve({ value: true });
29
+ }
30
+ remove(options) {
31
+ if (localStorage.getItem(this.addPrefix(options.key))) {
32
+ localStorage.removeItem(this.addPrefix(options.key));
33
+ return Promise.resolve({ value: true });
34
+ }
35
+ else {
36
+ return Promise.reject('Item with given key does not exist');
37
+ }
38
+ }
39
+ clear() {
40
+ for (const key in localStorage) {
41
+ if (key.indexOf(this.PREFIX) === 0) {
42
+ localStorage.removeItem(key);
43
+ }
44
+ }
45
+ return Promise.resolve({ value: true });
46
+ }
47
+ keys() {
48
+ const keys = Object.keys(localStorage)
49
+ .filter(k => k.indexOf(this.PREFIX) === 0)
50
+ .map(this.removePrefix);
51
+ return Promise.resolve({ value: keys });
52
+ }
53
+ getPlatform() {
54
+ return Promise.resolve({ value: 'web' });
55
+ }
56
+ }
57
+
58
+ var web = /*#__PURE__*/Object.freeze({
59
+ __proto__: null,
60
+ SecureStoragePluginWeb: SecureStoragePluginWeb
61
+ });
62
+
63
+ exports.SecureStoragePlugin = SecureStoragePlugin;
64
+ //# sourceMappingURL=plugin.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SecureStoragePlugin = registerPlugin('SecureStoragePlugin', {\n web: () => import('./web').then(m => new m.SecureStoragePluginWeb()),\n});\nexport * from './definitions';\nexport { SecureStoragePlugin };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SecureStoragePluginWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.PREFIX = 'cap_sec_';\n this.addPrefix = (key) => this.PREFIX + key;\n this.removePrefix = (key) => key.replace(this.PREFIX, '');\n }\n get(options) {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? Promise.resolve({\n value: atob(value),\n })\n : Promise.reject('Item with given key does not exist');\n }\n set(options) {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return Promise.resolve({ value: true });\n }\n remove(options) {\n if (localStorage.getItem(this.addPrefix(options.key))) {\n localStorage.removeItem(this.addPrefix(options.key));\n return Promise.resolve({ value: true });\n }\n else {\n return Promise.reject('Item with given key does not exist');\n }\n }\n clear() {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return Promise.resolve({ value: true });\n }\n keys() {\n const keys = Object.keys(localStorage)\n .filter(k => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return Promise.resolve({ value: keys });\n }\n getPlatform() {\n return Promise.resolve({ value: 'web' });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;AAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;AACxE,C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O,CAAC,GAAG,CAAC,CAAC,CAAC;AACjE,YAAY,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACpD,SAAS;AACT,aAAa;AACb,YAAY,OAAO,OAAO,CAAC,MAAM,CAAC,oCAAoC,CAAC,CAAC;AACxE,SAAS;AACT,KAAK;AACL,IAAI,KAAK,GAAG;AACZ,QAAQ,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;AACxC,YAAY,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AAChD,gBAAgB,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AAC7C,aAAa;AACb,SAAS;AACT,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,IAAI,GAAG;AACX,QAAQ,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;AAC9C,aAAa,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtD,aAAa,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACpC,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,KAAK;AACL,IAAI,WAAW,GAAG;AAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACjD,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js ADDED
@@ -0,0 +1,67 @@
1
+ var capacitorSecureStoragePlugin = (function (exports, core) {
2
+ 'use strict';
3
+
4
+ const SecureStoragePlugin = core.registerPlugin('SecureStoragePlugin', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then(m => new m.SecureStoragePluginWeb()),
6
+ });
7
+
8
+ class SecureStoragePluginWeb extends core.WebPlugin {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.PREFIX = 'cap_sec_';
12
+ this.addPrefix = (key) => this.PREFIX + key;
13
+ this.removePrefix = (key) => key.replace(this.PREFIX, '');
14
+ }
15
+ get(options) {
16
+ const value = localStorage.getItem(this.addPrefix(options.key));
17
+ return value !== null
18
+ ? Promise.resolve({
19
+ value: atob(value),
20
+ })
21
+ : Promise.reject('Item with given key does not exist');
22
+ }
23
+ set(options) {
24
+ localStorage.setItem(this.addPrefix(options.key), btoa(options.value));
25
+ return Promise.resolve({ value: true });
26
+ }
27
+ remove(options) {
28
+ if (localStorage.getItem(this.addPrefix(options.key))) {
29
+ localStorage.removeItem(this.addPrefix(options.key));
30
+ return Promise.resolve({ value: true });
31
+ }
32
+ else {
33
+ return Promise.reject('Item with given key does not exist');
34
+ }
35
+ }
36
+ clear() {
37
+ for (const key in localStorage) {
38
+ if (key.indexOf(this.PREFIX) === 0) {
39
+ localStorage.removeItem(key);
40
+ }
41
+ }
42
+ return Promise.resolve({ value: true });
43
+ }
44
+ keys() {
45
+ const keys = Object.keys(localStorage)
46
+ .filter(k => k.indexOf(this.PREFIX) === 0)
47
+ .map(this.removePrefix);
48
+ return Promise.resolve({ value: keys });
49
+ }
50
+ getPlatform() {
51
+ return Promise.resolve({ value: 'web' });
52
+ }
53
+ }
54
+
55
+ var web = /*#__PURE__*/Object.freeze({
56
+ __proto__: null,
57
+ SecureStoragePluginWeb: SecureStoragePluginWeb
58
+ });
59
+
60
+ exports.SecureStoragePlugin = SecureStoragePlugin;
61
+
62
+ Object.defineProperty(exports, '__esModule', { value: true });
63
+
64
+ return exports;
65
+
66
+ })({}, capacitorExports);
67
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst SecureStoragePlugin = registerPlugin('SecureStoragePlugin', {\n web: () => import('./web').then(m => new m.SecureStoragePluginWeb()),\n});\nexport * from './definitions';\nexport { SecureStoragePlugin };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class SecureStoragePluginWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.PREFIX = 'cap_sec_';\n this.addPrefix = (key) => this.PREFIX + key;\n this.removePrefix = (key) => key.replace(this.PREFIX, '');\n }\n get(options) {\n const value = localStorage.getItem(this.addPrefix(options.key));\n return value !== null\n ? Promise.resolve({\n value: atob(value),\n })\n : Promise.reject('Item with given key does not exist');\n }\n set(options) {\n localStorage.setItem(this.addPrefix(options.key), btoa(options.value));\n return Promise.resolve({ value: true });\n }\n remove(options) {\n if (localStorage.getItem(this.addPrefix(options.key))) {\n localStorage.removeItem(this.addPrefix(options.key));\n return Promise.resolve({ value: true });\n }\n else {\n return Promise.reject('Item with given key does not exist');\n }\n }\n clear() {\n for (const key in localStorage) {\n if (key.indexOf(this.PREFIX) === 0) {\n localStorage.removeItem(key);\n }\n }\n return Promise.resolve({ value: true });\n }\n keys() {\n const keys = Object.keys(localStorage)\n .filter(k => k.indexOf(this.PREFIX) === 0)\n .map(this.removePrefix);\n return Promise.resolve({ value: keys });\n }\n getPlatform() {\n return Promise.resolve({ value: 'web' });\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,mBAAmB,GAAGA,mBAAc,CAAC,qBAAqB,EAAE;IAClE,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,sBAAsB,EAAE,CAAC;IACxE,CAAC;;ICFM,MAAM,sBAAsB,SAASC,cAAS,CAAC;IACtD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5B,QAAQ,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IACjC,QAAQ,IAAI,CAAC,S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CAAC;IACxE,SAAS;IACT,KAAK;IACL,IAAI,KAAK,GAAG;IACZ,QAAQ,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE;IACxC,YAAY,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;IAChD,gBAAgB,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7C,aAAa;IACb,SAAS;IACT,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,KAAK;IACL,IAAI,IAAI,GAAG;IACX,QAAQ,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;IAC9C,aAAa,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtD,aAAa,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACpC,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAChD,KAAK;IACL,IAAI,WAAW,GAAG;IAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACjD,KAAK;IACL;;;;;;;;;;;;;;;;;"}
@@ -13,7 +13,7 @@ public class SecureStoragePlugin: CAPPlugin {
13
13
  @objc func set(_ call: CAPPluginCall) {
14
14
  let key = call.getString("key") ?? ""
15
15
  let value = call.getString("value") ?? ""
16
- let saveSuccessful: Bool = keychainwrapper.set(value, forKey: key)
16
+ let saveSuccessful: Bool = keychainwrapper.set(value, forKey: key, withAccessibility: .always)
17
17
  if(saveSuccessful) {
18
18
  call.resolve([
19
19
  "value": saveSuccessful
@@ -33,7 +33,8 @@ public class SecureStoragePlugin: CAPPlugin {
33
33
  if (hasValueStandard && !hasValueDedicated) {
34
34
  let syncValueSuccessful: Bool = keychainwrapper.set(
35
35
  KeychainWrapper.standard.string(forKey: key) ?? "",
36
- forKey: key
36
+ forKey: key,
37
+ withAccessibility: .always
37
38
  )
38
39
  let removeValueSuccessful: Bool = KeychainWrapper.standard.removeObject(forKey: key)
39
40
  if (!syncValueSuccessful || !removeValueSuccessful) {
@@ -60,15 +61,23 @@ public class SecureStoragePlugin: CAPPlugin {
60
61
 
61
62
  @objc func remove(_ call: CAPPluginCall) {
62
63
  let key = call.getString("key") ?? ""
63
- KeychainWrapper.standard.removeObject(forKey: key);
64
- let removeDedicatedSuccessful: Bool = keychainwrapper.removeObject(forKey: key)
65
- if(removeDedicatedSuccessful) {
66
- call.resolve([
67
- "value": removeDedicatedSuccessful
68
- ])
64
+ let hasValueDedicated = keychainwrapper.hasValue(forKey: key)
65
+ let hasValueStandard = KeychainWrapper.standard.hasValue(forKey: key)
66
+
67
+ if(hasValueDedicated || hasValueStandard) {
68
+ KeychainWrapper.standard.removeObject(forKey: key);
69
+ let removeDedicatedSuccessful: Bool = keychainwrapper.removeObject(forKey: key)
70
+ if(removeDedicatedSuccessful) {
71
+ call.resolve([
72
+ "value": removeDedicatedSuccessful
73
+ ])
74
+ }
75
+ else {
76
+ call.reject("Remove failed")
77
+ }
69
78
  }
70
79
  else {
71
- call.reject("error")
80
+ call.reject("Item with given key does not exist")
72
81
  }
73
82
  }
74
83