Here is the TestClass and MainActivity.
In order to always show the Toast, I changed TestClass constructor using smali patching to following:
but after compiling and signing, the new patched apk could not be installed.
where is the problem??
Here is the patching code:
iput-boolean p1, p0, Lcom/example/test1/TestClass;->testB:Z
if-nez p1, :cond_0
const/4 p1, 0x1
iput-boolean p1, p0, Lcom/example/test1/TestClass;->testB:Z
:cond_0
This is the LOGCAT during installation:
1772 1772 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
1772 1772 D AndroidRuntime: CheckJNI is OFF
1772 1772 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
1772 1772 E memtrack: Couldn't load memtrack module (No such file or directory)
1772 1772 E android.os.Debug: failed to load memtrack module: -2
1772 1772 I Radio-JNI: register_android_hardware_Radio DONE
1772 1772 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
1594 1606 D DefContainer: Copying /data/local/tmp/app-release_SIGNED_UNALIGNED.apk to base.apk
637 662 D NativeLibraryHelper: Library 'libtoolChecker.so' is not page-aligned - will not be able to open it directly from apk.
637 662 W NativeHelper: Failure copying native libraries [errorCode=-2]
637 662 I art : Starting a blocking GC Explicit
637 662 I art : Explicit concurrent mark sweep GC freed 34438(1881KB) AllocSpace objects, 2(40KB) LOS objects, 33% free, 6MB/9MB, paused 267us total 14.270ms
1772 1772 I art : System.exit called, status: 1
1772 1772 I AndroidRuntime: VM exiting with result code 1.