XML Parser launches AV Alert

I am developing an Android application that reads current exchange rates from an online XML file and parses it using the w3c DOM. The file is located on my AWS S3 repository.

The parser works fine, and I get all the bets since I want them, but the Anti-Virus application (avast!) Continues to mark my application as malware ( Android: Agent-YI [Trj] ). When I comment on the code and the method I use, it simply returns true , AV continues to be silent, and so I narrowed it down to the code below.

Does anyone know why AB is not accepting my code? The only application permissions are:

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> 

Parser Code:

 public static boolean fetchCurrencyRates(String in) { boolean success = true; HashMap<String, Double> onlineRates = new HashMap<String, Double>(); try { Document xmlRates = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in); xmlRates.getDocumentElement().normalize(); NodeList xmlItems = xmlRates.getElementsByTagName("item"); for(int i = 0; i < xmlItems.getLength(); i++) { Node n = xmlItems.item(i); if(n != null && n.getNodeType() == Node.ELEMENT_NODE) { Element currency = (Element) n; String code = currency.getElementsByTagName("title").item(0) .getTextContent() .substring(0, 3); String rate = currency.getElementsByTagName("description").item(0) .getTextContent() .split(" ")[3]; Log.i("DEV", code + ": " + rate); onlineRates.put(code, Double.parseDouble(rate.replaceAll(",", ""))); } } } catch(Exception e) { Log.e("DEV", e.getMessage(); success = false; } return success && !onlineRates.isEmpty(); } 

I also tried using XmlPullParser as recommended in the Android Documentation, but ran into the same problem.

+1
source share
1 answer

I understood why AV did not like my code. XML parsing did not seem to cause the problem in the end ...

I used AsyncTask to load the data and have not yet implemented visual feedback ( ProgessDialog ). This was enough for an AV warning.

+1
source

All Articles