[英]Crashlytics for Android: Disable automatic upload of mapping file via Gradle build
I'd like to use crashlytics in our app, but I'm not allowed to upload it's proguard mapping file anywhere to the outside world (company policy). 我想在我们的应用程序中使用crashlytics,但我不允许将它的proguard映射文件上传到外部世界(公司政策)。 Is it possible to use Crashlytics but with obfuscated stacktraces?
是否可以使用Crashlytics但使用混淆的堆栈跟踪?
In io.fabric plugin's docs I've found this option: 在io.fabric插件的文档中,我找到了这个选项:
ext.enableCrashlytics = false
But it disables whole reporting, so that's not what I want. 但它会禁用整个报告,因此这不是我想要的。
They have everything planned ! 他们有计划好的一切! ;-) According to this link : "Crashlytics automatically de-obfuscates stack traces for your reports ", so you shouldn't have to worry about it.
;-)根据这个链接 :“Crashlytics会自动对报告的堆栈跟踪进行去混淆”,所以你不必担心它。
Simply obfuscate your app with ProGuard, don't forget to update ProGuard rules to avoid unexpected crashes with release app, and it should be ok ! 只需使用ProGuard模糊您的应用程序,不要忘记更新ProGuard规则以避免发布应用程序意外崩溃,它应该没问题!
(help page is about Eclipse, but I used Crashlytics with Android Studio just some days ago, and it works fine too) (帮助页面是关于Eclipse的,但是几天前我在Android Studio中使用了Crashlytics,它也运行正常)
EDIT 1 : and according to the very end of this second link , Crashlytics automatically upload mapping file during build. 编辑1 :根据第二个链接的最后 ,Crashlytics在构建期间自动上传映射文件。 It seems you aren't able to disable this.
看来你无法禁用它。
EDIT 2 : maybe if you use Ant, you would be able to customize (at least a bit) build rules, thanks to crashlytics_build.xml and crashlytics_build_base.xml files. 编辑2 : 也许如果你使用Ant,你可以自定义(至少一点)构建规则,这要归功于crashlytics_build.xml和crashlytics_build_base.xml文件。 But I'm not used to Ant, and even there, when I read file, it seems the "mapping files auto upload" can't be disabled.
但我不习惯Ant,甚至在那里,当我读取文件时,似乎无法禁用“映射文件自动上传”。 :-/
: - /
I have added this at the end of app gradle file: 我在app gradle文件的末尾添加了这个:
tasks.whenTaskAdded {task ->
if(task.name.toLowerCase().contains("crashlytics")) {
task.enabled = false
}
}
Build log: 构建日志:
> Task :app:crashlyticsStoreDeobsDebug SKIPPED
> Task :app:crashlyticsUploadDeobsDebug SKIPPED
Please note that this disables all crashlytics related tasks. 请注意,这会禁用所有与崩解相关的任务。 Uploading proguard mapping file by default is some kind of misunderstanding.
默认情况下上传proguard映射文件是一种误解。 It is like uploading private key and its password.
这就像上传私钥及其密码一样。 This file should only be stored in your vault.
此文件只应存储在您的保管库中。 So I guess it is better to completely disable all their task by default :)
所以我想最好在默认情况下完全禁用所有任务:)
I am just wondering why this is not a big issue for developers. 我只是想知道为什么这对开发人员来说不是一个大问题。
try disable task 'crashlyticsUploadDeobs': 尝试禁用任务'crashlyticsUploadDeobs':
afterEvaluate {
for (Task task : project.tasks.matching { it.name.startsWith('crashlyticsUploadDeobs') }) {
task.enabled = false
}}
如果您当时没有互联网连接,那么将会发生什么样的映射将上传到崩溃关系。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.