All Projects → liuzhao2007 → Startup Protector

liuzhao2007 / Startup Protector

Licence: apache-2.0
A Library helping to avoid App can't start up and Multiple crashes, We can call it StartUp-Protector or SafeMode.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Startup Protector

Conf
Конспекты докладов IT-конференций
Stars: ✭ 365 (+563.64%)
Mutual labels:  startup
Maya
Maye 一个简洁小巧的快速启动工具
Stars: ✭ 553 (+905.45%)
Mutual labels:  startup
Stm32cclib
STM32 C++ Library and HAL
Stars: ✭ 18 (-67.27%)
Mutual labels:  startup
Promote Your Next Startup
🚀 Free resources you may use to promote your next startup
Stars: ✭ 412 (+649.09%)
Mutual labels:  startup
Vim Plugins Profile
🕓 Profile Vim's plugins, generate awesome statistics and optimize (n)vim startup time
Stars: ✭ 508 (+823.64%)
Mutual labels:  startup
Startup Kit Templates
CloudFormation templates to accelerate getting started on AWS.
Stars: ✭ 669 (+1116.36%)
Mutual labels:  startup
domainerator
Simple application written in Go that combines two wordlists and a list of TLDs to form domain names and check if they are already registered.
Stars: ✭ 26 (-52.73%)
Mutual labels:  startup
Tabpy
Execute Python code on the fly and display results in Tableau visualizations:
Stars: ✭ 1,039 (+1789.09%)
Mutual labels:  startup
Anchors
✅ Anchors 是一个基于图结构,支持同异步依赖任务初始化 Android 启动框架。其锚点提供 "勾住" 依赖的功能,能灵活解决初始化过程中复杂的同步问题。参考 alpha 并改进其部分细节, 更贴合 Android 启动的场景, 同时支持优化依赖初始化流程, 自动选择较优的路径进行初始化。
Stars: ✭ 542 (+885.45%)
Mutual labels:  startup
Tailwind Landing Page Template
Simple Light is a free landing page template built on top of TailwindCSS and fully coded in React. Made by
Stars: ✭ 797 (+1349.09%)
Mutual labels:  startup
Vim Startify
🔗 The fancy start screen for Vim.
Stars: ✭ 4,479 (+8043.64%)
Mutual labels:  startup
Bootstrapping Calculator
Do you have enough savings to fund your business?
Stars: ✭ 465 (+745.45%)
Mutual labels:  startup
Awesome Startup
😎 All the required resources to build your own startup
Stars: ✭ 702 (+1176.36%)
Mutual labels:  startup
Awesome Management
👔 Awesome Engineering Team Management
Stars: ✭ 371 (+574.55%)
Mutual labels:  startup
Start Server And Test
Starts server, waits for URL, then runs test command; when the tests end, shuts down server
Stars: ✭ 879 (+1498.18%)
Mutual labels:  startup
Cortex M Rt
Minimal startup / runtime for Cortex-M microcontrollers
Stars: ✭ 286 (+420%)
Mutual labels:  startup
Android Startup
🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.
Stars: ✭ 635 (+1054.55%)
Mutual labels:  startup
Aerial desktop
Macintosh Application installs Aerial ScreenSaver and sets as a Desktop Background. 🚀 🎩
Stars: ✭ 49 (-10.91%)
Mutual labels:  startup
Spytrojan keylogger
[Solo para programadores] Troyano espía | Keylogger solo para Windows, se replica en el sistema y se inicia automaticamente al iniciar sesión. | Envío de registro mediante [Base de Datos], [Gmail] o [BotTelegram].
Stars: ✭ 32 (-41.82%)
Mutual labels:  startup
Steroidesign
Themes based on the biggest StartUps (buttons, color palette, components, etc.) ready to use in your own projects.
Stars: ✭ 786 (+1329.09%)
Mutual labels:  startup

StartUp-Protector

避免App无法启动以及多次启动崩溃的框架,启动崩溃的最后防线。

一、功能特性

  1. 崩溃检测及分级策略:两次崩溃执行一级安全模式,三次崩溃执行二级安全模式;
  2. 提供自修复能力,可自定义进入安全模式的处理策略;
  3. 提供阻塞进程能力,可执行同步热修复;
  4. 提供详细崩溃信息的获取及崩溃的回调能力;
  5. 可定制崩溃后策略,例如重启的忽略策略;
  6. 提供快速回归的能力;

二、应用场景

主要针对应用启动阶段崩溃,例如接口错误、文件损坏等,可能会发生连续Crash;而即便是有热修复,但Crash发生在热修复之前也是无能为力。因此我们需要一道防线,可以对App进行主动的自修复,同时提供同步的热修复能力;那么任何启动崩溃就都不怕了。

三、集成使用

  • Gradle中配置;
    compile 'com.startup:protector:1.0.1'
  • 初始化;

    • Application中设置;
          Protector.getInstance()
                  .addTask(new Runnable() {// register Runnable to be executed when firstlevel crash occured.
                      @Override
                      public void run() {
                          Toast.makeText(getApplicationContext(), "执行注册逻辑", 1).show();
                      }
                  })
                  .addSynchronousTask(new TestProtectorTask())
                  .addCrashManager(new TestCrashManager())
                  .setCrashCallBack(new TestCrashCallBack())
                  .setRestart(false)
                  .init(ProtectorApp.this);
      

    备注:框架的注册需要在自定义的UncaughtExceptionHandler之后。

    • 退出应用的时候调用,崩溃的统计(策略触发使用)会更加精确;

          Protector.getInstance().lanuchSucceed();
      
    • 备注;

         使用addSynchronousTask()添加同步方法时,任务执行完毕不需要阻塞进程时务必要调用onPostExecute()方法,否则进程会一直阻塞;
      

四、详细说明

方法 说明
addTask 注册行为在一级安全模式触发;
addSynchronousTask 注册阻塞的行为在二级安全模式触发,例如热修复等;
addCrashManager Crash的管理类,决定是否重启,例如场景重启;
setCrashCallBack Crash的回调,可获取到崩溃的信息,有原始的Throwable以及整理后的Msg;
setRestart 设置是否重启,默认为true;true的状态下根据CrashManager最终决定是否重启,false则一定不会重启;
setDebug Log的开关;

五、其它

1、问题;

使用过程可根据Log输出信息观察,tag为protector;

2、测试;

    ProtectorTest.testJavaCrash();// 调用之后,应用就会崩溃;

3、混淆;

如果使用了Proguard,则需要添加以下混淆规则;

    -keep public class com.android.startup.protector.**{*;}
    -keep class * implements com.android.startup.protector.iprotector.CrashCallBack{*;}
    -keep class * implements com.android.startup.protector.iprotector.CrashManager{*;}
    -keep class * extends com.android.startup.protector.iprotector.ProtectorTask{*;}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].