Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
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
杨凯
YDL-Component-Medical
Commits
5c537f84
Commit
5c537f84
authored
Jun 09, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 火山引擎接入,去掉NewH5Activity的错误
parent
26ebd735
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
3 deletions
+68
-3
ApmInit.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
+68
-0
NewH5Activity.java
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
+0
-3
No files found.
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
0 → 100644
View file @
5c537f84
package
com.ydl.ydlcommon.app
import
android.content.Context
import
com.apm.insight.MonitorCrash
import
com.apm.insight.log.VLog
import
com.bytedance.apm.insight.ApmInsight
import
com.bytedance.apm.insight.ApmInsightInitConfig
import
com.bytedance.apm.insight.IDynamicParams
import
com.meituan.android.walle.WalleChannelReader
object
Apm
{
private
var
crash
:
MonitorCrash
?
=
null
fun
initApm
(
context
:
Context
,
appId
:
String
,
vCode
:
Long
,
vName
:
String
,
debug
:
Boolean
,
uidCall
:
()
->
String
?)
{
val
channel
=
if
(
debug
)
"debug"
else
WalleChannelReader
.
getChannel
(
context
)
crash
=
MonitorCrash
.
init
(
context
,
appId
,
vCode
,
vName
)
crash
?.
config
()
?.
setChannel
(
channel
)
val
builder
=
ApmInsightInitConfig
.
builder
()
.
aid
(
appId
)
//.batteryMonitor(true)
//.cpuMonitor(true)
//.fpsMonitor(true)
//.seriousBlockDetect(true)
.
blockDetect
(
true
)
// .enableWebViewMonitor(true)
.
channel
(
channel
)
.
debugMode
(
debug
)
.
enableLogRecovery
(
true
)
.
setDynamicParams
(
ApmParams
(
crash
,
uidCall
))
ApmInsight
.
getInstance
().
init
(
context
,
builder
.
build
())
VLog
.
init
(
context
,
20
)
}
fun
reportCustom
(
type
:
String
,
msg
:
String
,
throwable
:
Throwable
)
{
crash
?.
reportCustomErr
(
type
,
msg
,
throwable
)
}
}
private
class
ApmParams
(
val
crash
:
MonitorCrash
?,
val
uidCall
:
()
->
String
?)
:
IDynamicParams
()
{
override
fun
getUserUniqueID
():
String
?
{
return
null
}
override
fun
getAbSdkVersion
():
String
?
{
return
null
}
override
fun
getSsid
():
String
?
{
return
null
}
override
fun
getDid
():
String
?
{
return
null
}
override
fun
getUserId
():
String
?
{
val
uid
=
uidCall
.
invoke
()
crash
?.
config
()
?.
setUID
(
uid
)
return
uid
}
}
\ No newline at end of file
ydl-webview/src/main/java/com/ydl/webview/NewH5Activity.java
View file @
5c537f84
...
...
@@ -3,7 +3,6 @@ package com.ydl.webview;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.app.AlertDialog
;
import
android.content.ClipData
;
import
android.content.Context
;
import
android.content.Intent
;
...
...
@@ -35,7 +34,6 @@ import com.tencent.smtt.sdk.WebView;
import
com.tencent.smtt.sdk.WebViewClient
;
import
com.umeng.socialize.UMShareAPI
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.ydl.event.ReloadUrlEvent
;
import
com.ydl.utils.PopUtils
;
import
com.ydl.utils.ProxyCheckUtils
;
import
com.ydl.utils.WebUrlParamsUtils
;
...
...
@@ -1388,7 +1386,6 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
super
.
onDestroy
();
cancelSendNetLossMessage
();
EventBus
.
getDefault
().
unregister
(
this
);
super
.
onDestroy
();
if
(
wv_content
!=
null
)
{
wv_content
.
destroy
();
}
...
...
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