【发布时间】:2017-08-31 01:23:45
【问题描述】:
我的数据以这种方式保存到 firebase:
a: "Tom"
b: "26"
...
我知道,为了使用正确的键(“mName”而不是“a”,“mAge”而不是“b”等)保存它,我必须根据文件 https://firebase.google.com/docs/database/android/start/#proguard
# Add this global rule
-keepattributes Signature
# This rule will properly ProGuard all the model classes in
# the package com.yourcompany.models. Modify to fit the structure
# of your app.
-keepclassmembers class com.yourcompany.models.** {
*;
}
我的问题是:
-
假设我的包名是com.testing,添加的行应该是这样的吗?
-keepattributes 签名
-keepclassmembers class com.testing.models.** { *; }
或者第二行应该没有“模型”?像这样:
-keepclassmembers class com.testing.** {
- 此外,如果我只有 1 个名为 Data 的全局类保存到 firebase,我可以只保留这些类成员吗?或者我必须按照上面的方式行事..
【问题讨论】:
标签: android firebase firebase-realtime-database proguard android-proguard