Created
July 28, 2020 14:04
-
-
Save ZVNexus/4e045400168ce10d23ea304d29861ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.android.carrierconfig; | |
import android.os.PersistableBundle; | |
import android.service.carrier.CarrierIdentifier; | |
import android.service.carrier.CarrierService; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import java.io.IOException; | |
import java.util.regex.Pattern; | |
import org.xmlpull.v1.XmlPullParser; | |
import org.xmlpull.v1.XmlPullParserException; | |
import org.xmlpull.v1.XmlPullParserFactory; | |
public class DefaultCarrierConfigService extends CarrierService { | |
private XmlPullParserFactory mFactory = null; | |
public DefaultCarrierConfigService() { | |
Log.d("DefaultCarrierConfigService", "Service created"); | |
} | |
/* JADX WARNING: Removed duplicated region for block: B:39:0x0136 A[Catch:{ IOException | XmlPullParserException -> 0x0177 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:55:0x01dc A[Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:56:0x01df A[Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:59:0x01fb A[Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:69:0x0269 A[Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:70:0x026c A[Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 }] */ | |
/* JADX WARNING: Removed duplicated region for block: B:73:0x0288 A[Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 }] */ | |
/* Code decompiled incorrectly, please refer to instructions dump. */ | |
public android.os.PersistableBundle onLoadConfig(android.service.carrier.CarrierIdentifier r14) { | |
/* | |
r13 = this; | |
java.lang.String r0 = "DefaultCarrierConfigService" | |
java.lang.String r1 = "Config being fetched" | |
android.util.Log.d(r0, r1) | |
r0 = 0 | |
if (r14 != 0) goto L_0x000b | |
return r0 | |
L_0x000b: | |
android.os.PersistableBundle r1 = new android.os.PersistableBundle | |
r1.<init>() | |
monitor-enter(r13) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
org.xmlpull.v1.XmlPullParserFactory r2 = r13.mFactory // Catch:{ all -> 0x0174 } | |
if (r2 != 0) goto L_0x001b | |
org.xmlpull.v1.XmlPullParserFactory r2 = org.xmlpull.v1.XmlPullParserFactory.newInstance() // Catch:{ all -> 0x0174 } | |
r13.mFactory = r2 // Catch:{ all -> 0x0174 } | |
L_0x001b: | |
monitor-exit(r13) // Catch:{ all -> 0x0174 } | |
org.xmlpull.v1.XmlPullParserFactory r2 = r13.mFactory // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
org.xmlpull.v1.XmlPullParser r2 = r2.newPullParser() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
int r3 = r14.getCarrierId() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r4 = -1 | |
if (r3 == r4) goto L_0x012f | |
android.os.PersistableBundle r3 = new android.os.PersistableBundle // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r3.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r4 = new android.os.PersistableBundle // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r4.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r5 = new android.os.PersistableBundle // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r5.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.Context r6 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.telephony.TelephonyManager r6 = android.telephony.TelephonyManager.from(r6) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.StringBuilder r7 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r7.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r8 = r14.getMcc() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r7.append(r8) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r8 = r14.getMnc() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r7.append(r8) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r7 = r7.toString() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
int r6 = r6.getCarrierIdFromMccMnc(r7) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.Context r7 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.res.AssetManager r7 = r7.getAssets() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r8 = "" | |
java.lang.String[] r7 = r7.list(r8) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
int r8 = r7.length // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r9 = 0 | |
L_0x006b: | |
if (r9 >= r8) goto L_0x0110 | |
r10 = r7[r9] // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.StringBuilder r11 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "carrier_config_carrierid_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
int r12 = r14.getSpecificCarrierId() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r11 = r11.toString() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
boolean r11 = r10.startsWith(r11) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r11 == 0) goto L_0x00a5 | |
android.content.Context r4 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.res.AssetManager r4 = r4.getAssets() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.io.InputStream r4 = r4.open(r10) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r6 = "utf-8" | |
r2.setInput(r4, r6) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r0 = readConfigFromXml(r2, r0) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
goto L_0x0111 | |
L_0x00a5: | |
java.lang.StringBuilder r11 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "carrier_config_carrierid_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
int r12 = r14.getCarrierId() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r11 = r11.toString() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
boolean r11 = r10.startsWith(r11) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r11 == 0) goto L_0x00db | |
android.content.Context r3 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.res.AssetManager r3 = r3.getAssets() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.io.InputStream r3 = r3.open(r10) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r10 = "utf-8" | |
r2.setInput(r3, r10) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r3 = readConfigFromXml(r2, r0) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
goto L_0x010c | |
L_0x00db: | |
java.lang.StringBuilder r11 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "carrier_config_carrierid_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r11.append(r6) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r12 = "_" | |
r11.append(r12) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r11 = r11.toString() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
boolean r11 = r10.startsWith(r11) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r11 == 0) goto L_0x010c | |
android.content.Context r5 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.res.AssetManager r5 = r5.getAssets() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.io.InputStream r5 = r5.open(r10) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r10 = "utf-8" | |
r2.setInput(r5, r10) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r5 = readConfigFromXml(r2, r0) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
L_0x010c: | |
int r9 = r9 + 1 | |
goto L_0x006b | |
L_0x0110: | |
r0 = r4 | |
L_0x0111: | |
java.lang.String r4 = "DefaultCarrierConfigService" | |
java.lang.String r6 = "1 - onLoadConfig() android parser" | |
android.util.Log.i(r4, r6) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
boolean r4 = r0.isEmpty() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r4 != 0) goto L_0x011f | |
goto L_0x0130 | |
L_0x011f: | |
boolean r0 = r3.isEmpty() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r0 != 0) goto L_0x0127 | |
r0 = r3 | |
goto L_0x0130 | |
L_0x0127: | |
boolean r0 = r5.isEmpty() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r0 != 0) goto L_0x012f | |
r0 = r5 | |
goto L_0x0130 | |
L_0x012f: | |
r0 = r1 | |
L_0x0130: | |
boolean r1 = r0.isEmpty() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
if (r1 == 0) goto L_0x0186 | |
android.content.Context r0 = r13.getApplicationContext() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.content.res.AssetManager r0 = r0.getAssets() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.StringBuilder r1 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r1.<init>() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r3 = "carrier_config_mccmnc_" | |
r1.append(r3) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r3 = r14.getMcc() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r1.append(r3) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r3 = r14.getMnc() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
r1.append(r3) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r3 = ".xml" | |
r1.append(r3) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r1 = r1.toString() // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.io.InputStream r0 = r0.open(r1) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r1 = "utf-8" | |
r2.setInput(r0, r1) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
java.lang.String r0 = "DefaultCarrierConfigService" | |
java.lang.String r1 = "1 - onLoadConfig() android parser by mccmnc" | |
android.util.Log.i(r0, r1) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
android.os.PersistableBundle r0 = readConfigFromXml(r2, r14) // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
goto L_0x0186 | |
L_0x0174: | |
r0 = move-exception | |
monitor-exit(r13) // Catch:{ all -> 0x0174 } | |
throw r0 // Catch:{ IOException | XmlPullParserException -> 0x0177 } | |
L_0x0177: | |
r0 = move-exception | |
java.lang.String r0 = r0.toString() | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
android.util.Log.d(r1, r0) | |
android.os.PersistableBundle r0 = new android.os.PersistableBundle | |
r0.<init>() | |
L_0x0186: | |
android.content.Context r13 = r13.getApplicationContext() | |
android.content.res.Resources r13 = r13.getResources() | |
r1 = 2130771968(0x7f010000, float:1.7147041E38) | |
android.content.res.XmlResourceParser r13 = r13.getXml(r1) | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
java.lang.String r2 = "2 - onLoadConfig() Qualcomm vendorInput at vendor.xml" | |
android.util.Log.i(r1, r2) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
r2.<init>() // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
java.lang.String r3 = "onLoadConfig() id = " | |
r2.append(r3) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
r2.append(r14) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
java.lang.String r2 = r2.toString() // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
android.util.Log.d(r1, r2) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
android.os.PersistableBundle r13 = readConfigFromXml(r13, r14) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
r0.putAll(r13) // Catch:{ IOException | XmlPullParserException -> 0x01b9 } | |
goto L_0x01c3 | |
L_0x01b9: | |
r13 = move-exception | |
java.lang.String r13 = r13.toString() | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
android.util.Log.e(r1, r13) | |
L_0x01c3: | |
java.io.File r13 = new java.io.File // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r1 = "/etc/vendor-platform.xml" | |
r13.<init>(r1) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
r2.<init>() // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r3 = "3 - opVendorXml is " | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
boolean r3 = r13.exists() // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
if (r3 == 0) goto L_0x01df | |
java.lang.String r3 = "" | |
goto L_0x01e1 | |
L_0x01df: | |
java.lang.String r3 = "not " | |
L_0x01e1: | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r3 = "exist at " | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r3 = "/etc/vendor-platform.xml" | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r2 = r2.toString() // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
android.util.Log.i(r1, r2) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
boolean r1 = r13.exists() // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
if (r1 == 0) goto L_0x0250 | |
org.xmlpull.v1.XmlPullParser r1 = android.util.Xml.newPullParser() // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.io.FileReader r2 = new java.io.FileReader // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
r2.<init>(r13) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
r1.setInput(r2) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
java.lang.String r13 = "DefaultCarrierConfigService" | |
java.lang.String r2 = "3 - onLoadConfig() opVendorInput" | |
android.util.Log.i(r13, r2) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
android.os.PersistableBundle r13 = readConfigFromXml(r1, r14) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
r0.putAll(r13) // Catch:{ FileNotFoundException -> 0x0239, IOException | XmlPullParserException -> 0x022e, Exception -> 0x0216 } | |
goto L_0x0250 | |
L_0x0216: | |
r13 = move-exception | |
java.lang.StringBuilder r1 = new java.lang.StringBuilder | |
r1.<init>() | |
java.lang.String r2 = "Exception: " | |
r1.append(r2) | |
r1.append(r13) | |
java.lang.String r13 = r1.toString() | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
android.util.Log.e(r1, r13) | |
goto L_0x0250 | |
L_0x022e: | |
r13 = move-exception | |
java.lang.String r13 = r13.toString() | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
android.util.Log.e(r1, r13) | |
goto L_0x0250 | |
L_0x0239: | |
r13 = move-exception | |
java.lang.StringBuilder r1 = new java.lang.StringBuilder | |
r1.<init>() | |
java.lang.String r2 = "FileNotFoundException: " | |
r1.append(r2) | |
r1.append(r13) | |
java.lang.String r13 = r1.toString() | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
android.util.Log.e(r1, r13) | |
L_0x0250: | |
java.io.File r13 = new java.io.File // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r1 = "/etc/vendor-project.xml" | |
r13.<init>(r1) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r1 = "DefaultCarrierConfigService" | |
java.lang.StringBuilder r2 = new java.lang.StringBuilder // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
r2.<init>() // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r3 = "4 - opVendorProjectXml is " | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
boolean r3 = r13.exists() // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
if (r3 == 0) goto L_0x026c | |
java.lang.String r3 = "" | |
goto L_0x026e | |
L_0x026c: | |
java.lang.String r3 = "not " | |
L_0x026e: | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r3 = "exist at " | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r3 = "/etc/vendor-project.xml" | |
r2.append(r3) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r2 = r2.toString() // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
android.util.Log.i(r1, r2) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
boolean r1 = r13.exists() // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
if (r1 == 0) goto L_0x02dd | |
org.xmlpull.v1.XmlPullParser r1 = android.util.Xml.newPullParser() // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.io.FileReader r2 = new java.io.FileReader // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
r2.<init>(r13) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
r1.setInput(r2) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
java.lang.String r13 = "DefaultCarrierConfigService" | |
java.lang.String r2 = "4 - onLoadConfig() opVendorProjectInput" | |
android.util.Log.i(r13, r2) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
android.os.PersistableBundle r13 = readConfigFromXml(r1, r14) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
r0.putAll(r13) // Catch:{ FileNotFoundException -> 0x02c6, IOException | XmlPullParserException -> 0x02bb, Exception -> 0x02a3 } | |
goto L_0x02dd | |
L_0x02a3: | |
r13 = move-exception | |
java.lang.StringBuilder r14 = new java.lang.StringBuilder | |
r14.<init>() | |
java.lang.String r1 = "Exception: " | |
r14.append(r1) | |
r14.append(r13) | |
java.lang.String r13 = r14.toString() | |
java.lang.String r14 = "DefaultCarrierConfigService" | |
android.util.Log.e(r14, r13) | |
goto L_0x02dd | |
L_0x02bb: | |
r13 = move-exception | |
java.lang.String r13 = r13.toString() | |
java.lang.String r14 = "DefaultCarrierConfigService" | |
android.util.Log.e(r14, r13) | |
goto L_0x02dd | |
L_0x02c6: | |
r13 = move-exception | |
java.lang.StringBuilder r14 = new java.lang.StringBuilder | |
r14.<init>() | |
java.lang.String r1 = "FileNotFoundException: " | |
r14.append(r1) | |
r14.append(r13) | |
java.lang.String r13 = r14.toString() | |
java.lang.String r14 = "DefaultCarrierConfigService" | |
android.util.Log.e(r14, r13) | |
L_0x02dd: | |
return r0 | |
*/ | |
throw new UnsupportedOperationException("Method not decompiled: com.android.carrierconfig.DefaultCarrierConfigService.onLoadConfig(android.service.carrier.CarrierIdentifier):android.os.PersistableBundle"); | |
} | |
static PersistableBundle readConfigFromXml(XmlPullParser xmlPullParser, CarrierIdentifier carrierIdentifier) throws IOException, XmlPullParserException { | |
PersistableBundle persistableBundle = new PersistableBundle(); | |
if (xmlPullParser == null) { | |
return persistableBundle; | |
} | |
while (true) { | |
int next = xmlPullParser.next(); | |
if (next == 1) { | |
return persistableBundle; | |
} | |
if (next == 2) { | |
if ("carrier_config".equals(xmlPullParser.getName()) && (carrierIdentifier == null || checkFilters(xmlPullParser, carrierIdentifier))) { | |
persistableBundle.putAll(PersistableBundle.restoreFromXml(xmlPullParser)); | |
} | |
} | |
} | |
} | |
/* JADX WARNING: Code restructure failed: missing block: B:38:0x00a5, code lost: | |
r3 = false; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:43:0x00c4, code lost: | |
if (r7.equals(java.lang.Integer.valueOf(r12.getSpecificCarrierId())) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:44:0x00c6, code lost: | |
r3 = true; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:47:0x00cf, code lost: | |
if (matchOnIccid(r7, r12) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:50:0x00da, code lost: | |
if (r7.equalsIgnoreCase(android.os.Build.DEVICE) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:53:0x00e3, code lost: | |
if (matchOnImsi(r7, r12) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:56:0x00ec, code lost: | |
if (matchOnSP(r7, r12) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:59:0x00f9, code lost: | |
if (r7.equalsIgnoreCase(r12.getGid2()) != false) goto L_0x00c6; | |
*/ | |
/* JADX WARNING: Code restructure failed: missing block: B:83:0x0177, code lost: | |
r0 = r0 + 1; | |
*/ | |
/* Code decompiled incorrectly, please refer to instructions dump. */ | |
static boolean checkFilters(org.xmlpull.v1.XmlPullParser r11, android.service.carrier.CarrierIdentifier r12) { | |
/* | |
r0 = 0 | |
r1 = 0 | |
r2 = 1 | |
r4 = r0 | |
r5 = r4 | |
r0 = r1 | |
r3 = r2 | |
L_0x0007: | |
int r6 = r11.getAttributeCount() | |
if (r0 >= r6) goto L_0x017b | |
java.lang.String r6 = r11.getAttributeName(r0) | |
java.lang.String r7 = r11.getAttributeValue(r0) | |
r8 = -1 | |
int r9 = r6.hashCode() | |
switch(r9) { | |
case -1335157162: goto L_0x007b; | |
case 98494: goto L_0x0070; | |
case 107917: goto L_0x0066; | |
case 108258: goto L_0x005c; | |
case 114097: goto L_0x0052; | |
case 3172527: goto L_0x0048; | |
case 3172528: goto L_0x003e; | |
case 3236474: goto L_0x0034; | |
case 3373707: goto L_0x0029; | |
case 100017508: goto L_0x001f; | |
default: goto L_0x001d; | |
} | |
L_0x001d: | |
goto L_0x0084 | |
L_0x001f: | |
java.lang.String r9 = "iccid" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 7 | |
goto L_0x0084 | |
L_0x0029: | |
java.lang.String r9 = "name" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 9 | |
goto L_0x0084 | |
L_0x0034: | |
java.lang.String r9 = "imsi" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 5 | |
goto L_0x0084 | |
L_0x003e: | |
java.lang.String r9 = "gid2" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 3 | |
goto L_0x0084 | |
L_0x0048: | |
java.lang.String r9 = "gid1" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 2 | |
goto L_0x0084 | |
L_0x0052: | |
java.lang.String r9 = "spn" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 4 | |
goto L_0x0084 | |
L_0x005c: | |
java.lang.String r9 = "mnc" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = r2 | |
goto L_0x0084 | |
L_0x0066: | |
java.lang.String r9 = "mcc" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = r1 | |
goto L_0x0084 | |
L_0x0070: | |
java.lang.String r9 = "cid" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 8 | |
goto L_0x0084 | |
L_0x007b: | |
java.lang.String r9 = "device" | |
boolean r9 = r6.equals(r9) | |
if (r9 == 0) goto L_0x0084 | |
r8 = 6 | |
L_0x0084: | |
java.lang.String r9 = "DefaultCarrierConfigService" | |
switch(r8) { | |
case 0: goto L_0x0167; | |
case 1: goto L_0x0156; | |
case 2: goto L_0x00fc; | |
case 3: goto L_0x00ef; | |
case 4: goto L_0x00e6; | |
case 5: goto L_0x00dd; | |
case 6: goto L_0x00d2; | |
case 7: goto L_0x00c9; | |
case 8: goto L_0x00a8; | |
case 9: goto L_0x0177; | |
default: goto L_0x0089; | |
} | |
L_0x0089: | |
java.lang.StringBuilder r3 = new java.lang.StringBuilder | |
r3.<init>() | |
java.lang.String r8 = "Unknown attribute " | |
r3.append(r8) | |
r3.append(r6) | |
java.lang.String r6 = "=" | |
r3.append(r6) | |
r3.append(r7) | |
java.lang.String r3 = r3.toString() | |
android.util.Log.e(r9, r3) | |
L_0x00a5: | |
r3 = r1 | |
goto L_0x0177 | |
L_0x00a8: | |
if (r3 == 0) goto L_0x00a5 | |
int r3 = r12.getCarrierId() | |
java.lang.Integer r3 = java.lang.Integer.valueOf(r3) | |
boolean r3 = r7.equals(r3) | |
if (r3 != 0) goto L_0x00c6 | |
int r3 = r12.getSpecificCarrierId() | |
java.lang.Integer r3 = java.lang.Integer.valueOf(r3) | |
boolean r3 = r7.equals(r3) | |
if (r3 == 0) goto L_0x00a5 | |
L_0x00c6: | |
r3 = r2 | |
goto L_0x0177 | |
L_0x00c9: | |
if (r3 == 0) goto L_0x00a5 | |
boolean r3 = matchOnIccid(r7, r12) | |
if (r3 == 0) goto L_0x00a5 | |
goto L_0x00c6 | |
L_0x00d2: | |
if (r3 == 0) goto L_0x00a5 | |
java.lang.String r3 = android.os.Build.DEVICE | |
boolean r3 = r7.equalsIgnoreCase(r3) | |
if (r3 == 0) goto L_0x00a5 | |
goto L_0x00c6 | |
L_0x00dd: | |
if (r3 == 0) goto L_0x00a5 | |
boolean r3 = matchOnImsi(r7, r12) | |
if (r3 == 0) goto L_0x00a5 | |
goto L_0x00c6 | |
L_0x00e6: | |
if (r3 == 0) goto L_0x00a5 | |
boolean r3 = matchOnSP(r7, r12) | |
if (r3 == 0) goto L_0x00a5 | |
goto L_0x00c6 | |
L_0x00ef: | |
if (r3 == 0) goto L_0x00a5 | |
java.lang.String r3 = r12.getGid2() | |
boolean r3 = r7.equalsIgnoreCase(r3) | |
if (r3 == 0) goto L_0x00a5 | |
goto L_0x00c6 | |
L_0x00fc: | |
java.lang.StringBuilder r6 = new java.lang.StringBuilder | |
r6.<init>() | |
java.lang.String r8 = "checkFilters() check gid1 = " | |
r6.append(r8) | |
r6.append(r7) | |
java.lang.String r8 = ", result = " | |
r6.append(r8) | |
r6.append(r3) | |
java.lang.String r6 = r6.toString() | |
android.util.Log.d(r9, r6) | |
boolean r6 = carrierCheckGid1PrefixBytes(r4, r5) | |
if (r6 == 0) goto L_0x012e | |
if (r3 == 0) goto L_0x012c | |
java.lang.String r3 = r12.getGid1() | |
boolean r3 = startsWithIgnoreCase(r3, r7) | |
if (r3 == 0) goto L_0x012c | |
L_0x012a: | |
r3 = r2 | |
goto L_0x013b | |
L_0x012c: | |
r3 = r1 | |
goto L_0x013b | |
L_0x012e: | |
if (r3 == 0) goto L_0x012c | |
java.lang.String r3 = r12.getGid1() | |
boolean r3 = r7.equalsIgnoreCase(r3) | |
if (r3 == 0) goto L_0x012c | |
goto L_0x012a | |
L_0x013b: | |
java.lang.StringBuilder r6 = new java.lang.StringBuilder | |
r6.<init>() | |
java.lang.String r10 = "checkFilters() exit gid1 = " | |
r6.append(r10) | |
r6.append(r7) | |
r6.append(r8) | |
r6.append(r3) | |
java.lang.String r6 = r6.toString() | |
android.util.Log.d(r9, r6) | |
goto L_0x0177 | |
L_0x0156: | |
if (r3 == 0) goto L_0x0164 | |
java.lang.String r3 = r12.getMnc() | |
boolean r3 = r7.equals(r3) | |
if (r3 == 0) goto L_0x0164 | |
r3 = r2 | |
goto L_0x0165 | |
L_0x0164: | |
r3 = r1 | |
L_0x0165: | |
r5 = r7 | |
goto L_0x0177 | |
L_0x0167: | |
if (r3 == 0) goto L_0x0175 | |
java.lang.String r3 = r12.getMcc() | |
boolean r3 = r7.equals(r3) | |
if (r3 == 0) goto L_0x0175 | |
r3 = r2 | |
goto L_0x0176 | |
L_0x0175: | |
r3 = r1 | |
L_0x0176: | |
r4 = r7 | |
L_0x0177: | |
int r0 = r0 + 1 | |
goto L_0x0007 | |
L_0x017b: | |
return r3 | |
*/ | |
throw new UnsupportedOperationException("Method not decompiled: com.android.carrierconfig.DefaultCarrierConfigService.checkFilters(org.xmlpull.v1.XmlPullParser, android.service.carrier.CarrierIdentifier):boolean"); | |
} | |
private static boolean carrierCheckGid1PrefixBytes(String str, String str2) { | |
StringBuilder sb = new StringBuilder(); | |
sb.append("carrierCheckGid1StartBytes() currMcc = "); | |
sb.append(str); | |
sb.append(", currMnc = "); | |
sb.append(str2); | |
String str3 = "DefaultCarrierConfigService"; | |
Log.d(str3, sb.toString()); | |
if (str == null || str2 == null || !str.equals("234") || !str2.equals("10")) { | |
Log.d(str3, "carrierCheckGid1StartBytes() return false"); | |
return false; | |
} | |
Log.d(str3, "carrierCheckGid1StartBytes() return true"); | |
return true; | |
} | |
private static boolean startsWithIgnoreCase(String str, String str2) { | |
if (str == null || str2 == null || str.length() < str2.length() || !str2.equalsIgnoreCase(str.substring(0, str2.length()))) { | |
return false; | |
} | |
return true; | |
} | |
static boolean matchOnImsi(String str, CarrierIdentifier carrierIdentifier) { | |
String imsi = carrierIdentifier.getImsi(); | |
if (imsi != null) { | |
return Pattern.compile(str, 2).matcher(imsi).matches(); | |
} | |
return false; | |
} | |
static boolean matchOnSP(String str, CarrierIdentifier carrierIdentifier) { | |
String spn = carrierIdentifier.getSpn(); | |
if ("null".equalsIgnoreCase(str)) { | |
if (TextUtils.isEmpty(spn)) { | |
return true; | |
} | |
} else if (spn != null) { | |
return Pattern.compile(str, 2).matcher(spn).matches(); | |
} | |
return false; | |
} | |
static boolean matchOnIccid(String str, CarrierIdentifier carrierIdentifier) { | |
String iccid = carrierIdentifier.getIccid(); | |
if ("null".equalsIgnoreCase(str)) { | |
if (TextUtils.isEmpty(iccid)) { | |
return true; | |
} | |
} else if (iccid != null) { | |
for (String startsWith : str.split(",")) { | |
if (iccid.startsWith(startsWith)) { | |
return true; | |
} | |
} | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment