Skip to content

Commit 50165fe

Browse files
hui.zhaohui.zhao
authored andcommitted
3.4.0
1 parent 4f57e34 commit 50165fe

File tree

4 files changed

+22
-27
lines changed

4 files changed

+22
-27
lines changed

app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ dependencies {
4343
implementation "cn.hikyson.godeye:godeye-core:${VERSION_NAME}"
4444
// // Debug dashboard
4545
// debugImplementation "cn.hikyson.godeye:godeye-monitor:${VERSION_NAME}"
46-
// // Release no dashboard
47-
// releaseImplementation "cn.hikyson.godeye:godeye-monitor-no-op:${VERSION_NAME}"
4846
implementation "cn.hikyson.godeye:godeye-monitor:${VERSION_NAME}"
4947
// Extra module, help to monitor network
5048
implementation "cn.hikyson.godeye:godeye-okhttp:${VERSION_NAME}"
5149
// Extra module, help to monitor crash/ANR
5250
implementation "cn.hikyson.godeye:godeye-xcrash:${VERSION_NAME}"
51+
// Extra module, help to monitor leak memory
5352
implementation "cn.hikyson.godeye:godeye-leakcanary:${VERSION_NAME}"
5453
}
5554

app/src/main/java/cn/hikyson/godeyedemo/MainActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public void run() {
5252
@Override
5353
protected void onDestroy() {
5454
super.onDestroy();
55-
GodEyeMonitor.shutDown();
5655
}
5756

5857
public void request(View view) {

app/src/main/java/cn/hikyson/godeyedemo/MyApp.java

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@
44
import android.app.ActivityManager;
55
import android.app.Application;
66
import android.content.Context;
7+
import android.util.Log;
78

89
import java.util.ArrayList;
9-
import java.util.Collections;
1010
import java.util.List;
1111

1212
import cn.hikyson.android.godeye.okhttp.GodEyePluginOkNetwork;
13-
import cn.hikyson.godeye.core.GodEye;
14-
import cn.hikyson.godeye.core.GodEyeConfig;
15-
import cn.hikyson.godeye.monitor.GodEyeMonitor;
16-
import cn.hikyson.godeye.monitor.modules.appinfo.AppInfoLabel;
13+
import cn.hikyson.godeye.core.GodEyeHelper;
14+
import cn.hikyson.godeye.core.monitor.AppInfoConext;
15+
import cn.hikyson.godeye.core.monitor.AppInfoLabel;
1716
import okhttp3.OkHttpClient;
1817

19-
import static cn.hikyson.godeye.core.utils.ProcessUtils.isMainProcess;
20-
2118
/**
2219
* Created by kysonchao on 2018/1/29.
2320
*/
@@ -27,22 +24,18 @@ public class MyApp extends Application {
2724
@Override
2825
public void onCreate() {
2926
super.onCreate();
30-
if (isMainProcess(this)) {
31-
GodEye.instance().install(GodEyeConfig.fromAssets("android-godeye-config/install.config"));
32-
GodEyeMonitor.injectAppInfoConext(new GodEyeMonitor.AppInfoConext() {
33-
@Override
34-
public List<AppInfoLabel> getAppInfo() {
35-
List<AppInfoLabel> appInfoLabels = new ArrayList<>();
36-
appInfoLabels.add(new AppInfoLabel("ApplicationID", BuildConfig.APPLICATION_ID, null));
37-
appInfoLabels.add(new AppInfoLabel("VersionName", BuildConfig.VERSION_NAME, ""));
38-
appInfoLabels.add(new AppInfoLabel("VersionCode", String.valueOf(BuildConfig.VERSION_CODE), ""));
39-
appInfoLabels.add(new AppInfoLabel("BuildType", BuildConfig.BUILD_TYPE, ""));
40-
appInfoLabels.add(new AppInfoLabel("AndroidGodEye", "https://github.com/Kyson/AndroidGodEye", "https://github.com/Kyson/AndroidGodEye"));
41-
return appInfoLabels;
42-
}
43-
});
44-
GodEyeMonitor.work(this);
45-
}
27+
GodEyeHelper.setMonitorAppInfoConext(new AppInfoConext() {
28+
@Override
29+
public List<cn.hikyson.godeye.core.monitor.AppInfoLabel> getAppInfo() {
30+
List<AppInfoLabel> appInfoLabels = new ArrayList<>();
31+
appInfoLabels.add(new AppInfoLabel("ApplicationID", BuildConfig.APPLICATION_ID, null));
32+
appInfoLabels.add(new AppInfoLabel("VersionName", BuildConfig.VERSION_NAME, ""));
33+
appInfoLabels.add(new AppInfoLabel("VersionCode", String.valueOf(BuildConfig.VERSION_CODE), ""));
34+
appInfoLabels.add(new AppInfoLabel("BuildType", BuildConfig.BUILD_TYPE, ""));
35+
appInfoLabels.add(new AppInfoLabel("AndroidGodEye", "https://github.com/Kyson/AndroidGodEye", "https://github.com/Kyson/AndroidGodEye"));
36+
return appInfoLabels;
37+
}
38+
});
4639
sApplicationStartTime = System.currentTimeMillis();
4740
MyIntentService.startActionBaz(this, "", "");
4841
}
@@ -66,6 +59,10 @@ private static boolean isMainProcess(Application application) {
6659
ActivityManager manager = (ActivityManager) application.getSystemService
6760
(Context.ACTIVITY_SERVICE);
6861
for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProcesses()) {
62+
Log.d("kyson", "process.processName:" + process.processName);
63+
Log.d("kyson", "process.pid:" + process.pid);
64+
Log.d("kyson", "process.uid:" + process.uid);
65+
6966
if (process.pid == pid) {
7067
processName = process.processName;
7168
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ org.gradle.jvmargs=-Xmx1536m
1818
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1919
# org.gradle.parallel=true
2020

21-
VERSION_NAME=3.3.1
21+
VERSION_NAME=3.4.0
2222
METHOD_CANARY_VERSION_NAME=0.15.4
2323
USE_ALIYUN_REPO=false

0 commit comments

Comments
 (0)