{"id":18001588,"url":"https://github.com/hehonghui/crashcanary","last_synced_at":"2025-03-26T08:30:51.276Z","repository":{"id":146185397,"uuid":"60145188","full_name":"hehonghui/CrashCanary","owner":"hehonghui","description":"Crash Log Viewer","archived":false,"fork":false,"pushed_at":"2016-06-01T05:47:57.000Z","size":151,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-21T11:50:36.922Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hehonghui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-01T04:23:26.000Z","updated_at":"2021-07-08T07:25:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"85557cf9-8fa3-4255-a210-da15ce3ee974","html_url":"https://github.com/hehonghui/CrashCanary","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hehonghui%2FCrashCanary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hehonghui%2FCrashCanary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hehonghui%2FCrashCanary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hehonghui%2FCrashCanary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hehonghui","download_url":"https://codeload.github.com/hehonghui/CrashCanary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245618574,"owners_count":20645024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-29T23:18:03.032Z","updated_at":"2025-03-26T08:30:51.266Z","avatar_url":"https://github.com/hehonghui.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CrashCanary \n\n![](./crashcanary/src/main/res/drawable/crash_icon.png)\n\nCrashCanary 是一个记录Android 应用程序 Crash的库，当程序发生Crash时CrashCanary会将Crash 日志存储到本地，并且在下次进入应用时通过通知栏提示开发人员，开发人员点击通知栏即可进入到Log详情页面。开发人员也可以手动查看Crash日志列表以及每个Log的详细信息. [下载示例apk](http://pan.baidu.com/s/1eS0kHY6)\n\n示例代码如下: \n\n```java\npublic class MainActivity extends AppCompatActivity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        final CrashCanary crashCanary = new CrashCanary.Builder(this)\n                // 设置自己的异常处理 Handler\n                .setExceptionHandler(new Thread.UncaughtExceptionHandler() {  \n                    @Override\n                    public void uncaughtException(Thread thread, Throwable ex) {\n\n                    }\n                })\n                .setKillProcessWhenCrash(true)  // 发生crash之后关闭应用,再次进入应用时会有crash通知\n                .build();\n\n        Button btn = (Button) findViewById(R.id.submit_btn);\n        btn.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n            \t\t// 模拟一个Crash\n                throw new NullPointerException(\"Crash  Canary Test\");\n            }\n        });\n\n        findViewById(R.id.show_btn).setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                crashCanary.showLogListDialog(MainActivity.this);\n            }\n        });\n    }\n}\n```\n\n## 效果\n\n![](log.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhehonghui%2Fcrashcanary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhehonghui%2Fcrashcanary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhehonghui%2Fcrashcanary/lists"}