我已经在布局文件中实现gooeymenu预防:怎样的ProGuard从剥离阵列
<com.mschwartz.dailyflightbuddy.ui.GooeyMenu
android:id="@+id/gooeymenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@id/btn_text_cockpit"
android:layout_centerInParent="true"
android:alpha="0.8"
app:center_drawable="@drawable/ic_settings_white_48dp"
app:hide_on_start="true"
app:itemorientation="LEFT"
app:menu_reference="@array/gooeymenu_command_array" />
的menu_reference
标签指向文件res/values/array.xml
,内容如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="gooeymenu_command_array">
<item>@drawable/gooey_info_item</item>
<item>@drawable/gooey_zoom_item</item>
<item>@drawable/gooey_center_item</item>
<item>@drawable/gooey_city_item</item>
<item>@drawable/gooey_airport_item</item>
<item>@drawable/gooey_configure_item</item>
</array>
</resources>
在运行时调试器一切正常,但从剥离的生产版本运行时,gooeymenu不显示任何项目。
我曾尝试几个命令添加到proguard-rules.pro
包括以下内容:
-keepclassmembers class com.mschwartz.dailyflightbuddy.R$array {
*;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
但没有到目前为止任何运气。所以我的问题是:
- 我如何可以验证该领域确实已经从 生产APK剥离或我怎么能保证如果包括字段(或更常见的一类/方法)?
- 如何命令proguard添加字段?