Running Code From DEX JAR CLASS File

  • Android
  • October 3, 2021
  • 0

Roman Kryvolapov

The .dex format can be obtained from files in the .class format or from files in the .jar format, when compiling a project in Android Studio, the .dex files of all classes automatically are saved in the /app/build/intermediates/project_dex_archive/

At the bottom of this screen is a ConstraintLayout named myLayout, you can refer to it from code and output information to it, for example you can generate programmatically TextView and place it on this myLayout.

You can view the contents of the .dex file using jadx app or similar

Example of code in .dex file:

package com.romankryvolapov.runningfromdexfile;
public class Test {
public void test() {
MainActivity.myTextView.setText(“123”);
MainActivity.myLayout.removeAllViews();
MainActivity.myLayout.addView(MainActivity.myTextView);
}
}

Available on Google Playstore for Android

Tag:
Share:

ZArchiver

7Z Files Manager Zip 7Zip Rar Archive Files