[英]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.