@hanwha-ss1/plugin 0.0.3 → 0.0.5

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.
package/README.md CHANGED
@@ -19,6 +19,11 @@ await HanwhaPlugin.addContact({
19
19
  dept: "회사",
20
20
  ext: "내선"
21
21
  })
22
+
23
+ // 스크린샷 방지
24
+ await HanwhaPlugin.setScreenCaptureDisabled({
25
+ disabled: "true"
26
+ })
22
27
  ```
23
28
 
24
29
  ## API
@@ -0,0 +1,33 @@
1
+ package com.plugin.capture;
2
+
3
+ import android.app.Activity;
4
+ import android.content.Intent;
5
+ import android.provider.ContactsContract;
6
+ import android.util.Log;
7
+ import android.view.WindowManager;
8
+
9
+
10
+ public class Capture {
11
+
12
+ public String echo(String value) {
13
+ Log.i("Echo", value);
14
+ return value;
15
+ }
16
+
17
+ /**
18
+ * 스크린 캡쳐 방지
19
+ *
20
+ * @param activity
21
+ * @param disable : 캡쳐 방지
22
+ */
23
+ public void setScreenCaptureDisable(Activity activity, String disable) {
24
+ Log.i("CapturePlugin", "disabled: " + disable);
25
+ if(disable.equalsIgnoreCase("true")) {
26
+ Log.i("CapturePlugin", "setFlags: FLAG_SECURE");
27
+ activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
28
+ } else {
29
+ Log.i("CapturePlugin", "clearFlags: FLAG_SECURE");
30
+ activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,31 @@
1
+ package com.plugin.capture;
2
+
3
+ import com.getcapacitor.JSObject;
4
+ import com.getcapacitor.Plugin;
5
+ import com.getcapacitor.PluginCall;
6
+ import com.getcapacitor.PluginMethod;
7
+ import com.getcapacitor.annotation.CapacitorPlugin;
8
+
9
+
10
+ @CapacitorPlugin(name = "Capture")
11
+ public class CapturePlugin extends Plugin{
12
+ private Capture implementation = new Capture();
13
+
14
+ @PluginMethod
15
+ public void echo(PluginCall call) {
16
+ String value = call.getString("value");
17
+
18
+ JSObject ret = new JSObject();
19
+ ret.put("value", implementation.echo(value));
20
+ call.resolve(ret);
21
+ }
22
+
23
+ @PluginMethod
24
+ public void setScreenCaptureDisabled(PluginCall call) {
25
+ String disable = call.getString("disabled");
26
+ if(implementation == null) {
27
+ implementation = new Capture();
28
+ }
29
+ implementation.setScreenCaptureDisable(getActivity(), disable);
30
+ }
31
+ }
@@ -16,4 +16,13 @@ export interface Plugin {
16
16
  }): Promise<{
17
17
  value: string;
18
18
  }>;
19
+ /**
20
+ * 캡쳐 방지
21
+ * @param options disabled : 캡쳐 방지 여부 (true, false)
22
+ */
23
+ setScreenCaptureDisabled(options: {
24
+ disabled: string;
25
+ }): Promise<{
26
+ value: string;
27
+ }>;
19
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface Plugin {\n /**\n * 연락처 저장\n * @param options name : 성명\n * @param options phone : 전화번호\n * @param options email : 이메일\n * @param options dept : 소속\n * @param options ext : 내선번호\n */\n addContact(options: {\n name: string;\n phone: string;\n email: string;\n dept: string;\n ext: string;\n }): Promise<{ value: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface Plugin {\n /**\n * 연락처 저장\n * @param options name : 성명\n * @param options phone : 전화번호\n * @param options email : 이메일\n * @param options dept : 소속\n * @param options ext : 내선번호\n */\n addContact(options: {\n name: string;\n phone: string;\n email: string;\n dept: string;\n ext: string;\n }): Promise<{ value: string }>;\n\n\n /**\n * 캡쳐 방지\n * @param options disabled : 캡쳐 방지 여부 (true, false)\n */\n setScreenCaptureDisabled(options: {\n disabled: string;\n }): Promise<{ value: string }>;\n}\n"]}
package/dist/esm/web.d.ts CHANGED
@@ -2,4 +2,5 @@ import { WebPlugin } from '@capacitor/core';
2
2
  import type { Plugin } from './definitions';
3
3
  export declare class PluginWeb extends WebPlugin implements Plugin {
4
4
  addContact(): Promise<any>;
5
+ setScreenCaptureDisabled(): Promise<any>;
5
6
  }
package/dist/esm/web.js CHANGED
@@ -4,5 +4,8 @@ export class PluginWeb extends WebPlugin {
4
4
  async addContact() {
5
5
  return { results: {} };
6
6
  }
7
+ async setScreenCaptureDisabled() {
8
+ return { results: {} };
9
+ }
7
10
  }
8
11
  //# sourceMappingURL=web.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAEtC,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nimport type { Plugin } from './definitions';\nexport class PluginWeb extends WebPlugin implements Plugin {\n\n async addContact(): Promise<any> {\n return { results: {} };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,OAAO,SAAU,SAAQ,SAAS;IAEtC,KAAK,CAAC,UAAU;QACd,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,wBAAwB;QAC5B,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nimport type { Plugin } from './definitions';\nexport class PluginWeb extends WebPlugin implements Plugin {\n\n async addContact(): Promise<any> {\n return { results: {} };\n }\n\n async setScreenCaptureDisabled(): Promise<any> {\n return { results: {} };\n }\n}\n"]}
@@ -13,6 +13,9 @@ class PluginWeb extends core.WebPlugin {
13
13
  async addContact() {
14
14
  return { results: {} };
15
15
  }
16
+ async setScreenCaptureDisabled() {
17
+ return { results: {} };
18
+ }
16
19
  }
17
20
 
18
21
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async addContact() {\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACHD;AAEO,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async addContact() {\n return { results: {} };\n }\n async setScreenCaptureDisabled() {\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;AAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;AAC3D,CAAC;;ACHD;AAEO,MAAM,SAAS,SAASC,cAAS,CAAC;AACzC,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL,IAAI,MAAM,wBAAwB,GAAG;AACrC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC/B,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -10,6 +10,9 @@ var capacitorContact = (function (exports, core) {
10
10
  async addContact() {
11
11
  return { results: {} };
12
12
  }
13
+ async setScreenCaptureDisabled() {
14
+ return { results: {} };
15
+ }
13
16
  }
14
17
 
15
18
  var web = /*#__PURE__*/Object.freeze({
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async addContact() {\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICHD;IAEO,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst HanwhaPlugin = registerPlugin('Plugin', {\n web: () => import('./web').then(m => new m.PluginWeb()),\n});\nexport * from './definitions';\nexport { HanwhaPlugin };\n//# sourceMappingURL=index.js.map","/* eslint-disable @typescript-eslint/no-unused-vars */\nimport { WebPlugin } from '@capacitor/core';\nexport class PluginWeb extends WebPlugin {\n async addContact() {\n return { results: {} };\n }\n async setScreenCaptureDisabled() {\n return { results: {} };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,QAAQ,EAAE;IAC9C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;IAC3D,CAAC;;ICHD;IAEO,MAAM,SAAS,SAASC,cAAS,CAAC;IACzC,IAAI,MAAM,UAAU,GAAG;IACvB,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL,IAAI,MAAM,wBAAwB,GAAG;IACrC,QAAQ,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanwha-ss1/plugin",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",