예제 #1
0
 public void signup(LoginResultListener paramLoginResultListener)
 {
   Intent localIntent = new Intent("android.intent.action.VIEW");
   if (ConfigHelper.disableweblogin)
   {
     localIntent.setData(Uri.parse("dianping://signup"));
     localIntent.setFlags(335544320);
     this.context.startActivity(localIntent);
     this.loginResultListener = paramLoginResultListener;
     return;
   }
   String str2 = LoginUtils.getLoginGASource(this.context);
   String str3 = Environment.versionName();
   String str4 = Environment.mapiUserAgent();
   String str5 = preferences(DPApplication.instance()).getString("dpid", "");
   Object localObject = DPApplication.instance().locationService().location();
   String str1;
   if (localObject != null)
     str1 = Location.FMT.format(((DPObject)localObject).getDouble("Lat"));
   for (localObject = Location.FMT.format(((DPObject)localObject).getDouble("Lng")); ; localObject = "0")
   {
     localIntent.setData(Uri.parse("dianping://loginweb?url=http://m.dianping.com/reg/mobile/app&version=" + str3 + "&agent=" + str4 + "&dpid=" + str5 + "&gasource=" + str2 + "&lat=" + str1 + "&lng=" + (String)localObject));
     break;
     str1 = "0";
   }
 }
