Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
8e82c762
Commit
8e82c762
authored
Jun 01, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 活体检测逻辑
parent
bb1105be
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
290 additions
and
34 deletions
+290
-34
LifeAccountPersonalAuthData.kt
...nghuoquan/newscontent/bean/LifeAccountPersonalAuthData.kt
+15
-0
Constant.kt
.../com/yidian/shenghuoquan/newscontent/constant/Constant.kt
+8
-0
AuthPersonalGetTokenBean.kt
...uan/newscontent/http/httpbean/AuthPersonalGetTokenBean.kt
+2
-2
IdentifyIdOcrVerifyBean.kt
...quan/newscontent/http/httpbean/IdentifyIdOcrVerifyBean.kt
+2
-2
AliveTestActivity.kt
...an/shenghuoquan/newscontent/ui/alive/AliveTestActivity.kt
+1
-1
LifeAccountAuthDataManager.kt
...huoquan/newscontent/ui/auth/LifeAccountAuthDataManager.kt
+12
-0
LifeAccountIDCardAuthFragment.kt
...quan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
+219
-28
FileUtil.kt
...ava/com/yidian/shenghuoquan/newscontent/utils/FileUtil.kt
+28
-0
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+3
-1
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/LifeAccountPersonalAuthData.kt
0 → 100644
View file @
8e82c762
package
com.yidian.shenghuoquan.newscontent.bean
/**
* author: yinjiacheng
* date: 5/31/21 11:07 PM
* description: 生活号个人认证数据集
*/
class
LifeAccountPersonalAuthData
{
var
realName
:
String
=
""
var
idCardNum
:
String
=
""
var
idCardPortraitFaceObjectKey
:
String
=
""
var
idCardNationalEmblemFaceObjectKey
:
String
=
""
var
liveDetectBizToken
:
String
=
""
var
liveDetectObjectKey
:
String
=
""
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/constant/Constant.kt
View file @
8e82c762
...
@@ -20,6 +20,7 @@ object Constant {
...
@@ -20,6 +20,7 @@ object Constant {
// 调用系统相机、打开系统相册 requestCode
// 调用系统相机、打开系统相册 requestCode
const
val
REQUEST_CODE_OPEN_ALBUM
=
101
const
val
REQUEST_CODE_OPEN_ALBUM
=
101
const
val
REQUEST_CODE_OPEN_CAMERA
=
102
const
val
REQUEST_CODE_OPEN_CAMERA
=
102
// 调用旷视FaceID进行身份证采集 requestCode
// 调用旷视FaceID进行身份证采集 requestCode
const
val
REQUEST_CODE_ID_CARD_CAPTURE
=
103
const
val
REQUEST_CODE_ID_CARD_CAPTURE
=
103
...
@@ -28,8 +29,15 @@ object Constant {
...
@@ -28,8 +29,15 @@ object Constant {
const
val
FILE_PATH_ID_CARD_NATIONAL_EMBLEM_FACE
=
"/ocr/id_card/national_emblem_face.jpg"
const
val
FILE_PATH_ID_CARD_NATIONAL_EMBLEM_FACE
=
"/ocr/id_card/national_emblem_face.jpg"
const
val
FILE_PATH_BUSINESS_LICENSE_CAMERA
=
"/ocr/business_license_camera.jpg"
const
val
FILE_PATH_BUSINESS_LICENSE_CAMERA
=
"/ocr/business_license_camera.jpg"
const
val
FILE_PATH_BUSINESS_LICENSE
=
"/ocr/business_license.jpg"
const
val
FILE_PATH_BUSINESS_LICENSE
=
"/ocr/business_license.jpg"
const
val
FILE_PATH_ALIVE_DETECT_VERIFY_DATA
=
"/alive_detect/verify"
// 身份证人像面、身份证国徽面标识
// 身份证人像面、身份证国徽面标识
const
val
ID_CARD_PORTRAIT_FACE
=
1
const
val
ID_CARD_PORTRAIT_FACE
=
1
const
val
ID_CARD_NATIONAL_EMBLEM_FACE
=
2
const
val
ID_CARD_NATIONAL_EMBLEM_FACE
=
2
// 活体验证流程
const
val
TYPE_MEG_LIVE
=
"meglive"
// 动作活体
const
val
TYPE_STILL
=
"still"
// 静默活体
const
val
TYPE_FLASH
=
"flash"
// 炫彩活体,通过打光进行活体验证,炫彩活体相较于静默活体安全性更高,但通过率会略有降低
const
val
TYPE_RAW_IMAGE
=
"raw_image"
// 不进行活体验证,仅使用上传的图片进行后续的比对
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthPersonalGetTokenBean.kt
View file @
8e82c762
package
com.yidian.shenghuoquan.newscontent.http.httpbean
package
com.yidian.shenghuoquan.newscontent.http.httpbean
class
AuthPersonalGetTokenBean
(
va
r
request
:
Request
,
val
response
:
Response
)
{
class
AuthPersonalGetTokenBean
(
va
l
request
:
Request
,
val
response
:
Response
)
{
data class
Request
(
va
r
id_number
:
String
,
var
id_card_name
:
String
,
var
liveness_type
:
String
,
var
biz_no
:
String
)
data class
Request
(
va
l
id_number
:
String
,
val
id_card_name
:
String
,
val
liveness_type
:
String
)
data class
Response
(
val
biz_token
:
String
)
data class
Response
(
val
biz_token
:
String
)
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/IdentifyIdOcrVerifyBean.kt
View file @
8e82c762
package
com.yidian.shenghuoquan.newscontent.http.httpbean
package
com.yidian.shenghuoquan.newscontent.http.httpbean
class
IdentifyIdOcrVerifyBean
(
va
r
request
:
Request
,
val
response
:
Response
)
{
class
IdentifyIdOcrVerifyBean
(
va
l
request
:
Request
,
val
response
:
Response
)
{
data class
Request
(
va
r
biz_token
:
String
,
var
meglive_objectid
:
String
)
data class
Request
(
va
l
biz_token
:
String
,
val
meglive_objectid
:
String
)
data class
Response
(
val
verify_result
:
Boolean
)
data class
Response
(
val
verify_result
:
Boolean
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/alive/AliveTestActivity.kt
View file @
8e82c762
...
@@ -67,7 +67,7 @@ class AliveTestActivity : BaseActivity<ActivityAliveLayoutBinding>(), PreCallbac
...
@@ -67,7 +67,7 @@ class AliveTestActivity : BaseActivity<ActivityAliveLayoutBinding>(), PreCallbac
private
fun
setOnListener
()
{
private
fun
setOnListener
()
{
viewBind
.
btActionYy
.
setOnClickListener
{
viewBind
.
btActionYy
.
setOnClickListener
{
val
requestParams
:
AuthPersonalGetTokenBean
.
Request
=
AuthPersonalGetTokenBean
.
Request
(
val
requestParams
:
AuthPersonalGetTokenBean
.
Request
=
AuthPersonalGetTokenBean
.
Request
(
idCardNo
!!
,
idCardName
!!
,
"meglive"
,
AppConfig
.
appid
)
idCardNo
!!
,
idCardName
!!
,
"meglive"
)
ApiService
.
authPersonalGetToken
(
authPersonalGetTokenCallback
,
requestParams
)
ApiService
.
authPersonalGetToken
(
authPersonalGetTokenCallback
,
requestParams
)
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountAuthDataManager.kt
0 → 100644
View file @
8e82c762
package
com.yidian.shenghuoquan.newscontent.ui.auth
import
com.yidian.shenghuoquan.newscontent.bean.LifeAccountPersonalAuthData
/**
* author: yinjiacheng
* date: 6/1/21 2:02 AM
* description: 生活号认证数据管理
*/
object
LifeAccountAuthDataManager
{
val
personalAuthData
by
lazy
{
LifeAccountPersonalAuthData
()
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
View file @
8e82c762
This diff is collapsed.
Click to expand it.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/utils/FileUtil.kt
View file @
8e82c762
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.utils
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.utils
import
android.content.Context
import
android.content.Context
import
android.net.Uri
import
android.net.Uri
import
java.io.File
import
java.io.FileOutputStream
import
java.io.FileOutputStream
/**
/**
...
@@ -21,4 +22,31 @@ object FileUtil {
...
@@ -21,4 +22,31 @@ object FileUtil {
context
?.
contentResolver
?.
openInputStream
(
uri
)
?.
copyTo
(
FileOutputStream
(
path
))
context
?.
contentResolver
?.
openInputStream
(
uri
)
?.
copyTo
(
FileOutputStream
(
path
))
}
}
}
}
/**
* 从assets中复制文件到指定路径
* @param assetFileName assets中文件名
* @param destPath 目标路径
*/
fun
copyFileFromAssets
(
context
:
Context
?,
assetFileName
:
String
,
destPath
:
String
)
{
val
file
=
File
(
destPath
)
if
(
file
.
exists
())
file
.
delete
()
file
.
parentFile
?.
mkdirs
()
file
.
createNewFile
()
context
?.
assets
?.
open
(
assetFileName
)
?.
copyTo
(
FileOutputStream
(
file
))
}
/**
* 从String生成File
* @param data 待写入的String
* @param destPath 目标路径
*/
fun
generateFileFromString
(
data
:
String
?,
destPath
:
String
)
{
if
(
data
.
isNullOrEmpty
())
return
val
file
=
File
(
destPath
)
if
(
file
.
exists
())
file
.
delete
()
file
.
parentFile
?.
mkdirs
()
file
.
createNewFile
()
File
(
destPath
).
writeText
(
data
)
}
}
}
\ No newline at end of file
Components/newscontent/src/main/res/values/strings.xml
View file @
8e82c762
...
@@ -99,7 +99,9 @@
...
@@ -99,7 +99,9 @@
<string
name=
"check_id_card_number"
>
请核对证件号码
</string>
<string
name=
"check_id_card_number"
>
请核对证件号码
</string>
<string
name=
"face_auth"
>
人脸验证
</string>
<string
name=
"face_auth"
>
人脸验证
</string>
<string
name=
"start_face_auth"
>
去验证
</string>
<string
name=
"start_face_auth"
>
去验证
</string>
<string
name=
"face_auth_fail"
>
人脸识别失败,请重新识别
</string>
<string
name=
"face_auth_success"
>
验证通过
</string>
<string
name=
"face_auth_fail"
>
验证未通过
</string>
<string
name=
"face_auth_error_tips"
>
人脸识别失败,请重新识别
</string>
<string
name=
"agree"
>
我同意
</string>
<string
name=
"agree"
>
我同意
</string>
<string
name=
"privacy_certification"
>
《隐私认证》
</string>
<string
name=
"privacy_certification"
>
《隐私认证》
</string>
<string
name=
"user_agreement"
>
《用户协议》
</string>
<string
name=
"user_agreement"
>
《用户协议》
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment