This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainFragment : Fragment() { | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { | |
Timber.d("MainFragment created") | |
return inflater.inflate(R.layout.fragment_main, container, false) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:versionCode="1" | |
android:versionName="1.0" | |
android:compileSdkVersion="29" | |
android:compileSdkVersionCodename="10" | |
package="com.lolkek.secure" | |
platformBuildVersionCode="29" | |
platformBuildVersionName="10"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class public final Lcom/lolkek/secure/MyApplication; | |
.super Landroid/app/Application; | |
.source "" | |
# direct methods | |
.method public constructor <init>()V | |
.registers 1 | |
invoke-direct {p0}, Landroid/app/Application;-><init>()V | |
return-void | |
.end method | |
# virtual methods |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class public final Lb/b/a/a; | |
.super Ld/a/a$b; | |
.source "" | |
.method public constructor <init>()V | |
... | |
.end method | |
# virtual methods | |
.method public a(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V | |
.registers 5 | |
.annotation build Landroid/annotation/SuppressLint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.class public final Ld/a/a; | |
.super Ljava/lang/Object; | |
... | |
.method public static constructor <clinit>()V | |
... | |
.end method | |
.method public static a(Ld/a/a$b;)V | |
... | |
const-string v0, "Cannot plant Timber into itself." | |
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class Timber { | |
... | |
public static void plant(@NotNull Tree tree) { | |
... | |
if (tree == TREE_OF_SOULS) { | |
throw new IllegalArgumentException("Cannot plant Timber into itself."); | |
} | |
... | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DexEdit(contentOnly = true) // contentOnly tells compiler that we should replace only content, not class itself. | |
// As a benefit we should not look for base class and can focus on content | |
public class a { | |
// this is obfuscated tree.log() method | |
@DexReplace // replacing this method completely | |
public void a(int priority, String tag, String message, Throwable throwable) { | |
Log.e("HACKED", message); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public final class a { | |
public final void a$app(int priority, @NotNull String tag, @NotNull String message, @NotNull Throwable throwable) { | |
Intrinsics.checkParameterIsNotNull(tag, "tag"); | |
Intrinsics.checkParameterIsNotNull(message, "message"); | |
Intrinsics.checkParameterIsNotNull(throwable, "throwable"); | |
Log.e("HACKED", message); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@DexEdit(contentOnly = true) // overriding contentOnly. As well no need for searching base Application class, interfaces and etc. | |
public class MyApplication extends Application { | |
@DexAppend // add this code additionally to the method without replacing anything inside it | |
@Override | |
public void onCreate() { | |
Log.e("HAHAHA","YOU'VE BEEN HACKED!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object AnalyticsConstants { | |
object Events { | |
object FirstLaunch { | |
const val EVENT = "first_launch" | |
} | |
object SessionStart { | |
const val EVENT = "session_start" | |
} | |
object Navigated { // Each event is having its own class | |
const val EVENT = "navigated" // this is event name. |