I think the Android MUST provide additional information about deleted middleware exceptions
so I modify Parcel.java to wrap more information about deleted middleware exceptions
public final void writeException(Exception e) { int code = 0; if (e instanceof SecurityException) { code = EX_SECURITY; } else if (e instanceof BadParcelableException) { code = EX_BAD_PARCELABLE; } else if (e instanceof IllegalArgumentException) { code = EX_ILLEGAL_ARGUMENT; } else if (e instanceof NullPointerException) { code = EX_NULL_POINTER; } else if (e instanceof IllegalStateException) { code = EX_ILLEGAL_STATE; } writeInt(code); StrictMode.clearGatheredViolations(); if (code == 0) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException(e); } // I replace writeString(e.getMessage()) with writeString(remoteExceptionToString(e)) writeString(remoteExceptionToString(e)); } static String remoteExceptionToString(Exception e) { final StringWriter sw = new StringWriter(1024); final PrintWriter pw = new PrintWriter(sw, true); pw.println(); e.printStackTrace(pw); return sw.toString().replace("\n", String.format("\n(%5d %5d): ", Process.myPid(), Process.myTid())); }
SerializeExceptionSecondService defination:
public class SerializeExceptionSecondService extends Service { private static final String TAG = "SerializeExceptionSecondService"; public SerializeExceptionSecondService() { } @Override public IBinder onBind(Intent intent) {
fragment of AndroidManifest.xml:
<service android:name=".SerializeExceptionSecondService" android:enabled="true" android:exported="true" android:process=":second_remote" > </service>
thus, the middleware exception log code will look like this:

Yessy
source share