Skip to content

Commit 2b40b59

Browse files
Updated Dependencies
1 parent 182a3b0 commit 2b40b59

File tree

12 files changed

+56
-64
lines changed

12 files changed

+56
-64
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ restartActivity(Class<? extends Activity>);
144144
```
145145
> This method sets the activity that must be launched by the error activity when the user presses the button to restart the app.
146146
> If you don't set it (or set it to null), the library will use the first activity on your manifest that has an intent-filter with action
147-
> `com.kinda.crash.RESTART`, and if there is none, the default launchable activity on your app.
147+
> `com.developer.kinda.RESTART`, and if there is none, the default launchable activity on your app.
148148
> If no launchable activity can be found and you didn't specify any, the "restart app" button will become a "close app" button,
149149
> even if `showRestartButton` is set to `true`.
150150
>
151151
> As noted, you can also use the following intent-filter to specify the restart activity:
152152
> ```xml
153153
> <intent-filter>
154154
> <!-- ... -->
155-
> <action android:name="com.kinda.crash.RESTART" />
155+
> <action android:name="com.developer.kinda.RESTART" />
156156
> </intent-filter>
157157
> ```
158158
@@ -162,13 +162,13 @@ errorActivity(Class<? extends Activity>);
162162
> This method allows you to set a custom error activity to be launched, instead of the default one.
163163
> Use it if you need further customization that is not just strings, colors or themes (see below).
164164
> If you don't set it (or set it to null), the library will use the first activity on your manifest that has an intent-filter with action
165-
> `com.kinda.crash.ERROR`, and if there is none, a default error activity from the library.
165+
> `com.developer.kinda.ERROR`, and if there is none, a default error activity from the library.
166166
> If you use this, the activity **must** be declared in your `AndroidManifest.xml`, with `process` set to `:error_activity`.
167167
>
168168
> Example:
169169
> ```xml
170170
> <activity
171-
> android:name="com.kinda.crash.sample.CustomErrorActivity"
171+
> android:name="com.developer.kinda.sample.CustomErrorActivity"
172172
> android:label="@string/error_title"
173173
> android:process=":error_activity" />
174174
> ```
@@ -177,7 +177,7 @@ errorActivity(Class<? extends Activity>);
177177
> ```xml
178178
> <intent-filter>
179179
> <!-- ... -->
180-
> <action android:name="com.kinda.crash.ERROR" />
180+
> <action android:name="com.developer.kinda.ERROR" />
181181
> </intent-filter>
182182
> ```
183183
@@ -200,7 +200,7 @@ If you want to specify a specific theme only for the error activity, you can do
200200
201201
```xml
202202
<activity
203-
android:name="com.kinda.crash.activity.DefaultErrorActivity"
203+
android:name="com.developer.kinda.activity.DefaultErrorActivity"
204204
android:theme="@style/YourThemeHere"
205205
android:process=":error_activity" />
206206
```

library/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ android {
88
resourcePrefix 'crash_'
99

1010
defaultConfig {
11-
minSdkVersion 15
11+
minSdkVersion 21
1212
targetSdkVersion 29
13-
versionCode 5
14-
versionName "2.0.19" //renamed library version properly.
13+
versionCode 6
14+
versionName "3.0.19"
1515
}
1616
buildTypes {
1717
release {
@@ -25,7 +25,7 @@ dependencies {
2525
implementation fileTree(include: ['*.jar'], dir: 'libs')
2626

2727
//ANDROID SUPPORT LIBRARIES
28-
implementation 'androidx.appcompat:appcompat:1.0.0'
28+
implementation 'androidx.appcompat:appcompat:1.0.2'
2929
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
3030
implementation 'androidx.recyclerview:recyclerview:1.0.0'
3131
implementation 'com.google.android.material:material:1.0.0'

library/src/main/AndroidManifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.kinda.crash">
3+
package="com.developer.kinda">
44

55
<application>
66
<activity
7-
android:name="com.kinda.crash.activity.DefaultErrorActivity"
7+
android:name="com.developer.kinda.activity.DefaultErrorActivity"
88
android:process=":error_activity" />
99
<provider
10-
android:name="com.kinda.crash.provider.CrashInitProvider"
10+
android:name="com.developer.kinda.provider.CrashInitProvider"
1111
android:authorities="${applicationId}.crashinitprovider"
1212
android:exported="false"
1313
android:initOrder="101" />

library/src/main/java/com/kinda/crash/CrashActivity.java library/src/main/java/com/developer/kinda/CrashActivity.java

+15-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash;
1+
package com.developer.kinda;
22

33
import android.annotation.SuppressLint;
44
import android.app.Activity;
@@ -15,7 +15,6 @@
1515
import androidx.annotation.Nullable;
1616
import androidx.annotation.RestrictTo;
1717
import android.util.Log;
18-
1918
import java.io.PrintWriter;
2019
import java.io.Serializable;
2120
import java.io.StringWriter;
@@ -27,25 +26,25 @@
2726
import java.util.Deque;
2827
import java.util.List;
2928
import java.util.Locale;
29+
import java.util.Objects;
3030
import java.util.zip.ZipEntry;
3131
import java.util.zip.ZipFile;
32-
33-
import com.kinda.crash.activity.DefaultErrorActivity;
34-
import com.kinda.crash.config.CrashConfig;
32+
import com.developer.kinda.activity.DefaultErrorActivity;
33+
import com.developer.kinda.config.CrashConfig;
3534

3635
public final class CrashActivity {
3736

3837
private final static String TAG = "CrashActivity";
3938

4039
//Extras passed to the error activity
41-
private static final String EXTRA_CONFIG = "com.kinda.crash.EXTRA_CONFIG";
42-
private static final String EXTRA_STACK_TRACE = "com.kinda.crash.EXTRA_STACK_TRACE";
43-
private static final String EXTRA_ACTIVITY_LOG = "com.kinda.crash.EXTRA_ACTIVITY_LOG";
40+
private static final String EXTRA_CONFIG = "com.developer.kinda.EXTRA_CONFIG";
41+
private static final String EXTRA_STACK_TRACE = "com.developer.kinda.EXTRA_STACK_TRACE";
42+
private static final String EXTRA_ACTIVITY_LOG = "com.developer.kinda.EXTRA_ACTIVITY_LOG";
4443

4544
//General constants
46-
private static final String INTENT_ACTION_ERROR_ACTIVITY = "com.kinda.crash.ERROR";
47-
private static final String INTENT_ACTION_RESTART_ACTIVITY = "com.kinda.crash.RESTART";
48-
private static final String CRASH_HANDLER_PACKAGE_NAME = "com.kinda.crash.";
45+
private static final String INTENT_ACTION_ERROR_ACTIVITY = "com.developer.kinda.ERROR";
46+
private static final String INTENT_ACTION_RESTART_ACTIVITY = "com.developer.kinda.RESTART";
47+
private static final String CRASH_HANDLER_PACKAGE_NAME = "com.developer.kinda.";
4948
private static final String DEFAULT_HANDLER_PACKAGE_NAME = "com.android.internal.os";
5049
private static final int MAX_STACK_TRACE_SIZE = 131071; //128 KB - 1
5150
private static final int MAX_ACTIVITIES_IN_LOG = 50;
@@ -259,7 +258,7 @@ public static String getStackTraceFromIntent(@NonNull Intent intent) {
259258
*/
260259
public static CrashConfig getConfigFromIntent(@NonNull Intent intent) {
261260
CrashConfig config = (CrashConfig) intent.getSerializableExtra(CrashActivity.EXTRA_CONFIG);
262-
if (config.isLogErrorOnRestart()) {
261+
if (Objects.requireNonNull(config).isLogErrorOnRestart()) {
263262
String stackTrace = getStackTraceFromIntent(intent);
264263
if (stackTrace != null) {
265264
Log.e(TAG, "The previous app process crashed. This is the stack trace of the crash:\n" + getStackTraceFromIntent(intent));
@@ -505,7 +504,7 @@ private static String capitalize(@Nullable String s) {
505504

506505
/**
507506
* INTERNAL method used to guess which activity must be called from the error activity to restart the app.
508-
* It will first get activities from the AndroidManifest with intent filter <action android:name="com.kinda.crash.RESTART" />,
507+
* It will first get activities from the AndroidManifest with intent filter <action android:name="com.developer.kinda.RESTART" />,
509508
* if it cannot find them, then it will get the default launcher.
510509
* If there is no default launcher, this returns null.
511510
*
@@ -528,13 +527,12 @@ private static Class<? extends Activity> guessRestartActivityClass(@NonNull Cont
528527
}
529528

530529
/**
531-
* INTERNAL method used to get the first activity with an intent-filter <action android:name="com.kinda.crash.RESTART" />,
530+
* INTERNAL method used to get the first activity with an intent-filter <action android:name="com.developer.kinda.RESTART" />,
532531
* If there is no activity with that intent filter, this returns null.
533532
*
534533
* @param context A valid context. Must not be null.
535534
* @return A valid activity class, or null if no suitable one is found
536535
*/
537-
@SuppressWarnings("unchecked")
538536
@Nullable
539537
private static Class<? extends Activity> getRestartActivityClassWithIntentFilter(@NonNull Context context) {
540538
Intent searchedIntent = new Intent().setAction(INTENT_ACTION_RESTART_ACTIVITY).setPackage(context.getPackageName());
@@ -579,7 +577,7 @@ private static Class<? extends Activity> getLauncherActivity(@NonNull Context co
579577

580578
/**
581579
* INTERNAL method used to guess which error activity must be called when the app crashes.
582-
* It will first get activities from the AndroidManifest with intent filter <action android:name="com.kinda.crash.ERROR" />,
580+
* It will first get activities from the AndroidManifest with intent filter <action android:name="com.developer.kinda.ERROR" />,
583581
* if it cannot find them, then it will use the default error activity.
584582
*
585583
* @param context A valid context. Must not be null.
@@ -601,7 +599,7 @@ private static Class<? extends Activity> guessErrorActivityClass(@NonNull Contex
601599
}
602600

603601
/**
604-
* INTERNAL method used to get the first activity with an intent-filter <action android:name="com.kinda.crash.ERROR" />,
602+
* INTERNAL method used to get the first activity with an intent-filter <action android:name="com.developer.kinda.ERROR" />,
605603
* If there is no activity with that intent filter, this returns null.
606604
*
607605
* @param context A valid context. Must not be null.

library/src/main/java/com/kinda/crash/activity/DefaultErrorActivity.java library/src/main/java/com/developer/kinda/activity/DefaultErrorActivity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash.activity;
1+
package com.developer.kinda.activity;
22

33
import android.annotation.SuppressLint;
44
import android.content.ClipData;
@@ -20,9 +20,9 @@
2020
import android.widget.TextView;
2121
import android.widget.Toast;
2222

23-
import com.kinda.crash.CrashActivity;
24-
import com.kinda.crash.R;
25-
import com.kinda.crash.config.CrashConfig;
23+
import com.developer.kinda.CrashActivity;
24+
import com.developer.kinda.R;
25+
import com.developer.kinda.config.CrashConfig;
2626

2727
public final class DefaultErrorActivity extends AppCompatActivity {
2828

library/src/main/java/com/kinda/crash/config/CrashConfig.java library/src/main/java/com/developer/kinda/config/CrashConfig.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash.config;
1+
package com.developer.kinda.config;
22

33
import android.app.Activity;
44
import androidx.annotation.DrawableRes;
@@ -11,7 +11,7 @@
1111
import java.lang.annotation.RetentionPolicy;
1212
import java.lang.reflect.Modifier;
1313

14-
import com.kinda.crash.CrashActivity;
14+
import com.developer.kinda.CrashActivity;
1515

1616
public class CrashConfig implements Serializable {
1717

library/src/main/java/com/kinda/crash/provider/CrashInitProvider.java library/src/main/java/com/developer/kinda/provider/CrashInitProvider.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash.provider;
1+
package com.developer.kinda.provider;
22

33
import android.content.ContentProvider;
44
import android.content.ContentValues;
@@ -7,7 +7,7 @@
77
import androidx.annotation.NonNull;
88
import androidx.annotation.Nullable;
99

10-
import com.kinda.crash.CrashActivity;
10+
import com.developer.kinda.CrashActivity;
1111

1212
public class CrashInitProvider extends ContentProvider {
1313

sample/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ android {
44
compileSdkVersion 29
55

66
defaultConfig {
7-
applicationId "com.kinda.crash.sample"
8-
minSdkVersion 15
7+
applicationId "com.developer.kinda.crashx"
8+
minSdkVersion 21
99
targetSdkVersion 29
10-
versionCode 5
11-
versionName "2.0.19" //renamed library version properly.
10+
versionCode 6
11+
versionName "3.0.19"
1212
}
1313
buildTypes {
1414
debug {
@@ -26,7 +26,7 @@ dependencies {
2626
implementation fileTree(include: ['*.jar'], dir: 'libs')
2727

2828
//ANDROID SUPPORT LIBRARIES
29-
implementation 'androidx.appcompat:appcompat:1.0.0'
29+
implementation 'androidx.appcompat:appcompat:1.0.2'
3030
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
3131
implementation 'androidx.recyclerview:recyclerview:1.0.0'
3232
implementation 'com.google.android.material:material:1.0.0'

sample/src/main/AndroidManifest.xml

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.kinda.crash.sample">
4+
package="com.developer.kinda.crashx">
55

66
<application
7-
android:name="com.kinda.crash.sample.CrashingApplication"
7+
android:name="com.developer.kinda.crashx.CrashingApplication"
88
android:allowBackup="true"
99
android:icon="@mipmap/ic_launcher"
1010
android:label="@string/app_name"
1111
android:theme="@style/SampleAppTheme"
1212
tools:ignore="AllowBackup,GoogleAppIndexingWarning">
1313
<activity
14-
android:name="com.kinda.crash.sample.activity.MainActivity"
14+
android:name="com.developer.kinda.crashx.activity.MainActivity"
1515
android:label="@string/app_name">
1616
<intent-filter>
1717
<action android:name="android.intent.action.MAIN" />
1818
<category android:name="android.intent.category.LAUNCHER" />
19-
<!-- You can also use this instead of using CrashActivity.setRestartActivityClass(MainActivity.class); -->
20-
<!--<action android:name="com.kinda.crash.RESTART" />-->
2119
</intent-filter>
2220
</activity>
2321

2422
<activity
25-
android:name="com.kinda.crash.sample.activity.ErrorActivity"
23+
android:name="com.developer.kinda.crashx.activity.ErrorActivity"
2624
android:label="@string/error_title"
2725
android:process=":error_activity">
28-
<!-- You can also use this instead of using CrashActivity.setErrorActivityClass(ErrorActivity.class); -->
29-
<!--<intent-filter>-->
30-
<!--<action android:name="com.kinda.crash.ERROR" />-->
31-
<!--</intent-filter>-->
3226
</activity>
3327
</application>
3428

sample/src/main/java/com/kinda/crash/sample/CrashingApplication.java sample/src/main/java/com/developer/kinda/crashx/CrashingApplication.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package com.kinda.crash.sample;
1+
package com.developer.kinda.crashx;
22

33
import android.app.Application;
44
import android.util.Log;
55

6-
import com.kinda.crash.CrashActivity;
7-
import com.kinda.crash.config.CrashConfig;
6+
import com.developer.kinda.CrashActivity;
7+
import com.developer.kinda.config.CrashConfig;
88

99
public class CrashingApplication extends Application {
1010

@@ -45,12 +45,12 @@ public void onCreate() {
4545
// .errorDrawable(R.mipmap.ic_launcher)
4646
//This sets the restart activity.
4747
//If you set this, this will be used. However, you can also set it with an intent-filter:
48-
// <action android:name="com.kinda.crash.RESTART" />
48+
// <action android:name="com.developer.kinda.RESTART" />
4949
//If none are set, the default launch activity will be used.
5050
// .restartActivity(MainActivity.class)
5151
//This sets a custom error activity class instead of the default one.
5252
//If you set this, this will be used. However, you can also set it with an intent-filter:
53-
// <action android:name="com.kinda.crash.ERROR" />
53+
// <action android:name="com.developer.kinda.ERROR" />
5454
//If none are set, the default launch activity will be used.
5555
//Comment it (and disable the intent filter) to see the customization effects on the default error activity.
5656
//Uncomment to use the custom error activity

sample/src/main/java/com/kinda/crash/sample/activity/ErrorActivity.java sample/src/main/java/com/developer/kinda/crashx/activity/ErrorActivity.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash.sample.activity;
1+
package com.developer.kinda.crashx.activity;
22

33
import android.os.Bundle;
44
import androidx.annotation.Nullable;
@@ -7,9 +7,9 @@
77
import android.widget.Button;
88
import android.widget.TextView;
99

10-
import com.kinda.crash.CrashActivity;
11-
import com.kinda.crash.config.CrashConfig;
12-
import com.kinda.crash.sample.R;
10+
import com.developer.kinda.CrashActivity;
11+
import com.developer.kinda.config.CrashConfig;
12+
import com.developer.kinda.crashx.R;
1313

1414
public class ErrorActivity extends AppCompatActivity {
1515

sample/src/main/java/com/kinda/crash/sample/activity/MainActivity.java sample/src/main/java/com/developer/kinda/crashx/activity/MainActivity.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.kinda.crash.sample.activity;
1+
package com.developer.kinda.crashx.activity;
22

33
import android.annotation.SuppressLint;
44
import android.os.AsyncTask;
@@ -8,7 +8,7 @@
88
import android.view.View;
99
import android.widget.Button;
1010

11-
import com.kinda.crash.sample.R;
11+
import com.developer.kinda.crashx.R;
1212

1313
public class MainActivity extends AppCompatActivity {
1414

0 commit comments

Comments
 (0)