示例#1
0
 public int REST(boolean z) {
   int i = 1;
   ApSingleton instance = ApSingleton.getInstance(this.ctx);
   int doGet = doGet(true);
   if (doGet != 1) {
     instance.getClass();
     return doGet;
   }
   if (this.returnData == null) {
     instance.getClass();
   } else if (z) {
     try {
       this.returnDataJSON = JSONObjectInstrumentation.init(this.returnData);
       try {
         if (this.returnDataJSON
             .getString(NotificationCompatApi21.CATEGORY_STATUS)
             .toLowerCase()
             .equals("ok")) {
           instance.getClass();
         }
       } catch (JSONException e) {
       }
       JSONArray jSONArray = instance.desired;
       JSONArray jSONArray2 = this.returnDataJSON.getJSONArray("desired");
       instance.desired = jSONArray2;
       if (jSONArray2 == null) {
         instance.getClass();
         i = 0;
       } else {
         trackResolve(instance.canonicalKeyspace);
         if (!(jSONArray == null || instance.desired.equals(jSONArray))) {
           instance.getClass();
           ApsalarSQLiteHelper.clearConfigTables();
           Apsalar.loadConfig(this.ctx);
           instance.devicesAlreadyResolved = false;
           instance.already_did_SQL = false;
         }
         instance.getClass();
       }
     } catch (Throwable th) {
       instance.incrExceptionCount();
       instance.getClass();
       i = 0;
     }
     if (!(instance.devicesAlreadyResolved || do_resolve())) {
       i = 0;
     }
   } else {
     instance.getClass();
     i = 0;
   }
   instance.getClass();
   return i;
 }
示例#2
0
 boolean do_resolve() {
   boolean z = false;
   ApSingleton instance = ApSingleton.getInstance(this.ctx);
   instance.getClass();
   boolean z2 = false;
   for (int i = 0; i < instance.desired.length(); i++) {
     try {
       String string = instance.desired.getString(i);
       if (alreadyResolved(string)) {
         instance.getClass();
       } else {
         String deviceId = Apsalar.getDeviceId(string);
         String str = instance.canonicalKeyspace;
         if (!string.equals(instance.canonicalKeyspace)
             || !deviceId.equals(instance.canonicalDeviceId)) {
           if (string.equals(str) && !string.equals(instance.canonicalKeyspace)) {
             if (!alreadyResolved(string)) {
               Log.d(
                   TAG,
                   "ApsalarResolve: found - RESOLVING... keySpace="
                       + string
                       + ", deviceId="
                       + deviceId);
               Apsalar.getDeviceId(string);
               this.info.deviceId = instance.info.deviceId;
               switch (doGet(false)) {
                 case ContentLengthStrategy.IDENTITY /*-1*/:
                 case R.SlidingUpPanelLayout_umanoPanelHeight /*0*/:
                   instance.getClass();
                   break;
                 case R.SlidingUpPanelLayout_umanoShadowHeight /*1*/:
                   instance.getClass();
                   trackResolve(string);
                   z2 = true;
                   break;
                 default:
                   break;
               }
             }
             z2 = true;
           } else {
             instance.getClass();
           }
         } else {
           instance.getClass();
           trackResolve(string);
           z2 = true;
         }
       }
     } catch (JSONException e) {
       instance.incrExceptionCount();
       instance.getClass();
     }
   }
   if (z2 || instance.resolved_ANDI || instance.resolved_AIFA) {
     z = true;
   }
   if (z) {
     instance.devicesAlreadyResolved = true;
   }
   return z;
 }