- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经阅读了很多关于恶意软件编写者如何重新打包现有的良性 android .apk 并重新打包以添加恶意功能的文章。
现在,根据我对 .apk 文件结构的理解,每个 .apk 文件包含一个 .dex 文件,本质上是 java 字节转换为 .dex 格式。此外,该应用程序还有一个名为 manifest.xml 的二进制 XML 以及其他资源文件和 Assets 。如果我们必须向应用程序添加额外的恶意功能,那么我们必须修改 manifest.xml(可以通过将二进制 xml 转换回普通 xml 轻松完成)、资源(可以直接替换)和 .dex 文件.
但是 .dex 文件有一个特殊的结构。根据我的说法,对它所做的任何修改都应该破坏代码。这些工具使用什么技术来防止代码被破坏,因为如果向原始应用程序添加一些恶意功能,我们实际上是在添加一个额外的模块。
有哪些支持 .apk 文件重新打包的工具?
谢谢。
编辑:一些成员可能会觉得讨论逆向工程很冒犯。我是研究 Android 安全的研究生。我需要知道 .apk 文件重新打包是如何工作的,因为这是我的研究课题。此外,公开谈论逆向工程并不是恶意行为 - 关于逆向工程的书籍已经写成 - 出于恶意目的使用逆向工程是恶意的:)
最佳答案
在 Release模式下启用 proguard。这将使逆向工程变得更加困难。还要检查 this developer training documentation on security .
(来自对这个问题的评论)
您可以通过检查签名来验证包是否已被重新打包。一些帮助解决这个问题的文章:
Retrieving APK signature during runtime .
Self checking an APK signature.
How to check APK signature.
(最初发布的广告 Verify Android apk has not been repackaged? )
之前回答过一个关于反编译DEX代码的问题。我原来的答案现在可能已经过时了,但这个问题已经被其他人更新了。以下是其中列出的一些工具的概述。
A more complete version of fred's answer:
Manual way
First you need a tool to extract all the (compiled) classes on the DEX to a JAR. There's one called dex2jar, which is made by a chinese student.
Then, you can use jd-gui to decompile the classes on the JAR to source code. The resulting source should be quite readable, as dex2jar applies some optimizations.
1: http://code.google.com/p/dex2jar/
2: http://java.decompiler.free.fr/?q=jdguiAutomatic way
You can use APKTool. It will automatically extract all the classes (
.dex
), resources (.asrc
), then it will convert binary XML to human-readable XML, and it will also dissassemble the classes for you.
Disassembly will always be more robust than decompiling, especially with JARs obfuscated with Pro Guard!Just tell APKTool to decode the APK into a directory, then modify what you want, and finally encode it back to an APK. That's all.
Important: APKTool dissassembles. It doesn't decompile. The generated code won't be Java source. But you should be able to read it, and even edit it if you're familiar with jasmin. If you want Java source, please go over the Manual way.
关于Android应用重新打包: Why does it not break the code?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16747617/
是否有效率偏好以下控制流选项之一用于循环或切换另一个? 选项 1: switch(...){ case 1: if (...) { ... } else if
我需要在某个地方修复一些 CSS,因为我的文本没有环绕,如果它是一个非常长的单词,它会无限期地继续下去。 在大多数情况下,我在我的 CSS 文件中尝试了 word-wrap: break-word;
这个问题在这里已经有了答案: What is the difference between "word-break: break-all" versus "word-wrap: break-word
我的问题: overflow-wrap: break-word 和 word-break: break-word 有区别吗? 非重复: 这里有一些现有的问题,乍一看可能是重复的,但实际上不是。 Wha
我目前想知道两者之间有什么区别。当我同时使用它们时,如果它不适合容器,它们似乎会打破这个词。但为什么 W3C 做了两种方式来做呢? 最佳答案 word-wrap: break-word 最近更改为 o
满足条件时如何跳出循环? 例如: for (i in 0..10){ if (i==3){ // equivalent of break } } 最佳答案 Q#没有中
CSS3 规范说部分支持 word-wrap:break-word; 在 Chrome 中你必须使用 word-wrap:break-all; 但是没有连字符。我正在使用 text-align:jus
我想在我的 View 列表中显示来自数据库的所有评论。但有时,评论会很长。我试图用 word-wrap:break-word 来“打破”它们,但没有结果——像这样的评论 aaaaaaaaaaaaaaa
我正在尝试将一个长 URL 放置在侧边栏中,以在表格单元格宽度的范围内中断和换行。我已将 style="word-break:break-all;" 添加到 td 和围绕文本和 URL 的 span
我有以下代码: public void post(String message) { final String mess = message; (new Thread() {
是否有 word-break: break-word 的 alternative 可以在 firefox 中使用? 在 firefox[版本 57.0] 中 在 Chrome [版本 62.0.320
在this question以及this blog ,其中提到了样式 word-break 及其值。此外,还有值 break-word 作为属于例如的东西。 自动换行类。 在最近的 VS 中 MVC
我正在尝试将文本包装在 td 中并使用以下样式 word-break:break-all 在 IE 中工作得很好,但在 Firefox 中失败,请注意这是不支持的!尝试了 http://petesbl
我正在使用“word-break: break-all”在任何字符之间插入分隔符。 但是,在 Chrome 中,它无法正常处理特定字符(例如冒号、分号、逗号),如下所示。 (我的代码笔在这里:http
它只有在我用不同的元素包裹 anchor 标记时才有效,但我正在阅读 html,所以我想将它添加为整个页面的样式。 最佳答案 我不确定你想在这里实现什么,如果你能分享一些代码片段会很好。 无论如何,我
这些看起来都是一样的,有什么区别? https://jsfiddle.net/pmuub8w1/2/ p{ word-break:normal; } p{
目前下面的代码,保持div宽度固定,换行由于break-all .Test{ float: left; margin-bottom: 2px; word-wrap:break-word; word-b
我正在使用 word-break: break-all; 并想知道如何让浏览器自动插入 hyphens ,如 MDN example 中所示. div { width: 80px; heigh
我的 html 有这种结构: content1 content2 content3 content4 content5 content6 co
我正在尝试对齐图像旁边的文本。我想考虑没有空格的长字符串。 我的css如下 .new_item { width: 100%; float: left; border-bottom: 1px solid
我是一名优秀的程序员,十分优秀!