简体   繁体   English

如何检查Dalvik Cache是​​否被修改

[英]How to check if the Dalvik Cache was modified

So there are some tools out there that patch the App's Dalvik cache to remove copy protection - is there actually a way of checking the dalvik cache? 所以有一些工具可以修补App的Dalvik缓存来删除复制保护 - 实际上有一种方法可以检查dalvik缓存吗?

Is it just the DEX file that is copied, and if yes, does it still have the same checksum? 它只是复制的DEX文件,如果是,它是否仍然具有相同的校验和? And is it actally possible for a non-root app to get the checksum? 并且非root应用程序是否可以获得校验和?

The files in the dalvik cache are not the original dex files - they are odex (optimized dex) files. dalvik缓存中的文件不是原始的dex文件 - 它们是odex(优化的dex)文件。 When an application is installed, its dex file is extracted, and then dalvik runs an optimization pass on it and stores the result in the dalvik cache. 安装应用程序时,将解压缩其dex文件,然后dalvik在其上运行优化传递并将结果存储在dalvik缓存中。

The directory permissions on the dalvik cache directory prevent a non-system application from listing the directory contents, but the execute permission is set and the odex files themselves are world readable, so an application can access them if it knows their file name. dalvik缓存目录上的目录权限阻止非系统应用程序列出目录内容,但是设置了执行权限并且odex文件本身是全局可读的,因此应用程序可以在知道其文件名时访问它们。

However, it would be difficult to check the integrity of an odex file, because they are potentially different on every device. 但是,检查odex文件的完整性将很困难,因为它们在每个设备上可能都不同。 So you wouldn't be able to do a simple checksum check. 所以你将无法进行简单的校验和检查。

I imagine you would have to do a deep comparison of the dex file structures, and compare them against the original dex file. 我想你必须对dex文件结构进行深入比较,并将它们与原始dex文件进行比较。 If you wanted to be really sure, you would need to de-odex the odex file first, and then compare the result with the original dex file. 如果你想确定,首先需要对odex文件进行去索引,然后将结果与原始dex文件进行比较。

I think you can call dexopt process (directly in the device) and compare the new generated dex with the one in the dalvik cache, off course if your cached dex is modified the change can disable the check itself. 我认为您可以调用dexopt进程(直接在设备中)并将新生成的dex与dalvik缓存中的dex进行比较,当然如果您的缓存dex被修改,则更改可以禁用检查本身。 The author of lucky patcher suggested to load external code from assets and then execute in place, but this it's not going to be easy and 100% effective 幸运补丁的作者建议从资产中加载外部代码然后执行到位,但这并不容易且100%有效

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM