Advertisement
Guest User

Untitled

a guest
Dec 30th, 2014
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.84 KB | None | 0 0
  1. protected transient String doInBackground(String as[])
  2. {
  3. HttpURLConnection httpurlconnection;
  4. android.content.SharedPreferences.Editor editor1;
  5. URL url;
  6. URL url1;
  7. URL url2;
  8. StringBuilder stringbuilder;
  9. String s;
  10. StringBuilder stringbuilder1;
  11. DataOutputStream dataoutputstream;
  12. Map map1;
  13. Iterator iterator2;
  14. java.util.Map.Entry entry1;
  15. Iterator iterator3;
  16. String s4;
  17. try
  18. {
  19. url = new URL("http://pikabu.ru/ajax/ajax_login.php");
  20. }
  21. catch (MalformedURLException malformedurlexception)
  22. {
  23. malformedurlexception.printStackTrace();
  24. url1 = null;
  25. continue; /* Loop/switch isn't completed */
  26. }
  27. url1 = url;
  28. _L16:
  29. url2 = url1;
  30. httpurlconnection = (HttpURLConnection)url2.openConnection();
  31. httpurlconnection.setRequestMethod("POST");
  32. stringbuilder = new StringBuilder();
  33. s = stringbuilder.append("mode=login&username=").append(as[0]).append("&password=").append(as[1]).append("&remember=1").toString();
  34. httpurlconnection.setRequestProperty("Connection", "keep-alive");
  35. httpurlconnection.setRequestProperty("Content-Length", String.valueOf(s.length()));
  36. httpurlconnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
  37. stringbuilder1 = new StringBuilder();
  38. httpurlconnection.setRequestProperty("Cookie", stringbuilder1.append("PHPSESS=").append(mPHPSess).toString());
  39. httpurlconnection.setRequestProperty("Host", "pikabu.ru");
  40. httpurlconnection.setRequestProperty("Origin", "http://pikabu.ru");
  41. httpurlconnection.setRequestProperty("Referer", "http://pikabu.ru");
  42. httpurlconnection.setRequestProperty("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36");
  43. httpurlconnection.setRequestProperty("X-Csrf-Token", mPHPSess);
  44. httpurlconnection.setRequestProperty("X-Requested-With", "XMLHttpRequest");
  45. httpurlconnection.setDoOutput(true);
  46. dataoutputstream = new DataOutputStream(httpurlconnection.getOutputStream());
  47. dataoutputstream.writeBytes(s);
  48. dataoutputstream.flush();
  49. dataoutputstream.close();
  50. if (httpurlconnection.getResponseCode() != 200) goto _L2; else goto _L1
  51. _L1:
  52. map1 = httpurlconnection.getHeaderFields();
  53. editor1 = mUserSharedPreferences.edit();
  54. iterator2 = map1.entrySet().iterator();
  55. _L6:
  56. if (!iterator2.hasNext()) goto _L4; else goto _L3
  57. _L3:
  58. entry1 = (java.util.Map.Entry)iterator2.next();
  59. if (entry1.getKey() == null || !((String)entry1.getKey()).equals("Set-Cookie")) goto _L6; else goto _L5
  60. _L5:
  61. iterator3 = ((List)entry1.getValue()).iterator();
  62. do
  63. {
  64. if (!iterator3.hasNext())
  65. {
  66. break;
  67. }
  68. s4 = (String)iterator3.next();
  69. if (phpDug2Checker(s4))
  70. {
  71. editor1.putString("access token", s4);
  72. Log.d("---", s4);
  73. }
  74. if (mPHPSessChecker(s4))
  75. {
  76. editor1.putString("phpSess", s4.substring(1 + s4.indexOf('='), s4.indexOf(';')));
  77. mPHPSess = s4.substring(1 + s4.indexOf('='), s4.indexOf(';'));
  78. Log.d("---", s4.substring(1 + s4.indexOf('='), s4.indexOf(';')));
  79. }
  80. } while (true);
  81. label0:
  82. {
  83. if (android.os.Build.VERSION.SDK_INT < 9)
  84. {
  85. break label0;
  86. }
  87. editor1.apply();
  88. }
  89. goto _L6
  90. editor1.commit();
  91. goto _L6
  92. _L4:
  93. BufferedReader bufferedreader;
  94. StringBuffer stringbuffer;
  95. InputStreamReader inputstreamreader = new InputStreamReader(httpurlconnection.getInputStream(), "windows-1251");
  96. bufferedreader = new BufferedReader(inputstreamreader);
  97. stringbuffer = new StringBuffer();
  98. _L7:
  99. String s2 = bufferedreader.readLine();
  100. if (s2 == null)
  101. {
  102. break MISSING_BLOCK_LABEL_845;
  103. }
  104. stringbuffer.append(s2);
  105. goto _L7
  106. _L2:
  107. android.content.SharedPreferences.Editor editor;
  108. Iterator iterator;
  109. Map map = httpurlconnection.getHeaderFields();
  110. editor = mUserSharedPreferences.edit();
  111. iterator = map.entrySet().iterator();
  112. _L10:
  113. if (!iterator.hasNext()) goto _L4; else goto _L8
  114. _L8:
  115. java.util.Map.Entry entry = (java.util.Map.Entry)iterator.next();
  116. if (entry.getKey() == null || !((String)entry.getKey()).equals("Set-Cookie")) goto _L10; else goto _L9
  117. _L9:
  118. Iterator iterator1 = ((List)entry.getValue()).iterator();
  119. _L13:
  120. if (!iterator1.hasNext()) goto _L10; else goto _L11
  121. _L11:
  122. String s1 = (String)iterator1.next();
  123. if (!mPHPSessChecker(s1)) goto _L13; else goto _L12
  124. _L12:
  125. editor.putString("phpSess", s1.substring(1 + s1.indexOf('='), s1.indexOf(';')));
  126. mPHPSess = s1.substring(1 + s1.indexOf('='), s1.indexOf(';'));
  127. if (android.os.Build.VERSION.SDK_INT < 9)
  128. {
  129. break MISSING_BLOCK_LABEL_834;
  130. }
  131. editor.apply();
  132. _L14:
  133. Log.d("---", s1.substring(1 + s1.indexOf('='), s1.indexOf(';')));
  134. doInBackground(new String[0]);
  135. return null;
  136. editor.commit();
  137. goto _L14
  138. String s3;
  139. bufferedreader.close();
  140. Log.d("---", stringbuffer.toString());
  141. s3 = stringbuffer.toString();
  142. return s3;
  143. IOException ioexception;
  144. ioexception;
  145. ioexception.printStackTrace();
  146. return null;
  147. if (true) goto _L16; else goto _L15
  148. _L15:
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement