[Need fix][Release] Megapolis Facebook/ios/android hack

Posts 1–12 of 12 · Page 1 of 1
[Need fix][Release] Megapolis Facebook/ios/android hack
Greetings,

I need some help to fix an old farming bot for Megapolis.

Bot info:
created/released by cyclon_sh on https://insanelyi.com/topic/16330-me...-partial-hack/
It is a bot that collects and boost coins/xp.

What need to be fixed:
An error occured: Update User Info Exceprion: The reference to entity "oe" must end with the ';' delimiter.
This error is related to an invalid character sent or received probably from an xml.

How to fix:
Get the bot from url m e d i a f i r e: https://www.********e.com/folder/0ou...f2zt/megapolis
Navigate to \megapolis\plugins\megapolis_1.0.0.201403200124.ja r
Extract with 7zip or whatever you like.
Save .class files to .java using JD-GUI at http://jd.benow.ca/
Open .java with notepad++

What should be check is POST settings that you can find in MainView file.

Also if someone knows the author, I will be happy to get some help from him to fix that.

What works:

You can actually use the bot using android id.
Use Charles to get access_token and ID form the game running on your phone and copy that to FB settings in the bot.
It will work but without Facebook linking.

Regards.
Ok it seems that the errors occurs in UserParams file.

Here is the source:

Code:
/*     */ package megapolis;
/*     */ 
/*     */ import com.google.gson.JsonElement;
/*     */ import com.google.gson.JsonObject;
/*     */ import com.google.gson.JsonParser;
/*     */ import com.google.gson.JsonPrimitive;
/*     */ import java****.ByteArrayInputStream;
/*     */ import java********Exception;
/*     */ import java****.OutputStream;
/*     */ import java.net.HttpURLConnection;
/*     */ import java.net.MalformedURLException;
/*     */ import java.net.URL;
/*     */ import java.util.LinkedHashMap;
/*     */ import java.util.Map.Entry;
/*     */ import javax.xml.parsers.DocumentBuilder;
/*     */ import javax.xml.parsers.DocumentBuilderFactory;
/*     */ import javax.xml.parsers.ParserConfigurationException;
/*     */ import org.eclipse.jface.viewers.TreeViewer;
/*     */ import org.eclipse.swt.widgets.Button;
/*     */ import org.eclipse.swt.widgets.Tree;
/*     */ import org.w3c.dom.Document;
/*     */ import org.w3c.dom.Element;
/*     */ import org.w3c.dom.Node;
/*     */ import org.w3c.dom.NodeList;
/*     */ import org.w3c.dom.traversal.TreeWalker;
/*     */ import org.xml.sax.InputSource;
/*     */ import org.xml.sax.SAXException;
/*     */ 
/*     */ public class UserParams
/*     */   implements HttpOperationStatusEvent
/*     */ {
/*     */   private String index;
/*     */   private boolean needStatusEmpty;
/*  33 */   private static String uuiError = "Update User Info Exceprion: ";
/*     */   
/*     */   public UserParams(String index, boolean needStatusEmpty)
/*     */   {
/*  37 */     this.index = index;
/*  38 */     this.needStatusEmpty = needStatusEmpty;
/*     */   }
/*     */   
/*     */   public void setNeedClear(boolean needStatausEmpty)
/*     */   {
/*  43 */     this.needStatusEmpty = needStatausEmpty;
/*     */   }
/*     */   
/*     */   public void getUserStatus()
/*     */   {
/*  48 */     HttpURLConnection req = null;
/*     */     try
/*     */     {
/*  52 */       mainView.userStatResponse.clearAll(true);
/*  53 */       String urlStr = Utils.getAuthHeader(this.index) + "&first_request=true";
/*  54 */       String HttpRef = DataModel.get(this.index).server().getRef();
/*  55 */       URL url = new URL(HttpRef + "get_user_stat");
/*  56 */       req = (HttpURLConnection)url.openConnection();
/*  57 */       req.setRequestProperty("User-Agent", "city-iOS-HD-1.71.2033");
/*  58 */       req.setRequestProperty("Accept", "*/*");
/*  59 */       req.setRequestProperty("Accept-Language", "ru");
/*  60 */       req.setRequestProperty("Accept-Encoding", "gzip, deflate");
/*  61 */       req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
/*  62 */       req.setRequestProperty("Connection", "keep-alive");
/*  63 */       req.setRequestProperty("Content-Length", String.format("%d", new Object[] { Integer.valueOf(urlStr.length()) }));
/*  64 */       req.setRequestMethod("POST");
/*  65 */       req.setDoOutput(true);
/*  66 */       ProfileChannel.get(this.index).enQueue(new ServerRequest(req, urlStr, this));
/*     */     }
/*     */     catch (IOException e1)
/*     */     {
/*  70 */       e1.printStackTrace();
/*     */     }
/*     */   }
/*     */   
/*     */   public void HttpEvent(Object status)
/*     */   {
/*  77 */     if ((status instanceof byte[]))
/*     */     {
/*     */       try
/*     */       {
/*  81 */         byte[] rspBytes = (byte[])status;
/*     */         
/*  83 */         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
/*  84 */         DocumentBuilder db = dbf.newDocumentBuilder();
/*  85 */         Document doc = db.parse(new InputSource(new ByteArrayInputStream(rspBytes)));
/*     */         
/*  87 */         NodeList err = doc.getElementsByTagName("error");
/*  88 */         if ((err != null) && (err.getLength() != 0))
/*     */         {
/*  90 */           String logStr = Utils.extractErrorsIfOccured(err);
/*  91 */           Logger.write(DataModel.get(this.index).name() + ":  User Status Responce Error: !!!!!!!!\n" + logStr + "\n!!!!!!!!!!!!!!!!!!\n");
/*     */         }
/*  94 */         DataModel.getbot(this.index).clear();
/*  95 */         Element country = (Element)((NodeList)doc).item(0);
/*  96 */         Utils.updateStatistics(country, null);
/*     */         
/*  98 */         String rooms = country.getAttribute("room_information");
/*  99 */         if ((rooms != null) && (rooms.length() > 0))
/*     */         {
/* 101 */           JsonParser jp = new JsonParser();
/* 102 */           JsonObject jRoot = jp.parse(rooms).getAsJsonObject();
/* 103 */           if (jRoot != null)
/*     */           {
/* 105 */             JsonObject jRooms = jRoot.getAsJsonObject("rooms");
/* 106 */             if (jRooms != null) {
/* 108 */               for (Map.Entry<String, JsonElement> room : jRooms.entrySet())
/*     */               {
/* 110 */                 JsonObject jo = ((JsonElement)room.getValue()).getAsJsonObject();
/* 111 */                 if (jo != null)
/*     */                 {
/* 113 */                   JsonPrimitive jpr = jo.getAsJsonPrimitive("available");
/* 114 */                   if ((jpr != null) && (jpr.isBoolean()) && (jpr.getAsBoolean())) {
/* 116 */                     Rooms.addRoom(this.index, (String)room.getKey());
/*     */                   }
/*     */                 }
/*     */               }
/*     */             }
/*     */           }
/*     */         }
/* 123 */         NodeList l = doc.getElementsByTagName("machine_shop_new_art");
/* 124 */         if ((l != null) && (l.getLength() != 0))
/*     */         {
/* 126 */           vegetables veg = new vegetables(this.index, Long.valueOf(10037L));
/* 127 */           DataModel.getbot(this.index).addContract(veg);
/* 128 */           LinkedHashMap<Long, Integer> needClean = new LinkedHashMap();
/* 129 */           String logstr = " Machine Shop Available: {  ";
/* 130 */           for (int i = 0; i < l.getLength(); i++)
/*     */           {
/* 132 */             Element e = (Element)l.item(i);
/* 133 */             Long eLong = new Long(e.getAttribute("id"));
/* 134 */             if (this.needStatusEmpty)
/*     */             {
/* 136 */               Integer state = new Integer(e.getAttribute("state"));
/* 137 */               if (state.intValue() != 2) {
/* 139 */                 needClean.put(eLong, state);
/*     */               }
/*     */             }
/* 142 */             DataModel.getbot(this.index).addContractId("fresh_vegetables", eLong);
/* 143 */             logstr = logstr + String.format("%d ", new Object[] { eLong });
/*     */           }
/* 145 */           Logger.write(logstr + "}\n");
/* 146 */           if (needClean.size() > 0) {
/* 148 */             cleanContracts(this.index, needClean);
/*     */           }
/*     */         }
/* 152 */         l = doc.getElementsByTagName("blamco_inc_new_art");
/* 153 */         if ((l != null) && (l.getLength() != 0))
/*     */         {
/* 155 */           jalousie jal = new jalousie(this.index, Long.valueOf(10037L));
/* 156 */           DataModel.getbot(this.index).addContract(jal);
/* 157 */           LinkedHashMap<Long, Integer> needClean = new LinkedHashMap();
/*     */           
/* 159 */           String logstr = " Blamco Available: {  ";
/* 160 */           for (int i = 0; i < l.getLength(); i++)
/*     */           {
/* 162 */             Element e = (Element)l.item(i);
/* 163 */             Long eLong = new Long(e.getAttribute("id"));
/* 164 */             if (this.needStatusEmpty)
/*     */             {
/* 166 */               Integer state = new Integer(e.getAttribute("state"));
/* 167 */               if (state.intValue() != 2) {
/* 169 */                 needClean.put(eLong, state);
/*     */               }
/*     */             }
/* 172 */             DataModel.getbot(this.index).addContractId("jalousie", eLong);
/* 173 */             logstr = logstr + String.format("%d ", new Object[] { eLong });
/*     */           }
/* 175 */           Logger.write(logstr + "}\n");
/* 176 */           if (needClean.size() > 0) {
/* 178 */             cleanContracts(this.index, needClean);
/*     */           }
/*     */         }
/* 182 */         l = doc.getElementsByTagName("bed_and_breakfast_new");
/* 183 */         if ((l != null) && (l.getLength() != 0))
/*     */         {
/* 185 */           badandbreakfast bab = new badandbreakfast(this.index);
/* 186 */           DataModel.getbot(this.index).addContract(bab);
/* 187 */           Long maxDelayToStart = Long.valueOf(0L);
/* 188 */           String logstr = " Bad And Breakfast New: {  ";
/* 189 */           for (int i = 0; i < l.getLength(); i++)
/*     */           {
/* 191 */             Element e = (Element)l.item(i);
/* 192 */             Long eLong = new Long(e.getAttribute("id"));
/* 193 */             if (this.needStatusEmpty)
/*     */             {
/* 195 */               Integer state = new Integer(e.getAttribute("state"));
/* 196 */               if (state.intValue() != 2)
/*     */               {
/* 198 */                 Long ee = new Long(e.getAttribute("process_end"));
/* 199 */                 if (maxDelayToStart.longValue() < ee.longValue()) {
/* 201 */                   maxDelayToStart = ee;
/*     */                 }
/*     */               }
/*     */             }
/* 205 */             DataModel.getbot(this.index).addContractId("bed_and_breakfast_new", eLong);
/* 206 */             logstr = logstr + String.format("%d ", new Object[] { eLong });
/*     */           }
/* 208 */           if (maxDelayToStart.longValue() != 0L)
/*     */           {
/* 210 */             DataModel.getbot(this.index).setDelayToStart("bed_and_breakfast_new", maxDelayToStart);
/* 211 */             logstr = logstr + " Set StartDelay to " + maxDelayToStart.longValue() / 1000L + " seconds ";
/*     */           }
/* 213 */           Logger.write(logstr + "}\n");
/*     */         }
/* 216 */         l = doc.getElementsByTagName("log_hut");
/* 217 */         if ((l != null) && (l.getLength() != 0))
/*     */         {
/* 219 */           loghut lh = new loghut(this.index);
/* 220 */           DataModel.getbot(this.index).addContract(lh);
/* 221 */           Long maxDelayToStart = Long.valueOf(0L);
/* 222 */           String logstr = " Log Hut Available: {  ";
/* 223 */           for (int i = 0; i < l.getLength(); i++)
/*     */           {
/* 225 */             Element e = (Element)l.item(i);
/* 226 */             Long eLong = new Long(e.getAttribute("id"));
/* 227 */             if (this.needStatusEmpty)
/*     */             {
/* 229 */               Integer state = new Integer(e.getAttribute("state"));
/* 230 */               if (state.intValue() != 2)
/*     */               {
/* 232 */                 Long ee = new Long(e.getAttribute("process_end"));
/* 233 */                 if (maxDelayToStart.longValue() < ee.longValue()) {
/* 235 */                   maxDelayToStart = ee;
/*     */                 }
/*     */               }
/*     */             }
/* 239 */             DataModel.getbot(this.index).addContractId("loghut", eLong);
/* 240 */             logstr = logstr + String.format("%d ", new Object[] { eLong });
/*     */           }
/* 242 */           if (maxDelayToStart.longValue() != 0L)
/*     */           {
/* 244 */             DataModel.getbot(this.index).setDelayToStart("loghut", maxDelayToStart);
/* 245 */             logstr = logstr + "Set StartDelay to " + maxDelayToStart.longValue() / 1000L + " seconds ";
/*     */           }
/* 247 */           Logger.write(logstr + "}\n");
/*     */         }
/* 249 */         NodeList friends = doc.getElementsByTagName("friends");
/* 250 */         FriendCollection pc = ProfileFriends.get(this.index);
/* 251 */         if ((friends != null) && (friends.getLength() > 0)) {
/* 253 */           for (int fIdx = 0; fIdx < friends.getLength(); fIdx++)
/*     */           {
/* 255 */             l = friends.item(fIdx).getChildNodes();
/* 257 */             for (int i = 0; i < l.getLength(); i++)
/*     */             {
/* 259 */               Element e = (Element)l.item(i);
/* 260 */               if (e.getNodeName().equals("friend"))
/*     */               {
/* 261 */                 String frId = e.getAttribute("id");
/* 262 */                 String frCity = e.getAttribute("city_name");
/* 263 */                 String frHelpPoints = e.getAttribute("help_points");
/* 264 */                 String frName = e.getAttribute("first_name");
/*     */                 
/*     */ 
/* 267 */                 Friend f = new Friend(this.index, frId, frCity, frName, Integer.valueOf(frHelpPoints).intValue());
/* 268 */                 pc.add(f);
/*     */               }
/*     */             }
/*     */           }
/*     */         }
/* 274 */         NodeList fields = doc.getElementsByTagName("field");
/* 275 */         if ((fields != null) && (fields.getLength() > 0))
/*     */         {
/* 277 */           NodeList cityItems = fields.item(0).getChildNodes();
/* 278 */           if ((cityItems != null) && (cityItems.getLength() > 0))
/*     */           {
/* 280 */             Houses.clear(this.index);
/* 281 */             Contracts.clear(this.index);
/* 282 */             Leisures.clear(this.index);
/* 283 */             for (int fld = 0; fld < cityItems.getLength(); fld++) {
/* 285 */               if (cityItems.item(fld).getNodeType() != 3)
/*     */               {
/* 289 */                 Element e = (Element)cityItems.item(fld);
/* 290 */                 Object cio = mainView.cityAllItems.get(e.getNodeName());
/* 291 */                 if ((cio != null) && ((cio instanceof LinkedHashMap)))
/*     */                 {
/* 293 */                   LinkedHashMap<?, ?> ci = (LinkedHashMap)cio;
/*     */                   
/* 295 */                   String keysd = (String)ci.get("shop_department");
/* 296 */                   Object contracts = ci.get("contracts");
/*     */                   
/* 298 */                   Integer state = Integer.valueOf(e.getAttribute("state"));
/* 299 */                   if ((keysd != null) && (keysd.equals("houses")) && (state.intValue() == 2))
/*     */                   {
/* 301 */                     Boolean pick = (Boolean)ci.get("pick");
/* 302 */                     if ((pick != null) && (pick.booleanValue())) {
/* 304 */                       Houses.add(this.index, e.getAttribute("id"), e.getAttribute("state"));
/*     */                     }
/*     */                   }
/* 307 */                   if ((keysd != null) && (keysd.equals("leisures")) && (state.intValue() == 5))
/*     */                   {
/* 309 */                     Boolean clean = (Boolean)ci.get("clean");
/* 310 */                     if ((clean != null) && (clean.booleanValue())) {
/* 312 */                       Leisures.add(this.index, e.getAttribute("id"), e.getAttribute("state"));
/*     */                     }
/*     */                   }
/* 315 */                   if ((contracts != null) && (state.intValue() == 4)) {
/* 317 */                     Contracts.add(this.index, e.getAttribute("id"), e.getAttribute("state"));
/*     */                   }
/* 319 */                   if ((keysd != null) && (keysd.equals("buildsite")) && (isLeisure(ci)) && (state.intValue() == 5)) {
/* 321 */                     Leisures.add(this.index, e.getAttribute("id"), e.getAttribute("state"));
/*     */                   }
/*     */                 }
/*     */               }
/*     */             }
/*     */           }
/*     */         }
/* 337 */         if ((Houses.isNeedCollect(this.index)) || (Leisures.isNeedCollect(this.index)) || (Contracts.isNeedCollect(this.index))) {
/* 339 */           Logger.write("Ready to Collect: Houses:" + Houses.size(this.index) + " Leisures:" + Leisures.size(this.index) + " Contracts:" + Contracts.size(this.index) + "\n");
/*     */         }
/* 341 */         final TreeWalker walker = Utils.getTreeWalker(doc);
/* 342 */         final boolean doCollect = Utils.doCollect(this.index);
/* 343 */         Utils.asyncExec(new DisplayRun()
/*     */         {
/*     */           public void doIt()
/*     */           {
/* 348 */             mainView.treeViewer.setInput(walker);
/* 349 */             mainView.treeViewer.refresh();
/* 350 */             mainView.friendsTreeViewer.setInput(ProfileFriends.get(UserParams.this.index).friends());
/* 351 */             mainView.friendsTreeViewer.refresh();
/* 352 */             if (doCollect) {
/* 354 */               mainView.btnpickObjects.setEnabled(true);
/*     */             } else {
/* 358 */               mainView.btnpickObjects.setEnabled(false);
/*     */             }
/*     */           }
/*     */         });
/* 363 */         if (!this.needStatusEmpty) {
/*     */           return;
/*     */         }
/* 365 */         if (DataModel.getbot(this.index).size() == 0) {
/*     */           return;
/*     */         }
/* 367 */         DataModel.getbot(this.index).start();
/*     */       }
/*     */       catch (IOException e)
/*     */       {
/* 373 */         Logger.write(uuiError + e.getMessage() + "\n");
/* 374 */         e.printStackTrace();
/*     */       }
/*     */       catch (ParserConfigurationException e)
/*     */       {
/* 378 */         Logger.write(uuiError + e.getMessage() + "\n");
/* 379 */         e.printStackTrace();
/*     */       }
/*     */       catch (SAXException e)
/*     */       {
/* 383 */         Logger.write(uuiError + e.getMessage() + "\n");
/* 384 */         e.printStackTrace();
/*     */       }
/*     */     }
/* 387 */     else if ((status instanceof IOException))
/*     */     {
/* 389 */       IOException e = (IOException)status;
/* 390 */       Logger.write(uuiError + e.getMessage() + "\n");
/* 391 */       e.printStackTrace();
/*     */     }
/*     */   }
/*     */   
/*     */   private boolean isLeisure(LinkedHashMap<?, ?> ci)
/*     */   {
/* 397 */     Object sto = ci.get("states");
/* 398 */     Boolean clean = (Boolean)ci.get("clean");
/* 399 */     if ((sto == null) || (clean == null) || (!clean.booleanValue())) {
/* 401 */       return false;
/*     */     }
/* 403 */     if ((sto instanceof LinkedHashMap))
/*     */     {
/* 406 */       LinkedHashMap<Integer, Integer> states = (LinkedHashMap)sto;
/* 407 */       Integer from = (Integer)states.get(Integer.valueOf(1));
/* 408 */       if ((from != null) && (from.intValue() == 4))
/*     */       {
/* 410 */         from = (Integer)states.get(Integer.valueOf(2));
/* 411 */         if ((from != null) && (from.intValue() == 4))
/*     */         {
/* 413 */           from = (Integer)states.get(Integer.valueOf(4));
/* 414 */           if ((from != null) && (from.intValue() == 5))
/*     */           {
/* 416 */             from = (Integer)states.get(Integer.valueOf(5));
/* 417 */             if ((from != null) && (from.intValue() == 4)) {
/* 419 */               return true;
/*     */             }
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/* 425 */     return false;
/*     */   }
/*     */   
/* 428 */   private static String clcError = "Clean Contracts Exception: ";
/*     */   
/*     */   private void cleanContracts(String idx, LinkedHashMap<Long, Integer> needClean)
/*     */   {
/* 431 */     HttpURLConnection req = null;
/*     */     try
/*     */     {
/* 434 */       long uxtime = System.currentTimeMillis() / 1000L;
/* 435 */       long tdBase = needClean.size() - 1;
/* 436 */       int localIndex = 0;int i = 0;
/* 437 */       String urlStr = Utils.getAuthHeader(this.index);
/* 438 */       String log = new String();
/* 439 */       String roomId = Utils.getRoomId(this.index);
/* 440 */       for (Long id : needClean.keySet())
/*     */       {
/* 442 */         int state = ((Integer)needClean.get(id)).intValue();
/* 443 */         log = log + id + "(" + state + ") ";
/* 444 */         switch (state)
/*     */         {
/*     */         case 3: 
/* 447 */           urlStr = urlStr + "&" + Utils.createCmdIdTime(localIndex++, "cancel", id.longValue(), uxtime - (tdBase - i), roomId);
/* 448 */           break;
/*     */         case 4: 
/* 452 */           urlStr = urlStr + "&" + Utils.createCmdIdTime(localIndex++, "pick", id.longValue(), uxtime - (tdBase - i), roomId);
/* 453 */           break;
/*     */         case 6: 
/* 456 */           urlStr = urlStr + "&" + Utils.createCmdIdTime(localIndex++, "tick", id.longValue(), uxtime - (tdBase - i) - 2L, roomId);
/* 457 */           urlStr = urlStr + "&" + Utils.createCmdIdTime(localIndex++, "pick", id.longValue(), uxtime - (tdBase - i) - 1L, roomId);
/* 458 */           urlStr = urlStr + "&" + Utils.createCmdIdTime(localIndex++, "clean", id.longValue(), uxtime - (tdBase - i), roomId);
/*     */         }
/* 461 */         i++;
/*     */       }
/* 463 */       urlStr = urlStr + "&live_update=true";
/* 464 */       Logger.write("CLEAR CONTRACTS { " + log + "}" + "\n");
/* 465 */       String HttpRef = DataModel.get(idx).server().getRef();
/* 466 */       URL url = new URL(HttpRef + "check_and_perform");
/* 467 */       req = (HttpURLConnection)url.openConnection();
/* 468 */       req.setRequestProperty("User-Agent", "city-iOS-HD-1.71.2033");
/* 469 */       req.setRequestProperty("Accept", "*/*");
/* 470 */       req.setRequestProperty("Accept-Language", "ru");
/* 471 */       req.setRequestProperty("Accept-Encoding", "gzip, deflate");
/* 472 */       req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
/* 473 */       req.setRequestProperty("Connection", "keep-alive");
/* 474 */       req.setRequestProperty("Content-Length", String.format("%d", new Object[] { Integer.valueOf(urlStr.length()) }));
/* 475 */       req.setRequestMethod("POST");
/* 476 */       req.setDoOutput(true);
/* 477 */       req.connect();
/* 478 */       OutputStream data = req.getOutputStream();
/* 479 */       data.write(urlStr.getBytes("UTF-8"));
/* 480 */       data.flush();
/* 481 */       byte[] rspBytes = Utils.getResponse(req);
/*     */       
/* 483 */       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
/* 484 */       DocumentBuilder db = dbf.newDocumentBuilder();
/* 485 */       Document doc = db.parse(new InputSource(new ByteArrayInputStream(rspBytes)));
/* 486 */       NodeList err = doc.getElementsByTagName("error");
/* 487 */       if ((err != null) && (err.getLength() != 0))
/*     */       {
/* 489 */         String logstr = Utils.extractErrorsIfOccured(err);
/* 490 */         Logger.write(logstr + "\n");
/*     */       }
/*     */     }
/*     */     catch (MalformedURLException e)
/*     */     {
/* 496 */       Logger.write(clcError + e.getMessage() + "\n");
/* 497 */       e.printStackTrace();
/*     */     }
/*     */     catch (IOException e)
/*     */     {
/* 501 */       Logger.write(clcError + e.getMessage() + "\n");
/* 502 */       e.printStackTrace();
/*     */     }
/*     */     catch (ParserConfigurationException e)
/*     */     {
/* 506 */       Logger.write(clcError + e.getMessage() + "\n");
/* 507 */       e.printStackTrace();
/*     */     }
/*     */     catch (SAXException e)
/*     */     {
/* 511 */       Logger.write(clcError + e.getMessage() + "\n");
/* 512 */       e.printStackTrace();
/*     */     }
/*     */     finally
/*     */     {
/* 516 */       if (req != null) {
/* 518 */         req.disconnect();
/*     */       }
/*     */     }
/*     */   }
/*     */ }


/* Location:           C:\Users\johnn\Desktop\megapolis_1.0.0.201403200124\
 * Qualified Name:     megapolis.UserParams
 * JD-Core Version:    0.7.0.1
 */
Hi,

The Complete Exception is:

commandId = org.eclipse.ui.edit.paste : parms []
commandId = org.eclipse.ui.edit.paste : success null
commandId = org.eclipse.ui.edit.paste : parms []
commandId = org.eclipse.ui.edit.paste : success null
[Fatal Error] :6654:1864: Referenz zu Entität "oe" muss mit dem Begrenzungszeichen ";" enden.
org.xml.sax.SAXParseException; lineNumber: 6654; columnNumber: 1864; Referenz zu Entität "oe" muss mit dem Begrenzungszeichen ";" enden.
at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(DocumentBuilderImpl.java:348)
at megapolis.UserParams.HttpEvent(UserParams.java:85)
at megapolis.ProfileChannel.run(ProfileChannel.java:1 26)
at java.lang.Thread.run(Thread.java:745)

UserParams line 85 is

Document doc = db.parse(new InputSource(new ByteArrayInputStream(rspBytes)));


maybe if you have any idea you can add me ICQ: 85661

i will try to fix it
maybe u'll got banned , take sure u aren't break the rules
Profile[**] Channel Task has started!
Ready to Collect: Houses:5 Leisures:12 Contracts:0
Collect all ready items: waiting 5017ms ( 5s )...
Collect all ready items: done



its working now
working with facebook id?
Cause it is working using Android device ID.

Here is a dump of the log from my device (navigate to: ..\Android\data\com.socialquantum.acityint\curr_co nsole.log from an android device or bluestack)

Code:
2015-04-05 22:47:16|I| SQC | [sstl_preferences] got line with pattern: 24:facebook_guest_network[GS]_118***************353_access_token=e792******************1118
2015-04-05 22:47:16|I| SQC | [sstl_preferences] got line with pattern: 25:facebook_guest_network[GS]_118***************353_user_id=160**********687
2015-04-05 22:47:16|I| SQC | [sstl_preferences] got line with pattern: 26:facebook_guest_network_access_token=699**********************b6ed
2015-04-05 22:47:16|I| SQC | [sstl_preferences] got line with pattern: 27:facebook_guest_network_disabled_assoc=
2015-04-05 22:47:16|I| SQC | [sstl_preferences] got line with pattern: 28:facebook_guest_network_user_id=-59*****01
Facebook ID is: facebook_guest_network[GS]_118***************353_user_id=160**********687
Facebook Token is: facebook_guest_network[GS]_118***************353_access_token=e792******************1118

Device ID (not linked with FB) is: [sstl_preferences] got line with pattern: 28:facebook_guest_network_user_id=-59*****01
Device Token (not linked with FB) is: facebook_guest_network_access_token=699**********************b6ed

Bot using device ID (starting with a "-") and token is working fine but is not sync with Facebook.
If you found a way to fix the bot when using Facebook ID, can you point me to a direction?

I would like to keep this public but you can PM me.

Regards.
yes its works on my facebook ID, i used Server FBD

but its works not perfect i look for other problems, i can help frends and can collect all but the bot start does nothing i thing
for fix the facebook problem, you must just edit the UserParams file, there is:

public void getUserStatus() {
HttpURLConnection req = null;
try {
mainView.userStatResponse.clearAll(true);
String urlStr = String.valueOf(Utils.getAuthHeader(this.index)) + "&first_request=true";
String HttpRef = DataModel.get(this.index).server().getRef();
URL url = new URL(String.valueOf(HttpRef) + "get_user_stat");
req = (HttpURLConnection)url.openConnection();
req.setRequestProperty("User-Agent", "city-iOS-HD-1.71.2033");
req.setRequestProperty("Accept", "*/*");
req.setRequestProperty("Accept-Language", "ru");
req.setRequestProperty("Accept-Encoding", "gzip, deflate");
req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
req.setRequestProperty("Connection", "keep-alive");
req.setRequestProperty("Content-Length", String.format("%d", urlStr.length()));
req.setRequestMethod("POST");
req.setDoOutput(true);
ProfileChannel.get(this.index).enQueue(new ServerRequest(req, urlStr, this));
}
catch (IOException e1) {
e1.printStackTrace();
}
}
just change it to:

public void getUserStatus() {
HttpURLConnection req = null;
try {
mainView.userStatResponse.clearAll(true);
String urlStr = String.valueOf(Utils.getAuthHeader(this.index)) + "&first_request=true";
String HttpRef = DataModel.get(this.index).server().getRef();
URL url = new URL(String.valueOf(HttpRef) + "get_user_stat");
req = (HttpURLConnection)url.openConnection();
// req.setRequestProperty("User-Agent", "city-iOS-HD-1.71.2033");
// req.setRequestProperty("Accept", "*/*");
// req.setRequestProperty("Accept-Language", "de");
// req.setRequestProperty("Accept-Encoding", "gzip, deflate");
// req.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
// req.setRequestProperty("Connection", "keep-alive");
// req.setRequestProperty("Content-Length", String.format("%d", urlStr.length()));
req.setRequestMethod("POST");
req.setDoOutput(true);
ProfileChannel.get(this.index).enQueue(new ServerRequest(req, urlStr, this));
}
catch (IOException e1) {
e1.printStackTrace();
}
}
Yes that is what I though, I also changed the user agent just un case.

Here is the new file for those interested in, place it in "plugins" folder.

mega url https://************/#!9wF0BbgS!PmPc...j_uOHkqh0L7P04

Everything works except for standard FB connection, it is working fine but it will not grab info (lvl, coins, exp...).
Helping friends needs a small fix also, file to fix is pickObjects.class

Regards.
in my version i have all information, i see my lvl my coins ......

i can see my frends and can help them
i can grab my Houses, Leisures and Contracts
Ready to Collect: Houses:31 Leisures:48 Contracts:10
Collect all ready items: waiting 5089ms ( 5s )...
Collect all ready items: done
Collect all ready items: done
Collect all ready items: done
Ready to Collect: Houses:0 Leisures:0 Contracts:0


i can see my status page
accelerated_items=
account_ballance=0
action_time_end=378356
action_version_key=88
adv_counter=0
adv_id=
auto=1
auto_enabled=true
automation_action_time_end=-87170050
automation_action_version_key=1
bonus=
buddies_enabled=1
buff_items={}
bus_region=WestEurope
buses={"id_seq":26,"list":{"16":{"item_id":26309," state":2,"route":[{"id":"-10719601","state":0,"distance":1},{"id":"-41","state":0,"distance":1},{"id":"-42","state":0,"distance":1},{"id":"100005886306054 ","state":0,"distance":1}],"race":17,"total_................................ .......................


i can see all my city items

engineering_bureau:
experience increase/min = 0.0
population increase/min = 0.0
coins/min = 0.0
max population increase = 20000


...................



but only manuel, if i click start bot then it does nothing, maybe my decompiler works not perfect, i must fix a lot of things, have you the normal source code from all clases?
On my side, bot is working, try it.
I dont have sources, I used 7zip to extract class file from the jar, then I used dirty joe editor to fix useragent and lang.
Everything is working fine, can help friends, can buy for friends, exp and coin hack are working fine also, made it to lvl 70+ within a night with 8 millions coins.

One thing is missing or need to be fixed, collect all button works and do collect but when bot is running, I dont see it collecting houses.
I dont know if it is supposed to be like that but we should implant a collect all function every 5 minutes to make it more efficient.

Ideas are welcome.
Code:
 [Fatal Error] :6654:141: Referenz zu Entität "room_id" muss mit dem Begrenzungszeichen ";" enden.
org.xml.sax.SAXParseException; lineNumber: 6654; columnNumber: 141; Referenz zu Entität "room_id" muss mit dem Begrenzungszeichen ";" enden.
at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(DOMParser.java:257)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(DocumentBuilderImpl.java:348)
at megapolis.pickObjects.HttpEvent(pickObjects.java:1 45)
at megapolis.ProfileChannel.run(ProfileChannel.java:1 15)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Profile Channel [536747226370874]" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Num berFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.<init>(Integer.java:867)
at megapolis.Friend.scanForHelp(Friend.java:298)
at megapolis.Friend.refreshHelpsAndMaterials(Friend.j ava:218)
at megapolis.Friend.HttpEvent(Friend.java:256)
at megapolis.ProfileChannel.run(ProfileChannel.java:1 15)
at java.lang.Thread.run(Thread.java:745)
commandId = org.eclipse.ui.edit.undo : parms []
commandId = org.eclipse.ui.edit.undo : not handled
commandId = org.eclipse.ui.edit.undo : parms []
commandId = org.eclipse.ui.edit.undo : not handled
commandId = org.eclipse.ui.edit.undo : parms []
commandId = org.eclipse.ui.edit.undo : not handled
commandId = org.eclipse.ui.edit.undo : parms []
commandId = org.eclipse.ui.edit.undo : not handled
thats what i become whit your version.

i can press start bot, but then i become nothing feedback


edit: ok whit a new accoun its working, i thing the problem is my account lvl 99
Posts 1–12 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us