-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4cf593
commit 42fb78e
Showing
10 changed files
with
311 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
crash_breakpad_build/src/main/java/com/devyk/crash_module/Crash.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
package com.devyk.crash_module; | ||
|
||
import android.content.Context; | ||
import android.text.TextUtils; | ||
|
||
import com.devyk.crash_module.inter.ICrash; | ||
import com.devyk.crash_module.inter.JavaCrashUtils; | ||
import com.devyk.crash_module.inter.NativeCrashImp; | ||
|
||
import java.io.File; | ||
|
||
/** | ||
* <pre> | ||
* author : devyk on 2019-09-17 00:34 | ||
* blog : https://juejin.im/user/578259398ac2470061f3a3fb/posts | ||
* github : https://github.com/yangkun19921001 | ||
* mailbox : [email protected] | ||
* desc : This is Crash | ||
* </pre> | ||
*/ | ||
public class Crash { | ||
|
||
|
||
/** | ||
* native 崩溃实现 | ||
*/ | ||
private ICrash nativeCrashImp = new NativeCrashImp(); | ||
|
||
/** | ||
* 上下文 | ||
*/ | ||
private Context context = null; | ||
|
||
|
||
/** | ||
* native 崩溃日志 | ||
*/ | ||
private void initNativeCrash(Context context, String nativePath) { | ||
if (!TextUtils.isEmpty(nativePath) && | ||
new File(nativePath).exists()) | ||
nativeCrashImp.init(context, nativePath); | ||
} | ||
|
||
private void initJavaCrash(Context context, String javaPath, JavaCrashUtils.OnCrashListener onCrashListener) { | ||
if (context != null && | ||
!TextUtils.isEmpty(javaPath) && | ||
new File(javaPath).exists() && | ||
onCrashListener != null) | ||
JavaCrashUtils.getInstance().init(context, javaPath, onCrashListener); | ||
} | ||
|
||
|
||
public static class CrashBuild { | ||
private String javaCrashPath; | ||
private String nativeCrashPath; | ||
private Context context; | ||
private JavaCrashUtils.OnCrashListener onCrashListener; | ||
|
||
public CrashBuild(Context context) { | ||
this.context = context; | ||
} | ||
|
||
public CrashBuild javaCrashPath(String path, JavaCrashUtils.OnCrashListener onCrashListener) { | ||
this.javaCrashPath = path; | ||
this.onCrashListener = onCrashListener; | ||
return this; | ||
} | ||
|
||
public CrashBuild nativeCrashPath(String path) { | ||
this.nativeCrashPath = path; | ||
return this; | ||
} | ||
|
||
public void build() { | ||
Crash crash = new Crash(); | ||
crash.context = this.context; | ||
crash.initNativeCrash(this.context, nativeCrashPath); | ||
crash.initJavaCrash(this.context, this.javaCrashPath, this.onCrashListener); | ||
} | ||
} | ||
|
||
|
||
} |
42 changes: 0 additions & 42 deletions
42
crash_breakpad_build/src/main/java/com/devyk/crash_module/CrashUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
crash_breakpad_build/src/main/java/com/devyk/crash_module/inter/JavaCrashImp.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.