Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
com.ccwangluo.accelerator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sheteng
com.ccwangluo.accelerator
Commits
726671f6
Commit
726671f6
authored
Jun 28, 2022
by
sheteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合规修改 3 小米渠道
parent
d99fe237
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
13 deletions
+47
-13
app/src/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
...rc/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
+16
-13
app/src/main/java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
...java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
+25
-0
app/src/main/java/com/ccwangluo/accelerator/utils/SettingSPUtils.kt
...in/java/com/ccwangluo/accelerator/utils/SettingSPUtils.kt
+6
-0
No files found.
app/src/main/java/com/ccwangluo/accelerator/ui/MainActivity.kt
View file @
726671f6
...
...
@@ -87,8 +87,9 @@ class MainActivity() : XPageActivity() {
private
fun
getPermission
()
{
initPhoneUtils
()
Bugly
.
init
(
this
,
"e030f74df5"
,
false
)
UMConfigure
.
init
(
this
,
"61f0aa7fe014255fcb06a0bd"
,
"umeng"
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
UMConfigure
.
init
(
this
,
"61f0aa7fe014255fcb06a0bd"
,
"umeng"
,
UMConfigure
.
DEVICE_TYPE_PHONE
,
""
)
PageOption
.
to
(
SplashFragment
::
class
.
java
).
open
(
this
)
//QQ官方sdk授权
Tencent
.
setIsPermissionGranted
(
true
)
...
...
@@ -121,6 +122,7 @@ class MainActivity() : XPageActivity() {
}
private
fun
initPhoneUtils
()
{
if
(
SettingSPUtils
.
pushStatus
)
{
//腾讯推送
XGPushManager
.
registerPush
(
this
,
object
:
XGIOperateCallback
{
override
fun
onSuccess
(
data
:
Any
,
flag
:
Int
)
{
...
...
@@ -134,6 +136,7 @@ class MainActivity() : XPageActivity() {
}
})
}
}
override
fun
onBackPressed
()
{
if
(
JCVideoPlayer
.
backPress
())
{
...
...
app/src/main/java/com/ccwangluo/accelerator/ui/web/AndroidInterface.kt
View file @
726671f6
...
...
@@ -14,8 +14,10 @@ import android.os.Handler
import
android.provider.Settings
import
com.ccwangluo.accelerator.utils.*
import
com.ccwangluo.accelerator.utils.datareport.DataRePortUtils
import
com.ccwangluo.cc_quickly.utils.SettingSPUtils
import
com.github.shadowsocks.bg.AuthManager
import
com.github.shadowsocks.bg.BaseService
import
com.tencent.android.tpush.XGPushManager
import
com.tencent.bugly.beta.Beta
...
...
@@ -210,6 +212,29 @@ class AndroidInterface(val xPageFragment: XPageFragment, val agentWeb: AgentWeb)
.
quickCallJs
(
callback
,
AuthManager
.
isSmartAccOpen
.
toString
())
}
/**
* 推送开关
*/
@JavascriptInterface
fun
setPushStatus
(
isopen
:
Boolean
)
{
SettingSPUtils
.
pushStatus
=
isopen
if
(!
isopen
){
XGPushManager
.
unregisterPush
(
xPageFragment
.
context
)
}
}
/**
* 推送开关
*/
@JavascriptInterface
fun
getPushStatus
(
callback
:
String
)
{
agentWeb
.
getJsAccessEntrace
()
.
quickCallJs
(
callback
,
SettingSPUtils
.
pushStatus
.
toString
())
}
/**
* 清除token
*/
...
...
app/src/main/java/com/ccwangluo/accelerator/utils/SettingSPUtils.kt
View file @
726671f6
...
...
@@ -14,6 +14,7 @@ object SettingSPUtils {
private
val
IS_SMART_ACC_OPEN
=
"is_smart_acc_open"
private
val
LAST_APP_SRART_TIME
=
"LAST_APP_SRART_TIME"
private
val
CHANNEL_KEY
=
"CHANNEL_KEY"
private
val
PUSH_STATUS
=
"PUSH_STATUS"
var
channel
:
Int
get
()
=
MMKV
.
defaultMMKV
().
decodeInt
(
CHANNEL_KEY
,
0
)
...
...
@@ -46,5 +47,10 @@ object SettingSPUtils {
MMKV
.
defaultMMKV
().
putLong
(
LAST_APP_SRART_TIME
,
lastAPPOpenReportTime
)
}
var
pushStatus
:
Boolean
get
()
=
MMKV
.
defaultMMKV
().
decodeBool
(
PUSH_STATUS
,
true
)
set
(
pushStatus
)
{
MMKV
.
defaultMMKV
().
putBoolean
(
PUSH_STATUS
,
pushStatus
)
}
}
\ No newline at end of file
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