예제 #2
0
 private String processParam(String paramString)
 {
   int i = paramString.indexOf('?');
   if (i < 0)
     return paramString;
   String str1 = paramString.substring(0, i + 1);
   Object localObject1 = paramString.substring(i + 1);
   Matcher localMatcher = sParamPattern.matcher(paramString);
   label821: label1218: label1989: 
   while (localMatcher.find())
   {
     Object localObject2 = localMatcher.group();
     Log.d(TAG, "process param: " + (String)localObject2);
     String str2 = ((String)localObject2).substring(1);
     String[] arrayOfString = str2.split("=");
     if (arrayOfString.length <= 1)
       continue;
     arrayOfString[0] = arrayOfString[0].toLowerCase();
     if ((!PARAM_KEYS.contains(arrayOfString[0])) || ((!"*".equals(arrayOfString[1])) && (!"!".equals(arrayOfString[1]))))
       continue;
     localObject2 = localObject1;
     if ("agent".equals(arrayOfString[0]))
       localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + "android");
     localObject1 = localObject2;
     if ("version".equals(arrayOfString[0]))
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + Environment.versionName());
     localObject2 = localObject1;
     if ("screen".equals(arrayOfString[0]))
       localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + DeviceUtils.screen(getActivity()));
     localObject1 = localObject2;
     if ("sessionid".equals(arrayOfString[0]))
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + Environment.sessionId());
     localObject2 = localObject1;
     if ("deviceid".equals(arrayOfString[0]))
       localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + DeviceUtils.imei());
     localObject1 = localObject2;
     if ("uuid".equals(arrayOfString[0]))
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + DeviceUtils.uuid());
     localObject2 = localObject1;
     if ("dpid".equals(arrayOfString[0]))
       localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + DeviceUtils.dpid());
     localObject1 = localObject2;
     if ("cityid".equals(arrayOfString[0]))
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + ((NovaActivity)getActivity()).cityId());
     localObject2 = localObject1;
     Object localObject3;
     Object localObject4;
     label741: label894: int j;
     if ("newtoken".equals(arrayOfString[0]))
     {
       localObject3 = ((BaseAccountService)((NovaActivity)getActivity()).accountService()).newToken();
       if ("*".equals(arrayOfString[1]))
       {
         localObject4 = new StringBuilder().append(arrayOfString[0]).append("=");
         localObject2 = localObject3;
         if (localObject3 == null)
           localObject2 = "";
         localObject2 = ((String)localObject1).replace(str2, (String)localObject2);
       }
     }
     else
     {
       localObject1 = localObject2;
       if ("token".equals(arrayOfString[0]))
       {
         localObject3 = ((NovaActivity)getActivity()).accountService().token();
         if (!"*".equals(arrayOfString[1]))
           break label1480;
         localObject4 = new StringBuilder().append(arrayOfString[0]).append("=");
         localObject1 = localObject3;
         if (localObject3 == null)
           localObject1 = "";
         localObject1 = ((String)localObject2).replace(str2, (String)localObject1);
       }
       localObject4 = getCurrentLocation();
       localObject3 = ((NovaActivity)getActivity()).locationService().location();
       localObject2 = localObject1;
       StringBuilder localStringBuilder;
       if ("latitude".equals(arrayOfString[0]))
       {
         localObject2 = localObject1;
         if ("*".equals(arrayOfString[1]))
         {
           localStringBuilder = new StringBuilder().append(arrayOfString[0]).append("=");
           if (localObject4 != null)
             break label1602;
           localObject2 = "";
           localObject2 = ((String)localObject1).replace(str2, (String)localObject2);
         }
       }
       localObject1 = localObject2;
       if ("longitude".equals(arrayOfString[0]))
       {
         localObject1 = localObject2;
         if ("*".equals(arrayOfString[1]))
         {
           localStringBuilder = new StringBuilder().append(arrayOfString[0]).append("=");
           if (localObject4 != null)
             break label1617;
           localObject1 = "";
           localObject1 = ((String)localObject2).replace(str2, (String)localObject1);
         }
       }
       localObject2 = localObject1;
       if ("accuracy".equals(arrayOfString[0]))
       {
         localObject2 = localObject1;
         if ("*".equals(arrayOfString[1]))
         {
           localStringBuilder = new StringBuilder().append(arrayOfString[0]).append("=");
           if (localObject4 != null)
             break label1632;
           localObject2 = "";
           label967: localObject2 = ((String)localObject1).replace(str2, (String)localObject2);
         }
       }
       localObject1 = localObject2;
       if ("address".equals(arrayOfString[0]))
       {
         localObject1 = localObject2;
         if ("*".equals(arrayOfString[1]))
         {
           if (localObject3 != null)
             break label1648;
           localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=");
         }
       }
       j = 0;
       localObject2 = localObject1;
       i = j;
       if (0 == 0)
       {
         localObject2 = localObject1;
         i = j;
         if ("latitude".equals(arrayOfString[0]))
         {
           localObject2 = localObject1;
           i = j;
           if ("!".equals(arrayOfString[1]))
           {
             if (localObject4 != null)
               break label1740;
             i = 1;
             localObject2 = localObject1;
           }
         }
       }
       label1104: localObject1 = localObject2;
       j = i;
       if (i == 0)
       {
         localObject1 = localObject2;
         j = i;
         if ("longitude".equals(arrayOfString[0]))
         {
           localObject1 = localObject2;
           j = i;
           if ("!".equals(arrayOfString[1]))
           {
             if (localObject4 != null)
               break label1790;
             j = 1;
             localObject1 = localObject2;
           }
         }
       }
       localObject2 = localObject1;
       i = j;
       if (j == 0)
       {
         localObject2 = localObject1;
         i = j;
         if ("accuracy".equals(arrayOfString[0]))
         {
           localObject2 = localObject1;
           i = j;
           if ("!".equals(arrayOfString[1]))
           {
             if (localObject4 != null)
               break label1840;
             i = 1;
             localObject2 = localObject1;
           }
         }
       }
       localObject1 = localObject2;
       j = i;
       if (i == 0)
       {
         localObject1 = localObject2;
         j = i;
         if ("address".equals(arrayOfString[0]))
         {
           localObject1 = localObject2;
           j = i;
           if ("!".equals(arrayOfString[1]))
           {
             if (localObject3 != null)
               break label1891;
             j = 1;
             localObject1 = localObject2;
           }
         }
       }
     }
     while (true)
     {
       if (j == 0)
         break label1989;
       this.mPendingUrl = paramString;
       this.mPendingEvendId = 4;
       if (((NovaActivity)getActivity()).locationService().status() <= 0)
         ((NovaActivity)getActivity()).locationService().refresh();
       if (((NovaActivity)getActivity()).locationService().status() != -1)
         ((NovaActivity)getActivity()).showProgressDialog("正在定位...");
       return null;
       localObject2 = localObject1;
       if (!"!".equals(arrayOfString[1]))
         break;
       if (localObject3 != null)
       {
         localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + (String)localObject3);
         break;
       }
       this.mLoginParams.add(new BasicNameValuePair("title", this.mTitle));
       ((NovaActivity)getActivity()).gotoLogin(this.mLoginParams);
       this.mPendingUrl = (str1 + (String)localObject1);
       this.mPendingEvendId = 2;
       return null;
       label1480: localObject1 = localObject2;
       if (!"!".equals(arrayOfString[1]))
         break label741;
       if (localObject3 != null)
       {
         localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + (String)localObject3);
         break label741;
       }
       this.mLoginParams.add(new BasicNameValuePair("title", this.mTitle));
       ((NovaActivity)getActivity()).gotoLogin(this.mLoginParams);
       this.mPendingUrl = (str1 + (String)localObject2);
       this.mPendingEvendId = 2;
       return null;
       localObject2 = Location.FMT.format(((Location)localObject4).latitude());
       break label821;
       label1617: localObject1 = Location.FMT.format(((Location)localObject4).longitude());
       break label894;
       label1632: localObject2 = Location.FMT.format(((Location)localObject4).accuracy());
       break label967;
       label1648: if (!android.text.TextUtils.isEmpty(((DPObject)localObject3).getString("Road")))
       {
         localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + Uri.encode(((DPObject)localObject3).getString("Address")));
         break label1045;
       }
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=");
       break label1045;
       label1740: localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + Location.FMT.format(((Location)localObject4).latitude()));
       i = j;
       break label1104;
       label1790: localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + Location.FMT.format(((Location)localObject4).longitude()));
       j = i;
       break label1161;
       localObject2 = ((String)localObject1).replace(str2, arrayOfString[0] + "=" + Location.FMT.format(((Location)localObject4).accuracy()));
       i = j;
       break label1218;
       label1891: if (!android.text.TextUtils.isEmpty(((DPObject)localObject3).getString("Road")))
       {
         localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=" + Uri.encode(((DPObject)localObject3).getString("Address")));
         j = i;
         continue;
       }
       localObject1 = ((String)localObject2).replace(str2, arrayOfString[0] + "=");
       j = i;
     }
   }
   label1045: label1602: return (String)(String)(String)(String)(str1 + (String)localObject1);
 }
