如何压缩Winrar(.rar)所说的.APK文件,然后将其转换回.APK? [英] How to compress an .APK file say by Winrar(.rar) and then convert it back to .APK?

查看:511
本文介绍了如何压缩Winrar(.rar)所说的.APK文件,然后将其转换回.APK?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

众所周知,Xamarin Forms应用程序的缺点是体积庞大.尽管我在减少链接和使用Proguard等减小应用程序大小的方案中遇到了麻烦,但我的Android APK大小仍然很高(约30 MB).问题是,当我用Winrar压缩此apk时,大小达到了约11 MB.我将这个压缩的.rar文件重命名为.apk文件,但是当我尝试安装该文件时,收到消息:解析软件包时出现问题".

As you all know a disadvantage of Xamarin Forms apps is their huge size. Though I went through different scenarios for reducing app size such as Linking and using Proguard, my Android APK size is still so high(about 30 MB). The thing is when I compressed this apk by Winrar the size got to about 11 MB. I renamed this compressed .rar file to .apk file but when I tried to install this file I got the message: "There was a problem parsing the package".

所以我的问题是,是否有任何机制可以利用Winrar之类的工具来压缩APK文件,以便可以将其安装在任何Android设备上?

So my question is is there any mechanism to leverage the compression of a tool like winrar for an APK file so that it could be installed on any Android device?

推荐答案

不幸的是,这并不是那么容易. 在打包过程中,您的应用档案将被散列.如果您将其存档或对其进行任何其他篡改,则生成的应用程序存档将具有与其构建时所用的哈希不同的哈希值.由于安全原因,这将导致您的apk在安装时自行失效.

Unfortunately, this isn't that easy. During the packaging process, your app archive will be hashed. If you rar it or do any other tampering with the archive, the resulting app archive will have a different hash than the one it was built with. This will result in your apk invalidating itself on install due to security reasons.

这篇关于如何压缩Winrar(.rar)所说的.APK文件,然后将其转换回.APK?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