这可能是一个基本问题,但我是 xml 解析的新手,这就是我需要帮助的原因。所以问题是:我只想从 android 的 res 文件夹中读取一个 xml 文件,并更新该文件中某个标签的值;那么,怎么办呢?请帮帮我。以下是 xml 文件,我想更新当前值为“moneyback”的标签“事件过滤器”的值。我搜索了很多线程,但仍然无法解决问题。
<?xml version="1.0" encoding="UTF-8"?>
<HawkAgentPolicy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<config>
<installedappthreadtime>10</installedappthreadtime>
<runningprocessthreadtime>10</runningprocessthreadtime>
<networkconnectionsthreadtime>10</networkconnectionsthreadtime>
</config>
<policy name="DayCapturePolicy" type="capture">
<starttime>9:00:00 AM</starttime>
<endtime>9:00:00 PM</endtime>
<event name="NEW_APP_INSTALLED">
<eventFilter selectedAppName="Moneyback"/>
<eventParam>selectedAppName</eventParam>
<eventParam>selectedAppVersion</eventParam>
<eventParam>appPackageName</eventParam>
<eventParam>appDirPath</eventParam>
</event>
<event name="NEW_PROCESS_STARTED">
<eventFilter runningAppName="Moneyback" />
<eventParam>runningAppName</eventParam>
<eventParam>runningAppProcessId</eventParam>
<eventParam>runningProcessName</eventParam>
</event>
<event name="INBOUND_CONNECTION">
<eventFilter netAppName="Moneyback"/>
<eventParam>netProtocol</eventParam>
<eventParam>netRemoteIP</eventParam>
<eventParam>netRemotePort</eventParam>
<eventParam>netStatus</eventParam>
<eventParam>netUID</eventParam>
<eventParam>netAppName</eventParam>
</event>
<event name="OUTBOUND_CONNECTION">
<eventFilter netAppName="Moneyback"/>
<eventParam>netProtocol</eventParam>
<eventParam>netRemoteIP</eventParam>
<eventParam>netRemotePort</eventParam>
<eventParam>netStatus</eventParam>
<eventParam>netUID</eventParam>
<eventParam>netAppName</eventParam>
</event>
</policy>
</HawkAgentPolicy>