Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
MobileManager
Project
Overview
Details
Activity
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
Wang Xu
MobileManager
Commits
f534cc13
Commit
f534cc13
authored
Mar 21, 2020
by
Baoxy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复BUG
1. 购买页面追加唯一标识 2. 提示购买激活码浮窗,选择关闭时解除禁用项等
parent
f393160c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
27 deletions
+45
-27
SettingBuyActivity.kt
.../android/launcher3/function/setting/SettingBuyActivity.kt
+9
-0
ActivationHelper.kt
...java/com/secspace/lib/common/function/ActivationHelper.kt
+9
-2
BuyCodeDialog.kt
...in/java/com/secspace/lib/common/function/BuyCodeDialog.kt
+3
-2
WorkManager.kt
...main/java/com/secspace/lib/common/function/WorkManager.kt
+22
-21
VUidUtil.java
...src/main/java/com/secspace/lib/common/utils/VUidUtil.java
+2
-2
No files found.
Launcher3/src/com/android/launcher3/function/setting/SettingBuyActivity.kt
View file @
f534cc13
...
@@ -13,6 +13,7 @@ import com.secspace.lib.common.dialog.LoadingDialog
...
@@ -13,6 +13,7 @@ import com.secspace.lib.common.dialog.LoadingDialog
import
com.secspace.lib.common.dialog.other.DialogUIUtils
import
com.secspace.lib.common.dialog.other.DialogUIUtils
import
com.secspace.lib.common.function.ActivationHelper
import
com.secspace.lib.common.function.ActivationHelper
import
com.secspace.lib.common.function.ActivationHelper.ActivationListener
import
com.secspace.lib.common.function.ActivationHelper.ActivationListener
import
com.secspace.lib.common.utils.ImeiUtil
import
com.secspace.lib.common.utils.dp2px
import
com.secspace.lib.common.utils.dp2px
import
kotlinx.android.synthetic.main.activity_setting.*
import
kotlinx.android.synthetic.main.activity_setting.*
...
@@ -21,6 +22,7 @@ class SettingBuyActivity : BaseActivity() {
...
@@ -21,6 +22,7 @@ class SettingBuyActivity : BaseActivity() {
private
var
code
:
QMUICommonListItemView
?
=
null
private
var
code
:
QMUICommonListItemView
?
=
null
private
var
timeStart
:
QMUICommonListItemView
?
=
null
private
var
timeStart
:
QMUICommonListItemView
?
=
null
private
var
timeEnd
:
QMUICommonListItemView
?
=
null
private
var
timeEnd
:
QMUICommonListItemView
?
=
null
private
var
uniqueId
:
QMUICommonListItemView
?
=
null
private
lateinit
var
mContext
:
Context
private
lateinit
var
mContext
:
Context
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
...
@@ -58,11 +60,18 @@ class SettingBuyActivity : BaseActivity() {
...
@@ -58,11 +60,18 @@ class SettingBuyActivity : BaseActivity() {
UCharacter
.
DecompositionType
.
VERTICAL
,
UCharacter
.
DecompositionType
.
VERTICAL
,
QMUICommonListItemView
.
ACCESSORY_TYPE_NONE
,
QMUICommonListItemView
.
ACCESSORY_TYPE_NONE
,
dp2px
(
48f
))
dp2px
(
48f
))
uniqueId
=
grouplistview
.
createItemView
(
null
,
getString
(
R
.
string
.
edu_item_unique
),
ImeiUtil
.
uniqueId
(
mContext
,
true
),
UCharacter
.
DecompositionType
.
VERTICAL
,
QMUICommonListItemView
.
ACCESSORY_TYPE_NONE
,
dp2px
(
48f
))
QMUIGroupListView
.
newSection
(
mContext
)
QMUIGroupListView
.
newSection
(
mContext
)
.
addItemView
(
activationType
)
{}
.
addItemView
(
activationType
)
{}
.
addItemView
(
code
)
{
}
.
addItemView
(
code
)
{
}
.
addItemView
(
timeStart
)
{}
.
addItemView
(
timeStart
)
{}
.
addItemView
(
timeEnd
)
{
}
.
addItemView
(
timeEnd
)
{
}
.
addItemView
(
uniqueId
)
{
}
.
addTo
(
grouplistview
)
.
addTo
(
grouplistview
)
btn_activation
.
setOnClickListener
{
btn_activation
.
setOnClickListener
{
LoadingDialog
.
getInstance
(
mContext
).
show
(
"请稍后"
)
LoadingDialog
.
getInstance
(
mContext
).
show
(
"请稍后"
)
...
...
lib_common/src/main/java/com/secspace/lib/common/function/ActivationHelper.kt
View file @
f534cc13
...
@@ -31,6 +31,7 @@ import kotlin.coroutines.suspendCoroutine
...
@@ -31,6 +31,7 @@ import kotlin.coroutines.suspendCoroutine
const
val
PROBATION
=
"probation"
const
val
PROBATION
=
"probation"
const
val
SP_TRIAL_ACTIVE_START_TIME
=
"trialActiveStartTime"
const
val
SP_TRIAL_ACTIVE_START_TIME
=
"trialActiveStartTime"
const
val
PROBATION_TIME
:
Long
=
7
*
24
*
60
*
60
*
1000
const
val
PROBATION_TIME
:
Long
=
7
*
24
*
60
*
60
*
1000
//const val PROBATION_TIME: Long = 1 * 60 * 1000
object
ActivationHelper
{
object
ActivationHelper
{
private
const
val
TAG
=
"ActivationHelper"
private
const
val
TAG
=
"ActivationHelper"
...
@@ -38,7 +39,7 @@ object ActivationHelper {
...
@@ -38,7 +39,7 @@ object ActivationHelper {
private
const
val
PROBATION_FILE_NAME
=
"probation.xml"
private
const
val
PROBATION_FILE_NAME
=
"probation.xml"
private
const
val
ACTIVATE_FILE_NAME
=
"activate.xml"
private
const
val
ACTIVATE_FILE_NAME
=
"activate.xml"
fun
active
(
context
:
Activity
,
listener
:
ActivationListener
,
force
:
Boolean
=
false
)
{
fun
active
(
context
:
Context
,
listener
:
ActivationListener
,
force
:
Boolean
=
false
)
{
ActivationApi
.
getInstance
().
isActiveFromLocalAndNet
(
context
.
packageName
,
object
:
CheckLocalActiveStatusListener
{
ActivationApi
.
getInstance
().
isActiveFromLocalAndNet
(
context
.
packageName
,
object
:
CheckLocalActiveStatusListener
{
override
fun
hasActivated
()
{
override
fun
hasActivated
()
{
listener
.
activated
()
listener
.
activated
()
...
@@ -77,7 +78,7 @@ object ActivationHelper {
...
@@ -77,7 +78,7 @@ object ActivationHelper {
}
}
fun
checkActivate
(
context
:
Context
,
listener
:
CheckActiveStatusListener
?)
{
fun
checkActivate
(
context
:
Context
,
listener
:
CheckActiveStatusListener
?)
{
ActivationApi
.
getInstance
().
checkActivateCodeStatus
(
context
.
packageName
,
listener
)
ActivationApi
.
getInstance
().
checkActivateCodeStatus
(
context
.
packageName
,
listener
,
false
)
}
}
private
suspend
fun
getCurrentTimeByNet
():
Long
=
suspendCoroutine
{
cont
->
private
suspend
fun
getCurrentTimeByNet
():
Long
=
suspendCoroutine
{
cont
->
...
@@ -216,6 +217,12 @@ object ActivationHelper {
...
@@ -216,6 +217,12 @@ object ActivationHelper {
}
}
fun
getActivationTimeEnd
(
context
:
Context
):
String
?
{
fun
getActivationTimeEnd
(
context
:
Context
):
String
?
{
val
activationState
=
getValueByXmlKey
(
context
,
SP_IS_ACTIVE
,
ACTIVATE_FILE_NAME
)
if
(
activationState
.
isNotEmpty
())
{
if
(
activationState
==
ACTIVE_TYPE_RELEASE_CODE
){
return
"永久"
}
}
val
activationEndTime
=
getValueByXmlKey
(
context
,
SP_TRIAL_ACTIVE_END_TIME
,
ACTIVATE_FILE_NAME
)
val
activationEndTime
=
getValueByXmlKey
(
context
,
SP_TRIAL_ACTIVE_END_TIME
,
ACTIVATE_FILE_NAME
)
if
(
activationEndTime
.
isNotEmpty
())
{
if
(
activationEndTime
.
isNotEmpty
())
{
return
activationEndTime
.
replace
(
" "
,
" "
)
return
activationEndTime
.
replace
(
" "
,
" "
)
...
...
lib_common/src/main/java/com/secspace/lib/common/function/BuyCodeDialog.kt
View file @
f534cc13
...
@@ -65,17 +65,18 @@ class BuyCodeDialog private constructor(val mContext: Context) : DialogInterface
...
@@ -65,17 +65,18 @@ class BuyCodeDialog private constructor(val mContext: Context) : DialogInterface
override
fun
onClick
(
v
:
View
)
{
override
fun
onClick
(
v
:
View
)
{
when
(
v
.
id
)
{
when
(
v
.
id
)
{
R
.
id
.
btn_accept
->
{
R
.
id
.
btn_accept
->
{
dismiss
()
WorkManager
.
removeForbidden
(
mContext
)
active
(
mContext
,
object
:
ActivationListener
{
active
(
mContext
,
object
:
ActivationListener
{
override
fun
activationFailed
()
{}
override
fun
activationFailed
()
{}
override
fun
activated
()
{
override
fun
activated
()
{
IntentUtil
.
startEduLauncher
(
mContext
)
IntentUtil
.
startEduLauncher
(
mContext
)
}
}
},
true
)
},
true
)
dismiss
()
WorkManager
.
removeForbidden
(
mContext
)
}
}
R
.
id
.
btn_exit
->
{
R
.
id
.
btn_exit
->
{
dismiss
()
dismiss
()
WorkManager
.
removeForbidden
(
mContext
)
}
}
}
}
}
}
...
...
lib_common/src/main/java/com/secspace/lib/common/function/WorkManager.kt
View file @
f534cc13
...
@@ -143,7 +143,7 @@ object WorkManager {
...
@@ -143,7 +143,7 @@ object WorkManager {
fun
removeForbidden
(
context
:
Context
){
fun
removeForbidden
(
context
:
Context
){
Prefs
.
setMdmInitializedWhenEnter
(
context
,
false
)
Prefs
.
setMdmInitializedWhenEnter
(
context
,
false
)
GlobalScope
.
launch
(
Dispatchers
.
IO
)
{
GlobalScope
.
launch
(
Dispatchers
.
IO
)
{
SwitchOutMdm
.
on
In
it
(
context
)
SwitchOutMdm
.
on
Ex
it
(
context
)
UninstallUtil
.
removeForbidden
(
context
)
UninstallUtil
.
removeForbidden
(
context
)
}
}
}
}
...
@@ -155,26 +155,27 @@ object WorkManager {
...
@@ -155,26 +155,27 @@ object WorkManager {
if
(
isActivateLocal
)
{
if
(
isActivateLocal
)
{
return
@launch
return
@launch
}
}
DialogManager
.
showActivateLoseDialog
(
activity
,
activity
.
getString
(
R
.
string
.
common_remind
),
activity
.
getString
(
R
.
string
.
dialog_tip_activate_lose
),
object
:
DialogManager
.
MessageListener
{
DialogManager
.
showBuyCodeDialog
(
activity
)
override
fun
onPositive
()
{
// DialogManager.showActivateLoseDialog(activity, activity.getString(R.string.common_remind), activity.getString(R.string.dialog_tip_activate_lose), object : DialogManager.MessageListener {
IntentUtil
.
startExitService
(
activity
)
// override fun onPositive() {
removeForbidden
(
activity
)
// IntentUtil.startExitService(activity)
}
// removeForbidden(activity)
// }
override
fun
onNegative
()
{
//
ActivationHelper
.
active
(
activity
,
object
:
ActivationHelper
.
ActivationListener
{
// override fun onNegative() {
override
fun
activated
()
{
// ActivationHelper.active(activity, object : ActivationHelper.ActivationListener {
IntentUtil
.
startEduLauncher
(
activity
)
// override fun activated() {
}
// IntentUtil.startEduLauncher(activity)
// }
override
fun
activationFailed
()
{
//
IntentUtil
.
startExitService
(
activity
)
// override fun activationFailed() {
removeForbidden
(
activity
)
// IntentUtil.startExitService(activity)
}
// removeForbidden(activity)
},
true
)
// }
removeForbidden
(
activity
)
// }, true)
}
// removeForbidden(activity)
})
// }
// })
}
}
}
}
...
...
lib_common/src/main/java/com/secspace/lib/common/utils/VUidUtil.java
View file @
f534cc13
...
@@ -14,8 +14,8 @@ public class VUidUtil {
...
@@ -14,8 +14,8 @@ public class VUidUtil {
}
}
public
static
void
test
(){
public
static
void
test
(){
String
p1
=
"
WSlY8BwZOLSYs2VDI3tORA
=="
;
String
p1
=
"
kAm2OaAw+pqEJrtMkupX7Q
=="
;
String
p2
=
"
OHGoTezawno=
"
;
String
p2
=
"
dcyvcY/13lcojC2xXAn+7AWgIEi5Mz1j
"
;
String
p3
=
"Z8MSUpI7MsfCjMqljoyXfg=="
;
String
p3
=
"Z8MSUpI7MsfCjMqljoyXfg=="
;
String
p4
=
"6aUHDn194eTCjMqljoyXfg=="
;
String
p4
=
"6aUHDn194eTCjMqljoyXfg=="
;
...
...
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