I'm modifying an apk and I have added code to close after comparing dates. I tried it in another application and it works perfectly. But I don't understand why it doesn't work with another apk. The application that gives me an error is made in kotlin (in its internal structure there is a folder with that name).
MainActivity.smali
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide p0
const-wide p1, 0x1591f30c900L
cmp-long p0, p0, p1
if-lez p0, :cond_50
const/4 v0, 0x1
const-string v1, "End"
invoke-static {p0, v1, v0}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object v0
invoke-virtual {v0}, Landroid/widget/Toast;->show()V
new-instance p0, Landroid/os/Handler;
invoke-direct {p0}, Landroid/os/Handler;-><init>()V
new-instance p0, Lcom/ball/gam/MainActivity$a;
invoke-direct {p0, p0}, Lcom/ball/gam/MainActivity$a;-><init>(Lcom/ball/gam/MainActivity;)V
const-wide/16 p1, 0x1770
invoke-virtual {p0, p0, p1, p2}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto/16 :goto_50
:cond_50
:goto_50
return-void
After opening the application you should compare the dates and in the case that the current date is greater than the one set, you should display the message toast End, wait 6 seconds and close the application. Log after opening the application:
.gam.MainActivity.onCreate(android.os.Bundle): [0xFFFFFFFF] wide register index out of range (10+1 >= 11) (declaration of com/ball/gam/MainActivity' appears in /data/app/com.ball.gamex-1/base.apk
User contributions licensed under CC BY-SA 3.0