1- package com .kinda . crash ;
1+ package com .developer . kinda ;
22
33import android .annotation .SuppressLint ;
44import android .app .Activity ;
1515import androidx .annotation .Nullable ;
1616import androidx .annotation .RestrictTo ;
1717import android .util .Log ;
18-
1918import java .io .PrintWriter ;
2019import java .io .Serializable ;
2120import java .io .StringWriter ;
2726import java .util .Deque ;
2827import java .util .List ;
2928import java .util .Locale ;
29+ import java .util .Objects ;
3030import java .util .zip .ZipEntry ;
3131import 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
3635public 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.
0 commit comments