package com.xiaomi.push; import com.vivo.push.PushClientConstants; import java.io.InputStream; import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.Vector; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserFactory; public final class fa { private static int a = 5000; private static int b = 330000; /* renamed from: c reason: collision with root package name */ private static int f2722c = 600000; private static int d = 330000; private static Vector<String> e = new Vector<>(); static { try { for (ClassLoader classLoader : d()) { Enumeration<URL> resources = classLoader.getResources("META-INF/smack-config.xml"); while (resources.hasMoreElements()) { InputStream inputStream = null; try { inputStream = resources.nextElement().openStream(); XmlPullParser newPullParser = XmlPullParserFactory.newInstance().newPullParser(); newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", true); newPullParser.setInput(inputStream, "UTF-8"); int eventType = newPullParser.getEventType(); do { if (eventType == 2) { if (newPullParser.getName().equals(PushClientConstants.TAG_CLASS_NAME)) { String nextText = newPullParser.nextText(); try { Class.forName(nextText); } catch (ClassNotFoundException unused) { System.err.println("Error! A startup class specified in smack-config.xml could not be loaded: ".concat(String.valueOf(nextText))); } } else if (newPullParser.getName().equals("packetReplyTimeout")) { a = a(newPullParser, a); } else if (newPullParser.getName().equals("keepAliveInterval")) { b = a(newPullParser, b); } else if (newPullParser.getName().equals("mechName")) { e.add(newPullParser.nextText()); } } eventType = newPullParser.next(); } while (eventType != 1); } catch (Exception e2) { e2.printStackTrace(); } catch (Throwable th) { try { inputStream.close(); } catch (Exception unused2) { } throw th; } try { inputStream.close(); } catch (Exception unused3) { } } } } catch (Exception e3) { e3.printStackTrace(); } } private fa() { } private static int a(XmlPullParser xmlPullParser, int i) { try { return Integer.parseInt(xmlPullParser.nextText()); } catch (NumberFormatException e2) { e2.printStackTrace(); return i; } } public static String a() { return "3.1.0"; } public static int b() { return b; } public static int c() { return f2722c; } private static ClassLoader[] d() { ClassLoader[] classLoaderArr = {fa.class.getClassLoader(), Thread.currentThread().getContextClassLoader()}; ArrayList arrayList = new ArrayList(); for (int i = 0; i < 2; i++) { ClassLoader classLoader = classLoaderArr[i]; if (classLoader != null) { arrayList.add(classLoader); } } return (ClassLoader[]) arrayList.toArray(new ClassLoader[arrayList.size()]); } }