@hanwha-ss1/plugin 0.6.4 → 0.6.6

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.
@@ -15,4 +15,7 @@ CAP_PLUGIN(Plugin, "Plugin",
15
15
  CAP_PLUGIN_METHOD(doDisabledCapture, CAPPluginReturnPromise);
16
16
  CAP_PLUGIN_METHOD(addKeyboardMenu, CAPPluginReturnPromise);
17
17
  CAP_PLUGIN_METHOD(removeKeyboardMenu, CAPPluginReturnPromise);
18
+ CAP_PLUGIN_METHOD(executeApp, CAPPluginReturnPromise);
19
+ CAP_PLUGIN_METHOD(getCertificateProvisioning, CAPPluginReturnPromise);
20
+
18
21
  )
@@ -30,6 +30,60 @@ public class Plugin: CAPPlugin {
30
30
  let keyboardSize = (userInfo[UIResponder.keyboardFrameEndUserInfoKey] as! NSValue).cgRectValue.size
31
31
  // data 매개변수에 keyboardsize를 전달
32
32
  self.notifyListeners(notification.name.rawValue, data: ["size": keyboardSize.height])
33
+ }
34
+ // ios 인증서 만료일을 가져온다
35
+ @objc func getCertificateProvisioning(_ call: CAPPluginCall){
36
+
37
+
38
+ guard let path = Bundle.main.path(forResource: "embedded", ofType: "mobileprovision"),
39
+ let content = try? Data(contentsOf: URL(fileURLWithPath: path)) else {
40
+ print("embedded.mobileprovision not found")
41
+ call.resolve([
42
+ "result": false,
43
+ "message": "embedded.mobileprovision not found"
44
+ ])
45
+ return;
46
+ }
47
+
48
+ guard let contentString = String(data: content, encoding: .ascii),
49
+ let startRange = contentString.range(of: "<plist"),
50
+ let endRange = contentString.range(of: "</plist>") else {
51
+ print("Failed to parse plist from provisioning profile")
52
+ call.resolve([
53
+ "result": false,
54
+ "message": "Failed to parse plist from provisioning profile"
55
+ ])
56
+ return;
57
+ }
58
+
59
+ let plistString = String(contentString[startRange.lowerBound...endRange.upperBound])
60
+ guard let plistData = plistString.data(using: .utf8) else { call.resolve([
61
+ "result": false
62
+ ])
63
+ return; }
64
+
65
+ do {
66
+ if let plist = try PropertyListSerialization.propertyList(from: plistData, options: [], format: nil) as? [String: Any],
67
+ let expirationDate = plist["ExpirationDate"] as? Date {
68
+ // Date를 timestamp로 변환
69
+ let timestamp = expirationDate.timeIntervalSince1970
70
+
71
+ call.resolve([
72
+ "result": true,
73
+ "timestamp": timestamp,
74
+ "date": expirationDate.description,
75
+ ])
76
+ return;
77
+ // return expirationDate
78
+ }
79
+ } catch {
80
+ print("Plist parsing failed: \(error)")
81
+ }
82
+
83
+ return;
84
+
85
+
86
+
33
87
  }
34
88
 
35
89
  @objc func handleDocumentViewRequest(_ notification: Notification) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanwha-ss1/plugin",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",