简体   繁体   English

classes.dex 文件不包含我的 java 类

[英]classes.dex file does't contain my java classes

在此处输入图片说明

I have developed an app in android studio and test it in my phone.我已经在 android studio 中开发了一个应用程序并在我的手机中进行了测试。 I have formatted my computer and forgot to save my project to somewhere.我已经格式化了我的计算机,但忘记将我的项目保存到某个地方。 Now i want to get my source codes back.现在我想取回我的源代码。 I get the APK file from my phone (either by using adb and some other tools).我从手机中获取 APK 文件(通过使用 adb 和其他一些工具)。

I am using dex2jar and decompile my classes.dex file but it does not show my own Java classes.我正在使用 dex2jar 并反编译我的 classes.dex 文件,但它没有显示我自己的 Java 类。 Is it possible to get them back?有没有可能让他们回来?

You can decompile it so easily a great tutorial below:您可以轻松地反编译它,下面是一个很棒的教程:

https://futurestud.io/tutorials/how-to-decompile-an-android-app-apk https://futurestud.io/tutorials/how-to-decompile-an-android-app-apk

4 easy steps as below: 4个简单的步骤如下:

1- unzip you apk like you unzip any zip file 1- 像解压缩任何 zip 文件一样解压缩您的 apk

2-find classes.dex files 2-查找classes.dex文件

3-convert them to jar file using dexToJar tool 3-使用dexToJar工具将它们转换为 jar 文件

4- open the jar file using JD-Gui application (availbale for windows/ubuntu/mac) 4- 使用JD-Gui应用程序打开 jar 文件(适用于 windows/ubuntu/mac)

This is usually done by some obfuscator, such as Proguard .这通常由一些混淆器完成,例如Proguard This means, among other things, that the class names of your classes will be changed into meaningless names (such as A/B/C) the names will still be different in the fully qualified path of a java class, eg you might have multiple ""A" classes in different packages, but other than that you will have those class names multiple times. In most cases it will not harm te functionality of your program, but it will make it harder to reverse-engineer.这意味着,除其他外,您的类的类名将被更改为无意义的名称(例如 A/B/C),这些名称在 Java 类的完全限定路径中仍然不同,例如您可能有多个不同包中的“A”类,但除此之外,您将多次使用这些类名。在大多数情况下,它不会损害程序的功能,但会使逆向工程变得更加困难。

If this is your app and you can rebuild it, you can disable ProGuard or a subset of its features, otherwise you will need to reverse engineer it on your own.如果这是您的应用程序并且您可以重建它,您可以禁用 ProGuard 或其功能的子集,否则您将需要自己对其进行逆向工程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 反编译classes.dex文件没有显示我的实际Java代码 - Decompiling classes.dex file doesn't show my actual java code .apk如何不包含classes.dex但可以工作? - How it is possible that .apk do not contain classes.dex but works? 为什么Android Studio中的Java文件不同于Java文件从classes.dex中提取 - why java files in android studio Different from the java file Extract from classes.dex 以编程方式/动态将 classes.dex 包含到 jar 文件中 - programmatically / dynamically include classes.dex into jar file ionic框架更新后,Classes.dex文件大小增加了 - Classes.dex file size increased after ionic framework updated 在运行时出现NoClassDefFoundError,但类在classes.dex中,是什么? - NoClassDefFoundError at runtime but class is in classes.dex, what givies? bin / classes.dex中的ANDROID / Univert.BA - ANDROID/Univert.BA in bin/classes.dex 在Android应用程序中获取classes.dex的字节码 - Getting byte code of classes.dex in android app jar 文件不包含导入的包和类吗? - Does jar file not contain imported packages and classes? 提取“.aab”文件时出错:dex 文件索引无效,期望文件“classes٢.dex”但找到“classes2.dex” - Error extracting an `.aab` file: Invalid dex file indices, expecting file 'classes٢.dex' but found 'classes2.dex'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM