[英]Dexguard 5.3.28 font issue
我已将我们的应用程序升级到Dexguard 5.3.28(最新版本),并且我们遇到字体相关的问题。 我知道新版本的dexguard混淆了资产,我认为这可能是问题所在。 使用5.0.34之类的旧版本时,我们没有问题。
我们将otf字体存储在asset / fonts /目录中。 并使用自定义TextView设置字体:xmlns:custom =“ http://schemas.android.com/apk/res/com.XXXX.XXXX.XXXX.XXX”
<com.XXXX.XXXX.XXXX.XXX.CustomTextView
android:id="@+id/custom_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="20sp"
custom:font="roman" />
设置字体有问题,效果很好,但是不能更改所有CustomTextViews。 我尝试使用-keepdirectories,-keep CusomTextView,但没有结果。
更新:由于某种原因,我认为attr.xml文件被混淆了,这里有些问题。
<attr name="font">
<enum name="light" value="1"/>
<enum name="roman" value="2"/>
</attr>
<declare-styleable name="com.XXXX.XXXX.XXXX.XXX.CustomButton">
<attr name="theme">
<enum name="gray" value="1"/>
<enum name="light_gray" value="2"/>
<enum name="pinger_blue" value="3"/>
</attr>
<attr name="font"/>
</declare-styleable>
<declare-styleable name="com.XXXX.XXXX.XXXX.XXX.CustomTextView">
<attr name="font"/>
</declare-styleable>
<declare-styleable name="CustomEllipsizedTextView">
<attr name="ellipsizeAtLine" format="integer"/>
</declare-styleable>
有没有什么方法可以使attr.xml变得清晰呢? 或其他建议?
DexGuard确实以两种方式混淆和改编资源XML文件。 您可能需要保留引用的自定义视图:
-keep class com.XXXX.XXXX.XXXX.XXX.CustomButton
-keep class com.XXXX.XXXX.XXXX.XXX.CustomTextView
否则,请通过Saikoa与我们联系,我们将对其进行详细研究。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.