@hanwha-ss1/plugin 0.2.9 → 0.3.0

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.
@@ -58,7 +58,7 @@ public class BioAuthManager {
58
58
  Intent intent;
59
59
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
60
60
  BiometricManager biometricManager = BiometricManager.from(activity);
61
- switch (biometricManager.canAuthenticate(BIOMETRIC_STRONG)) {
61
+ switch (biometricManager.canAuthenticate(DEVICE_CREDENTIAL)) {
62
62
  case BiometricManager.BIOMETRIC_SUCCESS:
63
63
  Log.d("MY_APP_TAG", "App can authenticate using biometrics.");
64
64
  return true;
@@ -72,10 +72,10 @@ public class BioAuthManager {
72
72
  // Prompts the user to create credentials that your app accepts.
73
73
  Log.d("MY_APP_TAG", "enrolled biometric doesn't existed. please enroll");
74
74
 
75
- intent = new Intent(Settings.ACTION_FINGERPRINT_ENROLL);
76
- intent.putExtra(Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED,
77
- BIOMETRIC_STRONG | DEVICE_CREDENTIAL);
78
- activity.startActivityForResult(intent, REQUEST_FINGERPRINT_ENROLLMENT_AUTH);
75
+ // intent = new Intent(Settings.ACTION_FINGERPRINT_ENROLL);
76
+ // intent.putExtra(Settings.EXTRA_BIOMETRIC_AUTHENTICATORS_ALLOWED,
77
+ // BIOMETRIC_STRONG | DEVICE_CREDENTIAL);
78
+ // activity.startActivityForResult(intent, REQUEST_FINGERPRINT_ENROLLMENT_AUTH);
79
79
  return false;
80
80
  }
81
81
  } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
@@ -97,8 +97,8 @@ public class BioAuthManager {
97
97
  // 등록된 지문이 없는 경우
98
98
  else if (!fingerprintManager.hasEnrolledFingerprints()) {
99
99
  Log.d("fingerprint", "please enroll fingerprint");
100
- intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
101
- activity.startActivityForResult(intent, REQUEST_FINGERPRINT_ENROLLMENT_AUTH);
100
+ // intent = new Intent(Settings.ACTION_SECURITY_SETTINGS);
101
+ // activity.startActivityForResult(intent, REQUEST_FINGERPRINT_ENROLLMENT_AUTH);
102
102
  return false;
103
103
  }
104
104
  return true;
@@ -151,13 +151,13 @@ public class BioAuthManager {
151
151
  // DEVICE_CREDENTIAL 및 BIOMETRIC_STRING | DEVICE_CREDENTIAL 은 안드로이드 10 이하에서 지원되지 않는다.
152
152
  // 안드로이드 10 이하에서 PIN 이나 패턴, 비밀번호가 있는지 확인하려면 KeyguardManager.isDeviceSecure() 함수를 사용할 것
153
153
  promptInfo = new BiometricPrompt.PromptInfo.Builder()
154
- .setTitle("지문 인증")
155
- .setSubtitle("기기에 등록된 지문을 이용하여 지문을 인증해주세요.")
156
- .setDescription("생체 인증")
154
+ .setTitle("생체 인증")
155
+ .setSubtitle("기기에 등록된 생체 인증을 이용하여 인증해주세요.")
156
+ // .setDescription("생체 인증")
157
157
  // BIOMETRIC_STRONG 은 안드로이드 11 에서 정의한 클래스 3 생체 인식을 사용하는 인증 - 암호회된 키 필요
158
158
  // BIOMETRIC_WEAK 은 안드로이드 11 에서 정의한 클래스 2 생체 인식을 사용하는 인증 - 암호화된 키까지 필요하지는 않음
159
159
  // DEVICE_CREDENTIAL 은 화면 잠금 사용자 인증 정보를 사용하는 인증 - 사용자의 PIN, 패턴 또는 비밀번호
160
- .setAllowedAuthenticators(BIOMETRIC_STRONG)
160
+ // .setAllowedAuthenticators(DEVICE_CREDENTIAL)
161
161
  .setConfirmationRequired(false) // 명시적인 사용자 작업 ( 생체 인식 전 한번더 체크 ) 없이 인증할건지 default : true
162
162
  .setNegativeButtonText("취소")
163
163
  .build();
@@ -19,33 +19,4 @@ public class ContactPlugin extends Plugin{
19
19
  ret.put("value", implementation.echo(value));
20
20
  call.resolve(ret);
21
21
  }
22
-
23
- @PluginMethod
24
- public void addContact(PluginCall call) {
25
- String name = call.getString("name");
26
- String mobile = call.getString("phone");
27
- String phone = call.getString("ext");
28
- String department = call.getString("dept");
29
- String email = call.getString("email");
30
- if(implementation == null) {
31
- implementation = new Contact();
32
- }
33
- implementation.save(getActivity(), name, email, mobile, phone, department, new Contact.OnResult() {
34
- @Override
35
- public void onSuccess() {
36
- JSObject ret = new JSObject();
37
- ret.put("result", true);
38
- ret.put("message", "완료");
39
- call.resolve(ret);
40
- }
41
-
42
- @Override
43
- public void onFail() {
44
- JSObject ret = new JSObject();
45
- ret.put("result", false);
46
- ret.put("message", "존재하는 번호입니다.");
47
- call.resolve(ret);
48
- }
49
- });
50
- }
51
22
  }
@@ -6,12 +6,16 @@ import com.getcapacitor.PluginCall;
6
6
  import com.getcapacitor.PluginMethod;
7
7
  import com.getcapacitor.annotation.CapacitorPlugin;
8
8
  import com.plugin.bio.Bio;
9
+ import com.plugin.contact.Contact;
10
+ import com.plugin.openbrowser.OpenBrowser;
9
11
 
10
12
 
11
13
  @CapacitorPlugin(name = "Plugin")
12
14
  public class LinkerPlugin extends Plugin{
13
15
  private Linker implementation = new Linker();
14
16
  private Bio bioImplementation = new Bio();
17
+ private Contact contactImplementation = new Contact();
18
+ private OpenBrowser openBrowserImplementation = new OpenBrowser();
15
19
 
16
20
  @PluginMethod
17
21
  public void echo(PluginCall call) {
@@ -71,4 +75,43 @@ public class LinkerPlugin extends Plugin{
71
75
  }
72
76
  });
73
77
  }
78
+
79
+ @PluginMethod
80
+ public void addContact(PluginCall call) {
81
+ String name = call.getString("name");
82
+ String mobile = call.getString("phone");
83
+ String phone = call.getString("ext");
84
+ String department = call.getString("dept");
85
+ String email = call.getString("email");
86
+ if(contactImplementation == null) {
87
+ contactImplementation = new Contact();
88
+ }
89
+ contactImplementation.save(getActivity(), name, email, mobile, phone, department, new Contact.OnResult() {
90
+ @Override
91
+ public void onSuccess() {
92
+ JSObject ret = new JSObject();
93
+ ret.put("result", true);
94
+ ret.put("message", "완료");
95
+ call.resolve(ret);
96
+ }
97
+
98
+ @Override
99
+ public void onFail() {
100
+ JSObject ret = new JSObject();
101
+ ret.put("result", false);
102
+ ret.put("message", "존재하는 번호입니다.");
103
+ call.resolve(ret);
104
+ }
105
+ });
106
+ }
107
+
108
+ @PluginMethod
109
+ public void open(PluginCall call) {
110
+ String url = call.getString("url");
111
+ boolean isExternal = call.getBoolean("ext");
112
+ if(openBrowserImplementation == null) {
113
+ openBrowserImplementation = new OpenBrowser();
114
+ }
115
+ openBrowserImplementation.open(getActivity(), url, isExternal);
116
+ }
74
117
  }
@@ -19,14 +19,4 @@ public class OpenBrowserPlugin extends Plugin {
19
19
  ret.put("value", implementation.echo(value));
20
20
  call.resolve(ret);
21
21
  }
22
-
23
- @PluginMethod
24
- public void open(PluginCall call) {
25
- String url = call.getString("url");
26
- boolean isExternal = call.getBoolean("ext");
27
- if(implementation == null) {
28
- implementation = new OpenBrowser();
29
- }
30
- implementation.open(getActivity(), url, isExternal);
31
- }
32
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanwha-ss1/plugin",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "Plugin",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",