安卓项目混淆详解,移动应用开发专业核心课程


Proguard使用,我们需要在项目里的build.gradle文件里配置Proguard。

buildTypes {

release {

shrinkResources true

minifyEnabled true

proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’

}

}

getDefaultProguardFile(‘proguard-android.txt’) 方法可从 Android SDK tools/proguard/ 文件夹获取默认 ProGuard 设置。

提示:要想做进一步的代码压缩,可尝试使用位于同一位置的 proguard-android-optimize.txt 文件。它包括相同的 ProGuard 规则,但还包括其他在字节码一级(方法内和方法间)执行分析的优化,以进一步减小 APK 大小和帮助提高其运行速度。

shrinkResources 是去除无效的资源文件,压缩资源。

minifyEnabled 是开启混淆。

这是默认的Proguard配置,proguard-rules.pro是需要在你的项目里创建的文件,层级跟build.gradle文件一样的,当然你可以随意改他的文件名,只不过需要在配置代码里面跟着修改,其实这个文件就是Proguard的自定义配置文件,没有这个文件你构建是会报错的。

proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’

如果你希望在不通的渠道版本里使用不同的ProGuard 规则,那就在相应的 productFlavor 代码块中再添加一个 proguardFiles 属性。例如,以下 Gradle 文件会向 flavor2 产品风味添加 flavor2-rules.pro。现在 flavor2 使用所有三个 ProGuard 规则,因为还应用了来自 release 代码块的规则。

android {

buildTypes {

release {

shrinkResources true

minifyEnabled true

proguardFiles getDefaultProguardFile(‘proguard-android.txt’),‘proguard-rules.pro’

}

}

productFlavors {

flavor1 {

}

flavor2 {

proguardFile ‘flavor2-rules.pro’

}

}

}

每次构建时 ProGuard 都会输出下列文件:

dump.txt //说明 APK 中所有类文件的内部结构。

mapping.txt //提供原始与混淆过的类、方法和字段名称之间的转换。

seeds.txt //

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This asset obfuscates your code to make it harder for bad guys to reverse engineer your projects. Specifically designed for Unity, it seamlessly links in with its build process. The top priority of this package is to work straight out of the box with no extra steps required. While other obfuscators can stop a game from working, Beebyte's obfuscator looks for specific Unity related code that must be protected. The contents of your source files are unchanged, the obfuscation targets the compiled assembly. Features: - Supports IL2CPP - Supports Assembly Definition Files (Unity 2017.3+) - Removes Namespaces without any conflicts - Recognises Unity related code that must not be changed - Renames Classes (including MonoBehaviours†) - Renames Methods - Renames Parameters - Renames Fields - Renames Properties - Renames Events - String literal obfuscation - Adds fake methods - Easy and extensive customisation using the Unity inspector window - Consistent name translations are possible across multiple builds and developers - Semantically secure cryptographic naming convention for renamed members The asset works for both Unity Free and Unity Pro version 4.2.0 onwards (including Unity 5 & 2017 & 2018). Build targets include Standalone, Android, iOS, WebGL, UWP. Other platforms are not guaranteed or supported but may become supported at a future date. † There is currently a bug with renaming MonoBehaviour classes on Unity 2018.2. A bug report has been submitted to Unity. IL2CPP builds are much harder to reverse engineer but strings and member information (class, method names etc) are visible in the global-metadata.dat file. Obfuscation will apply to this file adding further security. Why not complement your security with the Anti-Cheat Toolkit - a great third party asset. For more information about the Obfuscator, please see the FAQ
好的,针对这个问题,我可以为您提供以下的系统设计说明: 1. 功能需求分析 在进行系统设计之前,我们需要先对应用的功能需求进行分析,这样才能确保我们要开发的应用能够满足用户的需求。对于音乐播放器应用而言,其主要功能需求包括:音乐的播放、暂停、停止、快进、快退、音量控制、播放列表管理、歌曲搜索、歌曲下载等。 2. 架构设计 在确定了应用的功能需求之后,我们需要对应用的架构进行设计。在这里,我们可以采用MVVM(Model-View-ViewModel)架构模式,这种模式可以将应用的业务逻辑与其界面分离,使得应用更易于维护和扩展。 3. 数据库设计 音乐播放器应用需要使用到数据库来存储歌曲信息、播放列表、用户喜好等数据。我们可以采用SQLite数据库来实现数据的存储和管理。 4. 用户界面设计 用户界面是用户与应用交互的重要部分,因此其设计应该注重用户体验。在设计用户界面时,我们可以采用Material Design设计风格,并遵循Android应用的设计规范。 5. 技术选型 在开发应用时,我们需要选择适合的技术来实现应用的功能。针对音乐播放器应用而言,我们可以使用Android原生的MediaPlayer类来实现音乐的播放、暂停、停止、快进、快退等功能,使用OkHttp来实现歌曲的下载,使用Glide来实现图片的加载等。 6. 打包和发布 完成应用的开发后,我们需要对应用进行打包和发布。在打包应用时,我们需要对应用进行混淆和优化,以提高应用的性能和安全性。在发布应用时,我们可以通过Google Play等应用商店来发布应用,并为应用设置合适的价格和分类。 以上就是安卓移动应用音乐播放器开发的系统设计说明。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值