Im using ApkTool to dessasemble DEX files from an APK to recover smali code. I have noticed that the .java
file has been splitted in different files.
For example:
- MainActivity.java -> MainActivity.smali, MainActivity$1.smali
- FirstFragment.java -> FirstFragment.smali, FirstFragment$1.smali, FirstFragment$2.smali
Is there a reason for why this happens?
I have an additional question in relation to that: why do the first lines of those files have different content if they reference the same file? They both reference the source "MainActivity.java" but have different classes.
MainActivity$1.smali
.class Lcom/example/testapp/MainActivity$1;
.super Ljava/lang/Object;
.source "MainActivity.java"
MainActivity.smali
.class public Lcom/example/testapp/MainActivity;
.super Landroidx/appcompat/app/AppCompatActivity;
.source "MainActivity.java"