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
ee6be16c
Commit
ee6be16c
authored
Jun 07, 2021
by
zhenghongbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 网络框架加密
parent
7f18ade4
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
242 additions
and
137 deletions
+242
-137
AppConfig.kt
...onLib/Common/src/main/java/com/yidian/common/AppConfig.kt
+1
-0
HttpDecryptResult.kt
...src/main/java/com/yidian/common/http/HttpDecryptResult.kt
+13
-0
HttpParamsUtils.kt
...n/src/main/java/com/yidian/common/http/HttpParamsUtils.kt
+57
-15
HttpResultSubscriber.kt
.../main/java/com/yidian/common/http/HttpResultSubscriber.kt
+11
-14
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+1
-1
CreateLifeAccountBean.kt
...an/shenghuoquan/newscontent/bean/CreateLifeAccountBean.kt
+3
-3
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+71
-38
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+12
-12
FlashActivity.kt
...a/com/yidian/shenghuoquan/newscontent/ui/FlashActivity.kt
+16
-5
LifeAccountEnterpriseCertificationActivity.kt
...scontent/ui/LifeAccountEnterpriseCertificationActivity.kt
+3
-2
LiveAccountCreateActivity.kt
.../shenghuoquan/newscontent/ui/LiveAccountCreateActivity.kt
+5
-2
LoginLifeCircleActivity.kt
...an/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
+5
-4
MainActivity.kt
...va/com/yidian/shenghuoquan/newscontent/ui/MainActivity.kt
+7
-2
AliveTestActivity.kt
...an/shenghuoquan/newscontent/ui/alive/AliveTestActivity.kt
+7
-3
LifeAccountBusinessLicenseAuthFragment.kt
...content/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
+3
-2
LifeAccountIDCardAuthFragment.kt
...quan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
+13
-21
IDCardTestActivity.kt
.../shenghuoquan/newscontent/ui/idcard/IDCardTestActivity.kt
+5
-2
KS3Core.kt
...java/com/yidian/shenghuoquan/newscontent/utils/KS3Core.kt
+8
-10
libXDiamond.so
app/libs/arm64-v8a/libXDiamond.so
+0
-0
libXDiamond.so
app/libs/armeabi-v7a/libXDiamond.so
+0
-0
libXDiamond.so
app/libs/x86/libXDiamond.so
+0
-0
libXDiamond.so
app/libs/x86_64/libXDiamond.so
+0
-0
config.gradle
config/config.gradle
+1
-1
No files found.
CommonLib/Common/src/main/java/com/yidian/common/AppConfig.kt
View file @
ee6be16c
...
@@ -3,6 +3,7 @@ package com.yidian.common
...
@@ -3,6 +3,7 @@ package com.yidian.common
class
AppConfig
{
class
AppConfig
{
companion
object
{
companion
object
{
//生活圈项目
//生活圈项目
const
val
IS_ENCRYPT
=
false
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const
val
KUANGSHI_ALIVE_API_KEY
=
"32f9XIsReV4S15Ck_Sa3ky43XgAHUB9v"
const
val
KUANGSHI_SECRET
=
"usZbQYdI4PQeXhMftsRfHK2msj0DmSIl"
const
val
KUANGSHI_SECRET
=
"usZbQYdI4PQeXhMftsRfHK2msj0DmSIl"
...
...
CommonLib/Common/src/main/java/com/yidian/common/http/HttpDecryptResult.kt
0 → 100644
View file @
ee6be16c
package
com.yidian.common.http
/**
* create by Administrator
* date 2019/2/12 0012
* desc
*/
class
HttpDecryptResult
<
T
>
{
lateinit
var
secret
:
String
lateinit
var
reqid
:
String
var
ts
:
Long
=
0
var
data
:
T
?
=
null
}
\ No newline at end of file
CommonLib/Common/src/main/java/com/yidian/common/http/HttpParamsUtils.kt
View file @
ee6be16c
package
com.yidian.common.http
package
com.yidian.common.http
import
com.google.gson.Gson
import
com.google.gson.reflect.TypeToken
import
com.yidian.common.AppConfig
import
com.yidian.common.AppConfig
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.utils.EncryptUtil
import
com.yidian.common.utils.NetWorkUtils
import
com.yidian.common.utils.NetWorkUtils
import
com.yidian.framework.mobile.xdiamond.SecretUtil
import
com.yidian.utils.LogUtil
import
com.yidian.utils.ToastUtil
import
com.yidian.yac.ftdevicefinger.core.FtDeviceFingerManager
import
com.yidian.yac.ftdevicefinger.core.FtDeviceFingerManager
class
HttpParamsUtils
{
class
HttpParamsUtils
{
companion
object
{
companion
object
{
fun
getP
aramsMap
(
):
HashMap
<
String
,
String
>{
fun
getP
ublicParamsMap
(
timeStamp
:
Long
):
HashMap
<
String
,
String
>{
val
networkType
=
NetWorkUtils
.
getNetWorkType
(
YdBaseApplication
.
context
)
val
networkType
=
NetWorkUtils
.
getNetWorkType
(
YdBaseApplication
.
context
)
val
timeStamp
=
System
.
currentTimeMillis
()
val
queryParamsMap
=
HashMap
<
String
,
String
>()
val
queryParamsMap
=
HashMap
<
String
,
String
>()
queryParamsMap
[
"appid"
]
=
AppConfig
.
appid
queryParamsMap
[
"appid"
]
=
AppConfig
.
appid
queryParamsMap
[
"cv"
]
=
AppConfig
.
cv
queryParamsMap
[
"cv"
]
=
AppConfig
.
cv
...
@@ -23,6 +26,54 @@ class HttpParamsUtils{
...
@@ -23,6 +26,54 @@ class HttpParamsUtils{
return
queryParamsMap
return
queryParamsMap
}
}
fun
getPrivateParamsMap
(
paramsMap
:
HashMap
<
String
,
String
?
>,
timeStamp
:
Long
):
HashMap
<
String
,
String
?
>{
return
if
(
AppConfig
.
IS_ENCRYPT
){
val
reqId
=
getRequestId
(
timeStamp
)
paramsMap
[
"secret"
]
=
getSignString
(
reqId
,
timeStamp
)
paramsMap
[
"ts"
]
=
timeStamp
.
toString
()
val
paramsJson
=
Gson
().
toJson
(
paramsMap
)
LogUtil
.
show
(
"请求参数:$paramsJson"
)
val
tok
=
SecretUtil
.
rsaEncrypt
(
paramsJson
)
val
queryParamsMap
=
HashMap
<
String
,
String
?>()
queryParamsMap
[
"tok"
]
=
tok
queryParamsMap
}
else
{
paramsMap
}
}
fun
<
T
>
rsaDecryptResult
(
res
:
HttpResult
<
Any
?
>):
HttpResult
<
T
>{
val
rsaResult
=
res
.
result
val
decodeResult
=
HttpResult
<
T
>()
decodeResult
.
code
=
res
.
code
decodeResult
.
reason
=
res
.
reason
decodeResult
.
status
=
res
.
status
if
(
rsaResult
!=
null
){
val
gson
=
Gson
()
if
(
AppConfig
.
IS_ENCRYPT
){
val
result
=
SecretUtil
.
rsaDecrypt
(
rsaResult
as
String
)
LogUtil
.
show
(
"返回参数:$result"
)
val
decryptResult
=
gson
.
fromJson
<
HttpDecryptResult
<
T
>>(
result
,
object
:
TypeToken
<
HttpDecryptResult
<
T
>>(){}.
type
)
val
verifyParams
=
decryptResult
.
reqid
+
decryptResult
.
ts
val
secretNet
=
decryptResult
.
secret
val
verify
=
SecretUtil
.
verifySign
(
verifyParams
,
secretNet
)
return
if
(
verify
){
LogUtil
.
show
(
"===============验签成功=================="
)
decodeResult
.
result
=
decryptResult
.
data
decodeResult
}
else
{
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
"验签失败"
)
decodeResult
}
}
else
{
val
resultJson
=
gson
.
toJson
(
rsaResult
)
decodeResult
.
result
=
gson
.
fromJson
<
T
>(
resultJson
,
object
:
TypeToken
<
T
>(){}.
type
)
return
decodeResult
}
}
return
decodeResult
}
private
fun
getDeviceFinger
():
String
{
private
fun
getDeviceFinger
():
String
{
var
deviceFinger
=
""
var
deviceFinger
=
""
val
tempId
=
FtDeviceFingerManager
.
getDeviceFinger
()
val
tempId
=
FtDeviceFingerManager
.
getDeviceFinger
()
...
@@ -42,19 +93,10 @@ class HttpParamsUtils{
...
@@ -42,19 +93,10 @@ class HttpParamsUtils{
return
sb
.
toString
()
return
sb
.
toString
()
}
}
private
fun
getSignString
(
timeStamp
:
Long
):
String
{
private
fun
getSignString
(
reqId
:
String
,
timeStamp
:
Long
):
String
?
{
val
sb
=
StringBuilder
()
val
sb
=
StringBuilder
()
sb
.
append
(
AppConfig
.
appid
)
sb
.
append
(
reqId
).
append
(
timeStamp
)
sb
.
append
(
AppConfig
.
platform
)
return
SecretUtil
.
sign
(
sb
.
toString
())
sb
.
append
(
getDeviceFinger
())
sb
.
append
(
getRequestId
(
timeStamp
))
sb
.
append
(
"ydapp-metro"
)
val
signMD5
=
EncryptUtil
.
getMD5
(
sb
.
toString
())
return
if
(
signMD5
.
length
>
8
){
signMD5
.
substring
(
0
,
8
)
}
else
{
signMD5
}
}
}
}
}
}
}
\ No newline at end of file
CommonLib/Common/src/main/java/com/yidian/common/http/HttpResultSubscriber.kt
View file @
ee6be16c
...
@@ -12,7 +12,7 @@ import io.reactivex.rxjava3.core.Observer
...
@@ -12,7 +12,7 @@ import io.reactivex.rxjava3.core.Observer
import
io.reactivex.rxjava3.disposables.Disposable
import
io.reactivex.rxjava3.disposables.Disposable
import
kotlin.reflect.typeOf
import
kotlin.reflect.typeOf
abstract
class
HttpResultSubscriber
<
T
>(
private
var
showProgress
:
Boolean
=
false
)
:
Observer
<
HttpResult
<
T
>?
>
{
abstract
class
HttpResultSubscriber
<
T
>(
private
var
showProgress
:
Boolean
=
false
)
:
Observer
<
HttpResult
<
Any
?
>
>
{
private
var
isShowErrorMsg
=
true
private
var
isShowErrorMsg
=
true
override
fun
onSubscribe
(
d
:
Disposable
)
{
//网络请求之前
override
fun
onSubscribe
(
d
:
Disposable
)
{
//网络请求之前
...
@@ -48,20 +48,17 @@ abstract class HttpResultSubscriber<T>(private var showProgress: Boolean = false
...
@@ -48,20 +48,17 @@ abstract class HttpResultSubscriber<T>(private var showProgress: Boolean = false
onRequestFailure
(
Exception
(
e
.
toString
()))
onRequestFailure
(
Exception
(
e
.
toString
()))
}
}
override
fun
onNext
(
res
:
HttpResult
<
T
>?)
{
override
fun
onNext
(
res
:
HttpResult
<
Any
?
>)
{
if
(
res
?.
code
==
0
)
{
if
(
res
.
code
==
0
)
{
// val result = res.result as String
val
decodeResult
=
HttpParamsUtils
.
rsaDecryptResult
<
T
>(
res
)
// val resultObj = Gson().fromJson<T>(result, object: TypeToken<T>(){}.type)
onRequestSuccess
(
decodeResult
)
// val decodeResult = HttpResult<T>()
// decodeResult.code = res.code
// decodeResult.reason = res.reason
// decodeResult.status = res.status
// decodeResult.result = resultObj
// onRequestSuccess(decodeResult)
onRequestSuccess
(
res
)
}
else
{
}
else
{
onFailer
(
res
)
val
decodeResult
=
HttpResult
<
T
>()
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
res
?.
reason
)
decodeResult
.
code
=
res
.
code
decodeResult
.
reason
=
res
.
reason
decodeResult
.
status
=
res
.
status
onFailer
(
decodeResult
)
ToastUtil
.
showToast
(
YdBaseApplication
.
context
,
res
.
reason
)
}
}
}
}
...
...
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
ee6be16c
...
@@ -6,7 +6,7 @@ class URLs {
...
@@ -6,7 +6,7 @@ class URLs {
companion
object
{
companion
object
{
val
BASE_URL
:
String
val
BASE_URL
:
String
private
const
val
BASE_URL_DEBUG
=
"http://bp-
test
.go2yd.com"
private
const
val
BASE_URL_DEBUG
=
"http://bp-
dev
.go2yd.com"
private
const
val
BASE_URL_PRO
=
"http://bp-test.go2yd.com"
private
const
val
BASE_URL_PRO
=
"http://bp-test.go2yd.com"
init
{
init
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/CreateLifeAccountBean.kt
View file @
ee6be16c
...
@@ -7,8 +7,8 @@ class CreateLifeAccountBean {
...
@@ -7,8 +7,8 @@ class CreateLifeAccountBean {
* user_id 是 str 用id
* user_id 是 str 用id
*/
*/
data class
Request
(
data class
Request
(
var
life_account_name
:
String
,
var
life_account_name
:
String
,
var
code
:
String
,
var
code
:
String
,
var
user_id
:
String
var
user_id
:
String
)
)
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
ee6be16c
This diff is collapsed.
Click to expand it.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/CommonService.kt
View file @
ee6be16c
...
@@ -16,47 +16,47 @@ interface CommonService {
...
@@ -16,47 +16,47 @@ interface CommonService {
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
pushTokenAndroid
)
@POST
(
URLs
.
pushTokenAndroid
)
fun
pushTokenAndroid
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
PushTokenAndroidBean
.
Request
):
Observable
<
HttpResult
<
Any
?
>>
fun
pushTokenAndroid
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>
):
Observable
<
HttpResult
<
Any
?
>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
authPersonalGetToken
)
@POST
(
URLs
.
authPersonalGetToken
)
fun
authPersonalGetToken
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
AuthPersonalGetTokenBean
.
Request
):
Observable
<
HttpResult
<
AuthPersonalGetTokenBean
.
Response
?
>>
fun
authPersonalGetToken
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
// @(URLs.authPersonalGetToken)
// @(URLs.authPersonalGetToken)
// fun authPersonalGetToken(@QueryMap commonParams: Map<String, String>, @QueryMap requestParams: Map<String, String>): Observable<HttpResult<Any?>>
// fun authPersonalGetToken(@QueryMap commonParams: Map<String, String>, @QueryMap requestParams: Map<String, String>): Observable<HttpResult<Any?>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
getKSYunToken
)
@POST
(
URLs
.
getKSYunToken
)
fun
getKSYunToken
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
GetKSYunTokenBean
.
Request
):
Call
<
HttpResult
<
GetKSYunTokenBean
.
Response
>>
fun
getKSYunToken
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>):
Call
<
HttpResult
<
Any
?
>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
getIDCardOCR
)
@POST
(
URLs
.
getIDCardOCR
)
fun
getIDCardOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
GetIDCardOCRBean
.
Request
):
Observable
<
HttpResult
<
GetIDCardOCRBean
.
Response
>>
fun
getIDCardOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
identifyIdOcrVerify
)
@POST
(
URLs
.
identifyIdOcrVerify
)
fun
identifyIdOcrVerify
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
IdentifyIdOcrVerifyBean
.
Request
):
Observable
<
HttpResult
<
IdentifyIdOcrVerifyBean
.
Response
?
>>
fun
identifyIdOcrVerify
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
getKSYunObjectId
)
@GET
(
URLs
.
getKSYunObjectId
)
fun
getKSYunObjectId
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
GetKSYunObjectIdBean
.
Response
>>
fun
getKSYunObjectId
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
getKSYunBucket
)
@GET
(
URLs
.
getKSYunBucket
)
fun
getKSYunBucket
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
GetKSYunBucketBean
.
Response
>>
fun
getKSYunBucket
(
@QueryMap
commonParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
Any
?
>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
businessLicenseOCR
)
@POST
(
URLs
.
businessLicenseOCR
)
fun
businessLicenseOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
BusinessLicenseOCRBean
.
Request
)
:
Observable
<
HttpResult
<
BusinessLicenseOCRBean
.
Response
>>
fun
businessLicenseOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>)
:
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
sendMsgCode
)
@GET
(
URLs
.
sendMsgCode
)
fun
sendMsgCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
Any
?
>>
fun
sendMsgCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
mobileLogin
)
@GET
(
URLs
.
mobileLogin
)
fun
mobileLogin
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
MobileLoginBean
.
Response
?
>>
fun
mobileLogin
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
?
>):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
accountList
)
@GET
(
URLs
.
accountList
)
fun
getAccountList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
A
rrayList
<
AccountItemBean
>
?>>
fun
getAccountList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
A
ny
?
>>
@Headers
(
"Content-Type: application/json"
)
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
createLifeAccount
)
@POST
(
URLs
.
createLifeAccount
)
fun
createLifeAccount
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
CreateLifeAccountBean
.
Request
)
:
Observable
<
HttpResult
<
Any
?>>
fun
createLifeAccount
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
Map
<
String
,
String
?
>
)
:
Observable
<
HttpResult
<
Any
?>>
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/FlashActivity.kt
View file @
ee6be16c
...
@@ -30,21 +30,32 @@ class FlashActivity: BaseActivity<ActivityFlashBinding>() {
...
@@ -30,21 +30,32 @@ class FlashActivity: BaseActivity<ActivityFlashBinding>() {
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
getPermissions
()
viewBind
.
clRoot
.
postDelayed
({
XPageManager
.
push
(
XRouterPathConstants
.
LOGIN_LIFE_CIRCLE
,
null
)
finish
()
},
2000
)
}
}
override
fun
onPostCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onPostCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onPostCreate
(
savedInstanceState
)
super
.
onPostCreate
(
savedInstanceState
)
launcher
()
//
launcher()
}
}
private
fun
launcher
(){
private
fun
launcher
(){
val
isAgree
=
Hawk
.
get
<
Boolean
>(
HawkConfig
.
ProtocolIsAgree
,
false
)
val
isAgree
=
Hawk
.
get
<
Boolean
>(
HawkConfig
.
ProtocolIsAgree
,
false
)
if
(
isAgree
){
if
(
isAgree
){
val
loginStatus
=
Hawk
.
get
(
HawkConfig
.
LoginStatus
,
false
)
if
(
loginStatus
){
//跳转管理页
}
else
{
viewBind
.
clRoot
.
postDelayed
({
viewBind
.
clRoot
.
postDelayed
({
XPageManager
.
push
(
XRouterPathConstants
.
LOGIN_LIFE_CIRCLE
,
null
)
XPageManager
.
push
(
XRouterPathConstants
.
LOGIN_LIFE_CIRCLE
,
null
)
finish
()
},
2000
)
},
2000
)
}
}
}
else
{
//调起协议dialog
}
}
}
private
fun
getPermissions
()
{
private
fun
getPermissions
()
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LifeAccountEnterpriseCertificationActivity.kt
View file @
ee6be16c
...
@@ -115,7 +115,8 @@ class LifeAccountEnterpriseCertificationActivity :
...
@@ -115,7 +115,8 @@ class LifeAccountEnterpriseCertificationActivity :
}
}
override
fun
onTaskSuccess
(
bucket
:
String
?,
objectKey
:
String
?)
{
override
fun
onTaskSuccess
(
bucket
:
String
?,
objectKey
:
String
?)
{
val
request
=
BusinessLicenseOCRBean
.
Request
(
objectKey
)
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"business_image_objectid"
]
=
objectKey
ApiService
.
businessLicenseOCR
(
object
:
IBusinessLicenseOCRCallback
{
ApiService
.
businessLicenseOCR
(
object
:
IBusinessLicenseOCRCallback
{
override
fun
businessLicenseOCRSuccess
(
result
:
BusinessLicenseOCRBean
.
Response
?)
{
override
fun
businessLicenseOCRSuccess
(
result
:
BusinessLicenseOCRBean
.
Response
?)
{
Log
.
d
(
TAG
,
"name: ${result?.name}, code: ${result?.code}"
)
Log
.
d
(
TAG
,
"name: ${result?.name}, code: ${result?.code}"
)
...
@@ -126,7 +127,7 @@ class LifeAccountEnterpriseCertificationActivity :
...
@@ -126,7 +127,7 @@ class LifeAccountEnterpriseCertificationActivity :
}
}
},
request
)
},
request
Params
)
}
}
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LiveAccountCreateActivity.kt
View file @
ee6be16c
...
@@ -96,8 +96,11 @@ class LiveAccountCreateActivity : BaseActivity<ActivityCreateAccountBinding>(),
...
@@ -96,8 +96,11 @@ class LiveAccountCreateActivity : BaseActivity<ActivityCreateAccountBinding>(),
ToastUtil
.
showToast
(
this
,
"生活号信息异常,请退出重试!"
)
ToastUtil
.
showToast
(
this
,
"生活号信息异常,请退出重试!"
)
return
return
}
}
val
request
=
CreateLifeAccountBean
.
Request
(
accountName
,
enterpriseCode
,
userId
)
val
requestParams
=
HashMap
<
String
,
String
?>()
ApiService
.
createLifeAccount
(
this
,
request
)
requestParams
[
"life_account_name"
]
=
accountName
requestParams
[
"code"
]
=
enterpriseCode
requestParams
[
"user_id"
]
=
userId
ApiService
.
createLifeAccount
(
this
,
requestParams
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
View file @
ee6be16c
package
com.yidian.shenghuoquan.newscontent.ui
package
com.yidian.shenghuoquan.newscontent.ui
import
android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
com.orhanobut.hawk.Hawk
import
com.orhanobut.hawk.Hawk
import
com.yidian.common.HawkConfig
import
com.yidian.common.HawkConfig
...
@@ -12,7 +11,9 @@ import com.yidian.common.widget.EditTextInputCallback
...
@@ -12,7 +11,9 @@ import com.yidian.common.widget.EditTextInputCallback
import
com.yidian.common.widget.PhoneNumberTextWatcher
import
com.yidian.common.widget.PhoneNumberTextWatcher
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLoginBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLoginBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AccountItemBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IMobileLoginCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.MobileLoginBean
import
com.yidian.shenghuoquan.newscontent.utils.CountDownTimerUtils
import
com.yidian.shenghuoquan.newscontent.utils.CountDownTimerUtils
import
com.yidian.shenghuoquan.newscontent.utils.TextWatcherAdapter
import
com.yidian.shenghuoquan.newscontent.utils.TextWatcherAdapter
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
...
@@ -52,7 +53,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
...
@@ -52,7 +53,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
viewBind
.
tvGetCode
.
setOnClickListener
{
viewBind
.
tvGetCode
.
setOnClickListener
{
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
if
(
mobile
.
length
==
11
){
if
(
mobile
.
length
==
11
){
val
paramsMap
=
HashMap
<
String
,
String
>()
val
paramsMap
=
HashMap
<
String
,
String
?
>()
paramsMap
[
"mobile"
]
=
mobile
paramsMap
[
"mobile"
]
=
mobile
ApiService
.
sendMsgCode
(
loginImpl
,
paramsMap
)
ApiService
.
sendMsgCode
(
loginImpl
,
paramsMap
)
}
else
{
}
else
{
...
@@ -87,7 +88,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
...
@@ -87,7 +88,7 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
viewBind
.
tvLogin
.
setOnClickListener
{
viewBind
.
tvLogin
.
setOnClickListener
{
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
val
code
=
viewBind
.
etCode
.
text
.
toString
()
val
code
=
viewBind
.
etCode
.
text
.
toString
()
val
paramsMap
=
HashMap
<
String
,
String
>()
val
paramsMap
=
HashMap
<
String
,
String
?
>()
paramsMap
[
"mobile"
]
=
mobile
paramsMap
[
"mobile"
]
=
mobile
paramsMap
[
"code"
]
=
code
paramsMap
[
"code"
]
=
code
ApiService
.
mobileLogin
(
loginImpl
,
paramsMap
)
ApiService
.
mobileLogin
(
loginImpl
,
paramsMap
)
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/MainActivity.kt
View file @
ee6be16c
...
@@ -129,11 +129,16 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -129,11 +129,16 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
}
}
private
fun
bindPushToken
()
{
private
fun
bindPushToken
()
{
val
requestParams
:
PushTokenAndroidBean
.
Request
val
encryptionToken
=
ToolsUtil
.
getYDEncryptionToken
()
val
encryptionToken
=
ToolsUtil
.
getYDEncryptionToken
()
val
pushLevel
=
AppConfig
.
PUSH_LEVEL
+
ToolsUtil
.
getDeviceBrandMask
()
val
pushLevel
=
AppConfig
.
PUSH_LEVEL
+
ToolsUtil
.
getDeviceBrandMask
()
if
(
null
!=
Hawk
.
get
<
String
>(
HawkConfig
.
UmToken
))
{
if
(
null
!=
Hawk
.
get
<
String
>(
HawkConfig
.
UmToken
))
{
requestParams
=
PushTokenAndroidBean
.
Request
(
""
,
encryptionToken
,
1
,
1
,
Hawk
.
get
(
HawkConfig
.
UmToken
),
pushLevel
)
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"old_token"
]
=
""
requestParams
[
"new_token"
]
=
encryptionToken
requestParams
[
"personalRec"
]
=
"1"
requestParams
[
"enable"
]
=
"1"
requestParams
[
"push_key"
]
=
Hawk
.
get
(
HawkConfig
.
UmToken
)
requestParams
[
"push_level"
]
=
pushLevel
.
toString
()
ApiService
.
pushTokenAndroid
(
requestParams
)
ApiService
.
pushTokenAndroid
(
requestParams
)
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/alive/AliveTestActivity.kt
View file @
ee6be16c
...
@@ -66,8 +66,10 @@ class AliveTestActivity : BaseActivity<ActivityAliveLayoutBinding>(), PreCallbac
...
@@ -66,8 +66,10 @@ 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
=
HashMap
<
String
,
String
?>()
idCardNo
!!
,
idCardName
!!
,
"meglive"
)
requestParams
[
"id_number"
]
=
idCardNo
requestParams
[
"id_card_name"
]
=
idCardName
requestParams
[
"liveness_type"
]
=
"meglive"
ApiService
.
authPersonalGetToken
(
authPersonalGetTokenCallback
,
requestParams
)
ApiService
.
authPersonalGetToken
(
authPersonalGetTokenCallback
,
requestParams
)
}
}
}
}
...
@@ -200,7 +202,9 @@ class AliveTestActivity : BaseActivity<ActivityAliveLayoutBinding>(), PreCallbac
...
@@ -200,7 +202,9 @@ class AliveTestActivity : BaseActivity<ActivityAliveLayoutBinding>(), PreCallbac
}
}
override
fun
onTaskSuccess
(
bucket
:
String
?,
objectKey
:
String
?)
{
override
fun
onTaskSuccess
(
bucket
:
String
?,
objectKey
:
String
?)
{
val
requestParams
:
IdentifyIdOcrVerifyBean
.
Request
=
IdentifyIdOcrVerifyBean
.
Request
(
bizToken
,
objectKey
!!
)
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"biz_token"
]
=
bizToken
requestParams
[
"meglive_objectid"
]
=
objectKey
ApiService
.
identifyIdOcrVerify
(
identifyIdOcrVerifyCallback
,
requestParams
)
ApiService
.
identifyIdOcrVerify
(
identifyIdOcrVerifyCallback
,
requestParams
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
View file @
ee6be16c
...
@@ -180,8 +180,9 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -180,8 +180,9 @@ class LifeAccountBusinessLicenseAuthFragment :
* 执行营业执照OCR
* 执行营业执照OCR
*/
*/
private
fun
startBusinessLicenseOCR
(
objectKey
:
String
?)
{
private
fun
startBusinessLicenseOCR
(
objectKey
:
String
?)
{
val
request
=
BusinessLicenseOCRBean
.
Request
(
objectKey
)
val
requestParams
=
HashMap
<
String
,
String
?>()
ApiService
.
businessLicenseOCR
(
this
,
request
)
requestParams
[
"business_image_objectid"
]
=
objectKey
ApiService
.
businessLicenseOCR
(
this
,
requestParams
)
}
}
override
fun
onTaskStart
()
{
override
fun
onTaskStart
()
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
View file @
ee6be16c
...
@@ -187,13 +187,11 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -187,13 +187,11 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
// 若存在上一次活体检测数据则删除 处理活体检测失败 再次进入
// 若存在上一次活体检测数据则删除 处理活体检测失败 再次进入
File
(
cachePath
+
Constant
.
FILE_PATH_ALIVE_DETECT_VERIFY_DATA
).
delete
()
File
(
cachePath
+
Constant
.
FILE_PATH_ALIVE_DETECT_VERIFY_DATA
).
delete
()
// 跳转人脸认证
// 跳转人脸认证
ApiService
.
authPersonalGetToken
(
val
requestParams
=
HashMap
<
String
,
String
?>()
this
,
AuthPersonalGetTokenBean
.
Request
(
requestParams
[
"id_number"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
,
requestParams
[
"id_card_name"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
realName
LifeAccountAuthDataManager
.
personalAuthData
.
realName
,
requestParams
[
"liveness_type"
]
=
Constant
.
TYPE_MEG_LIVE
Constant
.
TYPE_MEG_LIVE
ApiService
.
authPersonalGetToken
(
this
,
requestParams
)
)
)
}
}
}
}
}
}
...
@@ -392,13 +390,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -392,13 +390,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
* 执行身份证OCR
* 执行身份证OCR
*/
*/
private
fun
startIDCardOCR
()
{
private
fun
startIDCardOCR
()
{
ApiService
.
getIDCardOCR
(
val
requestParams
=
HashMap
<
String
,
String
?>()
this
,
requestParams
[
"posit_image_objectid"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
idCardPortraitFaceObjectKey
GetIDCardOCRBean
.
Request
(
requestParams
[
"back_image_objectid"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNationalEmblemFaceObjectKey
LifeAccountAuthDataManager
.
personalAuthData
.
idCardPortraitFaceObjectKey
,
ApiService
.
getIDCardOCR
(
this
,
requestParams
)
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNationalEmblemFaceObjectKey
)
)
}
}
override
fun
getIDCardOCRSuccess
(
result
:
GetIDCardOCRBean
.
Response
?)
{
override
fun
getIDCardOCRSuccess
(
result
:
GetIDCardOCRBean
.
Response
?)
{
...
@@ -516,13 +511,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -516,13 +511,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
objectKey
?.
let
{
objectKey
?.
let
{
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectObjectKey
=
it
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectObjectKey
=
it
}
}
ApiService
.
identifyIdOcrVerify
(
val
requestParams
=
HashMap
<
String
,
String
?>()
this
,
requestParams
[
"biz_token"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectBizToken
IdentifyIdOcrVerifyBean
.
Request
(
requestParams
[
"meglive_objectid"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectObjectKey
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectBizToken
,
ApiService
.
identifyIdOcrVerify
(
this
,
requestParams
)
LifeAccountAuthDataManager
.
personalAuthData
.
liveDetectObjectKey
)
)
}
}
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/idcard/IDCardTestActivity.kt
View file @
ee6be16c
...
@@ -20,6 +20,7 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
...
@@ -20,6 +20,7 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetIDCardOCRBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetIDCardOCRBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IGetIDCardOCRCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IGetIDCardOCRCallback
import
com.yidian.shenghuoquan.newscontent.ui.alive.AliveTestActivity
import
com.yidian.shenghuoquan.newscontent.ui.alive.AliveTestActivity
import
com.yidian.shenghuoquan.newscontent.ui.auth.LifeAccountAuthDataManager
import
com.yidian.shenghuoquan.newscontent.utils.KS3Core
import
com.yidian.shenghuoquan.newscontent.utils.KS3Core
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
import
java.io.File
import
java.io.File
...
@@ -118,7 +119,9 @@ class IDCardTestActivity : BaseActivity<ActivityIdcardBinding>() {
...
@@ -118,7 +119,9 @@ class IDCardTestActivity : BaseActivity<ActivityIdcardBinding>() {
if
(
objectKey
!=
null
)
{
if
(
objectKey
!=
null
)
{
idCardBackObjectKey
=
objectKey
idCardBackObjectKey
=
objectKey
}
}
val
request
=
GetIDCardOCRBean
.
Request
(
idCardFrontObjectKey
,
idCardBackObjectKey
)
val
requestParams
=
HashMap
<
String
,
String
?>()
requestParams
[
"posit_image_objectid"
]
=
idCardFrontObjectKey
requestParams
[
"back_image_objectid"
]
=
idCardBackObjectKey
ApiService
.
getIDCardOCR
(
object
:
IGetIDCardOCRCallback
{
ApiService
.
getIDCardOCR
(
object
:
IGetIDCardOCRCallback
{
override
fun
getIDCardOCRSuccess
(
result
:
GetIDCardOCRBean
.
Response
?)
{
override
fun
getIDCardOCRSuccess
(
result
:
GetIDCardOCRBean
.
Response
?)
{
Log
.
d
(
KS3Core
.
TAG
,
"name: ${result?.posit?.name}, id num: ${result?.posit?.idcard_number}"
)
Log
.
d
(
KS3Core
.
TAG
,
"name: ${result?.posit?.name}, id num: ${result?.posit?.idcard_number}"
)
...
@@ -135,7 +138,7 @@ class IDCardTestActivity : BaseActivity<ActivityIdcardBinding>() {
...
@@ -135,7 +138,7 @@ class IDCardTestActivity : BaseActivity<ActivityIdcardBinding>() {
}
}
},
request
)
},
request
Params
)
}
}
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
override
fun
onTaskFailure
(
statesCode
:
Int
,
message
:
String
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/utils/KS3Core.kt
View file @
ee6be16c
...
@@ -266,16 +266,14 @@ class KS3Core private constructor(val context: Context) : AuthListener {
...
@@ -266,16 +266,14 @@ class KS3Core private constructor(val context: Context) : AuthListener {
TAG
,
TAG
,
"KSYun calculate auth, httpMethod: $httpMethod, contentType: $contentType, date: $date, contentMD5: $contentMD5, resource: $resource, headers: $headers"
"KSYun calculate auth, httpMethod: $httpMethod, contentType: $contentType, date: $date, contentMD5: $contentMD5, resource: $resource, headers: $headers"
)
)
return
ApiService
.
getKSYunToken
(
val
requestParams
=
HashMap
<
String
,
String
?>()
GetKSYunTokenBean
.
Request
(
requestParams
[
"http_method"
]
=
httpMethod
httpMethod
,
requestParams
[
"date"
]
=
date
date
,
requestParams
[
"resource"
]
=
resource
resource
,
requestParams
[
"content_md5"
]
=
contentMD5
contentMD5
,
requestParams
[
"content_type"
]
=
contentType
contentType
,
requestParams
[
"headers"
]
=
headers
headers
return
ApiService
.
getKSYunToken
(
requestParams
)
?.
result
?.
token
)
)
?.
result
?.
token
}
}
/**
/**
...
...
app/libs/arm64-v8a/libXDiamond.so
View file @
ee6be16c
No preview for this file type
app/libs/armeabi-v7a/libXDiamond.so
View file @
ee6be16c
No preview for this file type
app/libs/x86/libXDiamond.so
View file @
ee6be16c
No preview for this file type
app/libs/x86_64/libXDiamond.so
View file @
ee6be16c
No preview for this file type
config/config.gradle
View file @
ee6be16c
...
@@ -56,7 +56,7 @@ ext.dependencies = [
...
@@ -56,7 +56,7 @@ ext.dependencies = [
'io.reactivex.rxjava3:rxjava:3.0.9'
,
'io.reactivex.rxjava3:rxjava:3.0.9'
,
'com.yidian.framework.mobile:ydhttp:1.0.8-SNAPSHOT'
,
'com.yidian.framework.mobile:ydhttp:1.0.8-SNAPSHOT'
,
'com.yidian.framework.mobile:ydutils:1.0.1-SNAPSHOT'
,
'com.yidian.framework.mobile:ydutils:1.0.1-SNAPSHOT'
,
'com.yidian.framework.mobile:xdiamond:1.0.
2
-SNAPSHOT'
,
'com.yidian.framework.mobile:xdiamond:1.0.
4
-SNAPSHOT'
,
'com.loopj.android:android-async-http:1.4.9'
'com.loopj.android:android-async-http:1.4.9'
],
],
...
...
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