1 Star 0 Fork 36

Darlang / SpiderMan

forked from 无言 / SpiderMan 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

SpiderMan

MIT

SpiderMan能为您做的事:

  • 在Android手机上显示闪退崩溃信息,直接分享给相关开发人员!
  • 再也不用担心测试妹妹给你重现怎么操作崩溃的啦!
  • 再也不用担心产品相关人员给你说哪儿哪儿崩溃,但是又重现不了的尴尬啦!
  • 再也不用担心某些Rom禁止异常输出啦!
  • 再也不用担心开发工具log信息时灵时不灵啦!
Debug环境 Share

引入依赖

def spider_man = "1.1.2"

方式一

debugImplementation "com.simple:spiderman:$spider_man"
releaseImplementation "com.simple:spiderman-no-op:$spider_man"

方式二

implementation "com.simple:spiderman:$spider_man"

上面方式一debug环境有奔溃信息提示,release环境则没有,方式二都有,但是记得添加混淆。

初始化

放到Application的onCreate()初始化中,因为static了传入的context,并且放在其他Library初始化的前面。

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //放在其他库初始化前
        SpiderMan.init(this);
    }
}

直接显示错误页面

调用SpiderMan.show(Throwable e)方法

try {
      String text = null;
      text.toUpperCase();
    } catch (Exception e) {
      SpiderMan.show(e);
}

冲突

项目已经依赖了com.android.support:appcompat-v7包,如果产生冲突请使用下面的方式依赖。

debugImplementation("com.simple:spiderman:$spider_man") {
    exclude group: "com.android.support"
}

releaseImplementation("com.simple:spiderman-no-op:$spider_man") {
    exclude group: "com.android.support"
}

混淆

-keep class com.simple.spiderman.** { *; }
-keepnames class com.simple.spiderman.** { *; }
-keep public class * extends android.app.Activity
-keep public class * extends android.support.annotation.** { *; }
-keep public class * extends android.support.v4.content.FileProvider
-keep class * implements Android.os.Parcelable {
    public static final Android.os.Parcelable$Creator *;
}

自定义界面样式

SpiderMan.init(this)
         .setTheme(R.style.SpiderManTheme_Dark);

SpiderMan内置了两种主题样式lightdark

light dark custom

所有自定义属性定义在attrs.xml

  • smToolbar:toolbar的背景色
  • smToolbarText:toolb title的颜色
  • smToolbarShareText:分享文字按钮的颜色
  • smContentBackground:toolb下方内容的背景色
  • smIdentText:标签名字的颜色
  • smDescText:标签描述的颜色

具体可以参考app中的用法。

版本迭代

  • 1.1.2 解决FileProvider file_path重名bug(bug来源LuckSiege/PictureSelector)
  • 1.1.1 新增直接显示错误页面的方法SpiderMan.show(Throwable e),优化错误类型
  • 1.1.0 增加自定义界面主题和国际化
  • 1.0.9 增加appcompat包冲突解决方案
  • 1.0.8 发现很多小伙伴不会代理异常收集,所以删除了异常回调
  • 1.0.7 删除spiderman-no-op never-crash,优化报错类型显示
  • 1.0.6 增加spiderman-no-op
  • 1.0.5 奔溃文本分享美化排版
  • 1.0.4 崩溃输出改为error级别
  • 1.0.3 增加 拷贝/分享 崩溃文字/图片信息
  • 1.0.2 重构,新增设备信息
  • 1.0.1 去除 allowBackup,label
  • 1.0.0 首次上传
MIT License Copyright (c) 2019 ChenPeng Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

崩溃日志手机端显示 ,测试妹妹的最爱,开发哥哥的小棉袄 展开 收起
Android
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Android
1
https://gitee.com/739602283/SpiderMan.git
git@gitee.com:739602283/SpiderMan.git
739602283
SpiderMan
SpiderMan
master

搜索帮助