diff --git a/README.md b/README.md
index de5d9fe..d1c3871 100644
--- a/README.md
+++ b/README.md
@@ -12,33 +12,35 @@ sensitive information in the file。More importantly, the file is small but the
complete, which is very suitable for offline analysis of oom and other exceptions
## Apps using Tailor
-
-| | | |
-|:-----------:|:-------:|:-------:|:-------:|
-| Xigua Video | Douyin | Huoshan | Kaiyan |
+
## Get started
+Step 1: Add the JitPack repository to your build file
+```gradle
+allprojects {
+ repositories {
+ maven { url 'https://jitpack.io' }
+ }
+}
+```
-Step1: Add to your build.gradle
+Step 2: Add the dependency
```gradle
-implementation 'com.bytedance.tailor:library:1.0.8'
+dependencies {
+ implementation 'com.github.bytedance:tailor:1.0.9'
+}
```
-Step2: For simple usage
-
-```java
-// Using Tailor to get a mini hprof file in exception callback
-Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
- @Override
- public void uncaughtException(Thread t, Throwable e) {
- String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "mini.hprof";
- try {
- Tailor.dumpHprofData(path, true);
- } catch (IOException ex) {
- ex.printStackTrace();
- }
+Step 3: Add code for simple usage
+```Java
+if (e instanceof java.lang.OutOfMemoryError) {
+ String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "mini.hprof";
+ try {
+ Tailor.dumpHprofData(path, true);
+ } catch (IOException ex) {
+ ex.printStackTrace();
}
-})
+}
```
```Java
@@ -46,33 +48,32 @@ Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
Tailor.cropHprofData(source, target, true);
```
-Step3: File upload
+Step 4: Upload data
```shell
-App needs to implement upload logic by itself
+## !!! App needs to implement upload logic by itself
```
-Step4: Data recovery(Python version 3.5 and above)
+Step 5: Process data (Python version >= 3.5)
```shell
+## Data recovery
python3 library/src/main/python/decode.py -i mini.hprof -o target.hprof
```
-## Extra
-
-In order to facilitate everyone to understand the file format of the hprof and the details of cropping
-and compression, we provide three script implementations (Python version 3.5 and above)
-
```shell
-// Hprof verify
+## Hprof verify
python3 library/src/main/python/verify.py -i source.hprof
+```
-// Crop and compress
+```shell
+## Crop and compress
python3 library/src/main/python/encode.py -i source.hprof -o mini.hprof
-
-// Data recovery
-python3 library/src/main/python/decode.py -i mini.hprof -o target.hprof
```
-## Support
+## Extra
+1. [Android Camera内存问题剖析](https://mp.weixin.qq.com/s/-oaN-bOqHDjN30UP1FMpgA)
+2. [西瓜视频稳定性治理体系建设一:Tailor 原理及实践](https://mp.weixin.qq.com/s/DWOQ9MSTkKSCBFQjPswPIQ)
+
+## Support
1. Communicate on [GitHub issues](https://github.com/bytedance/tailor/issues)
2. Mail: shentianzhou.stz@gmail.com
3. WeChat: 429013449
diff --git a/README_cn.md b/README_cn.md
index b9bbb6f..61dd359 100644
--- a/README_cn.md
+++ b/README_cn.md
@@ -7,32 +7,36 @@ Tailor是西瓜Android团队开发的一款通用内存快照裁剪压缩工具
有任何敏感信息,更重要的是文件非常小的同时数据也相对完整,非常适合离线分析OOM及其他类型异常的调查定位。
## Apps using Tailor
-
-| | | |
-|:---------:|:-------:|:-------:|:-------:|
-| 西瓜视频 | 抖音 | 火山 | 开言英语 |
+
## Get started
+Step 1: Add the JitPack repository to your build file
+```gradle
+allprojects {
+ repositories {
+ maven { url 'https://jitpack.io' }
+ }
+}
+```
-Step1 添加依赖:
+Step 2: Add the dependency
```gradle
-implementation 'com.bytedance.tailor:library:1.0.8'
+dependencies {
+ implementation 'com.github.bytedance:tailor:1.0.9'
+}
```
-Step2 代码接入:
+Step 3: Add code for simple usage
```Java
-// 在异常回调里通过Tailor获取快照,不同的app异常回调接口不同,可以根据app的实际情况调整,Ex:
-Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
- @Override
- public void uncaughtException(Thread t, Throwable e) {
- String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "mini.hprof";
- try {
- Tailor.dumpHprofData(path, true);
- } catch (IOException ex) {
- ex.printStackTrace();
- }
+// 在异常回调里通过 Tailor 获取快照
+if (e instanceof java.lang.OutOfMemoryError) {
+ String path = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "mini.hprof";
+ try {
+ Tailor.dumpHprofData(path, true);
+ } catch (IOException ex) {
+ ex.printStackTrace();
}
-})
+}
```
```Java
@@ -40,32 +44,33 @@ Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler()
Tailor.cropHprofData(source, target, true);
```
-Step3 数据上传:
+Step 4: Upload data
```shell
-应用需自己实现上传逻辑或相应的数据回捞功能
+## !!! 应用需自己实现数据上传或回捞
```
-Step4 数据还原:
+Step 5: Process data (Python version 3.5以上)
```shell
-// 还原快照文件(Python version 3.5以上)
+## 还原数据, target.hprof 可通过 Android Studio 分析,通过 MAT 还需要 hprof-conv 转换
python3 library/src/main/python/decode.py -i mini.hprof -o target.hprof
```
-## Extra
-
-为了方便大家理解内存快照的文件格式及裁剪压缩细节,我们提供了三个脚本实现(Python version 3.5以上)
```shell
-// 解析验证
+## 解析验证
python3 library/src/main/python/verify.py -i source.hprof
+```
-// 裁剪压缩
+```shell
+## 裁剪压缩
python3 library/src/main/python/encode.py -i source.hprof -o mini.hprof
-
-// 数据还原
-python3 library/src/main/python/decode.py -i mini.hprof -o target.hprof
```
-## Support
+## Extra
+1. [Android Camera内存问题剖析](https://mp.weixin.qq.com/s/-oaN-bOqHDjN30UP1FMpgA)
+2. [西瓜视频稳定性治理体系建设一:Tailor 原理及实践](https://mp.weixin.qq.com/s/DWOQ9MSTkKSCBFQjPswPIQ)
+
+
+## Support
1. 在[GitHub issues](https://github.com/bytedance/tailor/issues)上交流
2. 邮件: shentianzhou.stz@gmail.com
3. 微信: 429013449
diff --git a/build.gradle b/build.gradle
index 7f4e185..81e6b05 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,8 +5,8 @@ buildscript {
}
dependencies {
- classpath 'com.novoda:bintray-release:0.9.2'
classpath 'com.android.tools.build:gradle:3.3.1'
+ classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
@@ -14,5 +14,6 @@ allprojects {
repositories {
google()
jcenter()
+ maven { url 'https://jitpack.io' }
}
}
\ No newline at end of file
diff --git a/demo/build.gradle b/demo/build.gradle
index 79e571c..07fd7c9 100644
--- a/demo/build.gradle
+++ b/demo/build.gradle
@@ -18,6 +18,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- api project(":library")
+// api project(":library")
+ implementation 'com.github.bytedance:tailor:1.0.8'
implementation 'com.android.support:appcompat-v7:28.0.0'
}
\ No newline at end of file
diff --git a/library/build.gradle b/library/build.gradle
index 4c3bbd0..9f3c9cd 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -1,18 +1,17 @@
apply plugin: 'com.android.library'
-apply plugin: 'com.novoda.bintray-release'
+apply plugin: 'com.github.dcendents.android-maven'
android {
compileSdkVersion 28
-
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
externalNativeBuild {
cmake {
+ cppFlags "-fvisibility=hidden"
abiFilters 'armeabi-v7a', 'arm64-v8a'
arguments "-DANDROID_ARM_MODE=arm", "-DANDROID_STL=c++_shared"
- cppFlags "-fvisibility=hidden"
}
}
}
@@ -24,20 +23,12 @@ android {
}
}
+ ndkVersion "21.4.7075529"
externalNativeBuild {
cmake {
path 'CMakeLists.txt'
}
}
-
- publish {
- userOrg = 'shentianzhou'
- groupId = 'com.bytedance.tailor'
- artifactId = 'library'
- publishVersion = '1.0.8'
- desc = 'Tailor release'
- website = 'https://github.com/bytedance/tailor'
- }
}
dependencies {