예제 #3
0
 public void login(LoginResultListener paramLoginResultListener, List<NameValuePair> paramList)
 {
   Intent localIntent = new Intent("android.intent.action.VIEW");
   Object localObject1;
   Object localObject2;
   if (ConfigHelper.disableweblogin)
   {
     localObject1 = Uri.parse("dianping://login").buildUpon();
     if (paramList != null)
     {
       paramList = paramList.iterator();
       while (paramList.hasNext())
       {
         localObject2 = (NameValuePair)paramList.next();
         if (TextUtils.isEmpty(((NameValuePair)localObject2).getValue()))
           continue;
         ((Uri.Builder)localObject1).appendQueryParameter(((NameValuePair)localObject2).getName(), ((NameValuePair)localObject2).getValue());
       }
     }
     paramList = ((Uri.Builder)localObject1).build();
     if ("m".equals(paramList.getQueryParameter("logintype")))
       localIntent.setData(Uri.parse(paramList.toString().replaceFirst("dianping://login", "dianping://fastlogin")));
   }
   while (true)
   {
     localIntent.setFlags(335544320);
     this.context.startActivity(localIntent);
     this.loginResultListener = paramLoginResultListener;
     return;
     localIntent.setData(paramList);
     continue;
     Object localObject3 = LoginUtils.getLoginGASource(this.context);
     localIntent.setData(Uri.parse("dianping://loginweb"));
     String str1 = Environment.versionName();
     String str2 = Environment.mapiUserAgent();
     String str3 = preferences(DPApplication.instance()).getString("dpid", "");
     localObject2 = DPApplication.instance().locationService().location();
     if (localObject2 != null)
       localObject1 = Location.FMT.format(((DPObject)localObject2).getDouble("Lat"));
     for (localObject2 = Location.FMT.format(((DPObject)localObject2).getDouble("Lng")); ; localObject2 = "0")
     {
       localObject2 = "http://m.dianping.com/login/app?version=" + str1 + "&agent=" + str2 + "&dpid=" + str3 + "&gasource=" + (String)localObject3 + "&lat=" + (String)localObject1 + "&lng=" + (String)localObject2;
       localObject1 = localObject2;
       if (paramList == null)
         break;
       localObject3 = paramList.iterator();
       paramList = (List<NameValuePair>)localObject2;
       while (true)
       {
         localObject1 = paramList;
         if (!((Iterator)localObject3).hasNext())
           break;
         localObject1 = (NameValuePair)((Iterator)localObject3).next();
         if (TextUtils.isEmpty(((NameValuePair)localObject1).getValue()))
           continue;
         paramList = paramList + "&" + ((NameValuePair)localObject1).getName() + "=" + ((NameValuePair)localObject1).getValue();
       }
       localObject1 = "0";
     }
     localIntent.putExtra("url", (String)localObject1);
   }
 }
