allatori8.0文档翻译-第十步:增加过期日期

10 篇文章 1 订阅

第十步:增加过期日期

相关文件位于“tutorial/step10-expiry-date/files”目录下:

文件说明
test.jar鼠标手势demo的jar文件
config.xmlAllatori 配置文件
RunAllatori.batAllatori启动脚本
MouseGesturesOriginal.bat鼠标手势原始启动脚本
MouseGesturesObfuscated.bat混淆后的鼠标手势启动脚本
Clean.bat清空文件的脚本
mousegestures-1.2.jar鼠标手势类库

这里基于第二步修改配置文件:

<config>
    <input>
        <jar in="test.jar" out="obf-test.jar"/>
        <jar in="mousegestures-1.2.jar" out="obf-mousegestures-1.2.jar"/>
    </input>

    <keep-names>
        <class template="class *.TestFrame"/>
    </keep-names>

    <property name="log-file" value="log.xml"/>

    <expiry date="2000/01/01" string="EXPIRED!"/> <!-- we set expiry date to January 01, 2000,
                                                       so the obfuscated application will be expired and would not run -->
</config>

混淆后的文件超时,不可运行。超时检查不仅修改了main方法,这使得跳过检查也不是很容易。这个特性能够使用在所有类库中,而不仅仅限于main方法。

如果你希望在构建后30天超时,你可以这么做:

  1. 在ant的标签中增加配置信息:
<tstamp>
        <format property="expiry.date" pattern="yyyy-MM-dd" offset="30" unit="day"/>
    </tstamp>

这会在ant中根据你的需要创建一个日期

  1. 在Allatori配置文件中引用过期日期
 <expiry date="${expiry.date}" string="EXPIRED!"/>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值