a crash recovery framework.(一个App异常恢复框架)
APACHE-2.0 License
A crash recovery framework!
RecoveryCrash
Gradle
implementation 'com.zxy.android:recovery:1.0.0'
debugImplementation 'com.zxy.android:recovery:1.0.0'
releaseImplementation 'com.zxy.android:recovery-no-op:1.0.0'
Maven
<dependency>
<groupId>com.zxy.android</groupId>
<artifactId>recovery</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>
Application
Recovery.getInstance()
.debug(true)
.recoverInBackground(false)
.recoverStack(true)
.mainPage(MainActivity.class)
.recoverEnabled(true)
.callback(new MyCrashCallback())
.silent(false, Recovery.SilentMode.RECOVER_ACTIVITY_STACK)
.skip(TestActivity.class)
.init(this);
CrashRecoveryActivityApplication
Recovery.getInstance()
.debug(true)
.recoverInBackground(false)
.recoverStack(true)
.mainPage(MainActivity.class)
.recoverEnabled(true)
.callback(new MyCrashCallback())
.silent(false, Recovery.SilentMode.RECOVER_ACTIVITY_STACK)
.skip(TestActivity.class)
.init(this);
RecoveryActivitydebugrecoverEnabled(false);
Argument | Type | Function |
---|---|---|
debug | boolean | debug |
recoverInBackgroud | boolean | Crash |
recoverStack | boolean | Activity StackActivity |
mainPage | Class<? extends Activity> | |
callback | RecoveryCallback | Crash |
silent | boolean,SilentMode | trueCrashRecoveryActivityActivity |
SilentMode
- RESTART -
- RECOVER_ACTIVITY_STACK - Activity
- RECOVER_TOP_ACTIVITY - Activity
- RESTART_AND_CLEAR -
public interface RecoveryCallback {
void stackTrace(String stackTrace);
void cause(String cause);
void exception(String throwExceptionType, String throwClassName, String throwMethodName, int throwLineNumber);
void throwable(Throwable throwable);
}
RecoveryActivitystyles
<color name="recovery_colorPrimary">#2E2E36</color>
<color name="recovery_colorPrimaryDark">#2E2E36</color>
<color name="recovery_colorAccent">#BDBDBD</color>
<color name="recovery_background">#3C4350</color>
<color name="recovery_textColor">#FFFFFF</color>
<color name="recovery_textColor_sub">#C6C6C6</color>
{SDCard Dir}/Android/data/{packageName}/files/recovery_crash/
VERSION-0.0.5
****VERSION-0.0.6
****VERSION-0.0.7
****VERSION-0.0.8
Activity,:skip()
VERSION-0.0.9
UI
VERSION-0.1.0
,Recovery,
VERSION-0.1.3
no-op
VERSION-0.1.4
.
VERSION-0.1.5
fix 8.0+ hook bug
VERSION-0.1.6
update
VERSION-1.0.0
8.0
Copyright 2016 zhengxiaoyong
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.