예제 #4
0
 public Cursor query(
     Uri paramUri,
     String[] paramArrayOfString1,
     String paramString1,
     String[] paramArrayOfString2,
     String paramString2) {
   paramUri =
       super.query(paramUri, paramArrayOfString1, paramString1, paramArrayOfString2, paramString2);
   if (TextUtils.isEmpty(paramArrayOfString2[0])) {
     if (paramUri.getCount() == 0) {
       paramUri = new MatrixCursor(COLUMNS);
       paramUri.addRow(columnValuesOfWord(0, "没有搜索记录", ""));
       this.bFirstSearch = true;
       return paramUri;
     }
     totalRecord = paramUri.getCount();
     this.bFirstSearch = false;
     return paramUri;
   }
   if (StringUtil.isAllPunctuation(paramArrayOfString2[0])) return paramUri;
   int i = DPApplication.instance().cityConfig().currentCity().id();
   paramString1 = DPApplication.instance().locationService().location();
   paramString2 = paramArrayOfString2[0];
   paramArrayOfString1 = Boolean.valueOf(false);
   paramUri = paramArrayOfString1;
   if (!TextUtils.isEmpty(paramArrayOfString2[1])) {
     paramUri = paramArrayOfString1;
     if ("true".equals(paramArrayOfString2[1])) paramUri = Boolean.valueOf(true);
   }
   if (paramUri.booleanValue()) {
     paramArrayOfString1 =
         ""
             + "http://m.api.dianping.com/advancedsuggest.bin?cityid="
             + i
             + "&keyword="
             + URLEncoder.encode(paramString2);
     paramUri = paramArrayOfString1;
     if (paramString1 != null) {
       paramUri = paramArrayOfString1;
       if (paramString1.getDouble("Lat") != 0.0D) {
         paramUri = paramArrayOfString1;
         if (paramString1.getDouble("Lng") != 0.0D)
           paramUri =
               paramArrayOfString1
                   + "&mylat="
                   + Location.FMT.format(paramString1.getDouble("Lat"))
                   + "&mylng="
                   + Location.FMT.format(paramString1.getDouble("Lng"))
                   + "&myacc="
                   + paramString1.getInt("Accuracy");
       }
     }
   }
   for (paramUri = new BasicMApiRequest(paramUri, "GET", null, CacheType.DISABLED, false, null);
       ;
       paramUri = new BasicMApiRequest(paramUri, "GET", null, CacheType.DISABLED, false, null)) {
     paramString1 =
         (DPObject)
             ((MApiResponse) DPApplication.instance().mapiService().execSync(paramUri)).result();
     paramArrayOfString1 = new MatrixCursor(COLUMNS);
     if (paramString1 == null) break label750;
     if ((paramString1.getArray("List") == null) || (paramString1.getArray("List").length <= 0))
       break label679;
     i = 0;
     while (true) {
       paramUri = paramArrayOfString1;
       if (i >= paramString1.getArray("List").length) break;
       paramUri = "约" + paramString1.getArray("List")[i].getInt("Count") + "个结果";
       paramArrayOfString2 = paramString1.getArray("List")[i].getString("Url");
       paramString2 = paramString1.getArray("List")[i].getString("Value");
       paramArrayOfString1.addRow(
           columnValuesOfWord(
               i,
               paramString1.getArray("List")[i].getString("Keyword"),
               paramUri,
               paramArrayOfString2,
               paramString2));
       i += 1;
     }
     paramArrayOfString1 =
         ""
             + "http://m.api.dianping.com/searchsuggest.bin?cityid="
             + i
             + "&keyword="
             + URLEncoder.encode(paramString2);
     paramUri = paramArrayOfString1;
     if (paramString1 == null) continue;
     paramUri = paramArrayOfString1;
     if (paramString1.getDouble("Lat") == 0.0D) continue;
     paramUri = paramArrayOfString1;
     if (paramString1.getDouble("Lng") == 0.0D) continue;
     paramUri =
         paramArrayOfString1
             + "&mylat="
             + Location.FMT.format(paramString1.getDouble("Lat"))
             + "&mylng="
             + Location.FMT.format(paramString1.getDouble("Lng"))
             + "&myacc="
             + paramString1.getInt("Accuracy");
   }
   label679:
   paramUri = paramString1.getString("EmptyMsg");
   if (TextUtils.isEmpty(paramUri)) {
     paramArrayOfString1.addRow(columnValuesOfWord(0, "查找 “" + paramArrayOfString2[0] + "”", ""));
     return paramArrayOfString1;
   }
   paramArrayOfString1.addRow(columnValuesOfWord(0, paramUri, ""));
   return paramArrayOfString1;
   label750:
   paramArrayOfString1.addRow(columnValuesOfWord(0, "查找 “" + paramArrayOfString2[0] + "”", ""));
   return paramArrayOfString1;
 }