Example #1
0
 public static boolean isContactMapFileExist()
 {
   if (LoginInformation.getSingleInstance().isLogined());
   for (String str = QQPimUtils.getContactMapPath_LoginedAccount(SDCardUtil.isSDCardMounted()); str == null; str = QQPimUtils.getContactMapPath(ConfigDao.getInstance(null).getStringValue(IConfigDao.ConfigValueTag.DEFAULT_ACCOUNT), SDCardUtil.isSDCardMounted()))
     return false;
   return new File(str).exists();
 }
Example #2
0
 protected ISyncModel.SyncResult work()
 {
   Object localObject;
   if (this.mUseSdcard)
   {
     if (!checkLockFileAvailableAndAdd())
       syncSendBroadcastAndCheckIfRemoteSyncRunning();
     if (!syncSendBroadcastAndCheckIfRemoteSyncRunning())
     {
       localObject = ISyncModel.SyncResult.FAIL_CONFLICT;
       return localObject;
     }
   }
   QQPimUtils.userStoppedSync = false;
   this.workingThread = Thread.currentThread();
   this.downloadBytes = 0L;
   this.uploadBytes = 0L;
   if (!QQPimUtils.createFilesDir(this.mUseSdcard))
     return ISyncModel.SyncResult.FAIL;
   RemoteSync localRemoteSync = new RemoteSync();
   HttpHelper localHttpHelper = new HttpHelper();
   String str1 = LoginInformation.getSingleInstance().getLoginKey();
   String str2 = LoginInformation.getSingleInstance().getLoginedAccount();
   String str3 = QQPimUtils.getServerURL();
   String str4 = QQPimUtils.getUniqueMachineAppID(this.mUseSdcard);
   ISyncModel.SyncResult localSyncResult1 = ISyncModel.SyncResult.SUCCEED;
   localRemoteSync.setConfigure(str3, str2, str1, str4, this, 45600, 272);
   int i = 0;
   label140: int j;
   int k;
   ISyncModel.SyncResult localSyncResult2;
   label165: label170: int n;
   if (i >= this.adapterNameVec.size())
   {
     j = localRemoteSync.start();
     k = 0;
     localSyncResult2 = localSyncResult1;
     if (j == 0)
       break label332;
     int i2 = k;
     localObject = localSyncResult2;
     n = i2;
     label182: QQPimUtils.writeToLog("SyncmlEngine, do,while leave time: ", String.valueOf(System.currentTimeMillis()));
     if (!this.stoppedCommand)
       break label609;
     localObject = ISyncModel.SyncResult.USER_CANCEL;
   }
   while (true)
   {
     long l = System.currentTimeMillis();
     localRemoteSync.end();
     QQPimUtils.writeToLog("SyncmlEngine.end cost:", String.valueOf(System.currentTimeMillis() - l));
     this.workingThread = null;
     if (!this.stoppedCommand)
       break;
     return ISyncModel.SyncResult.USER_CANCEL;
     ITccSyncDbAdapter localITccSyncDbAdapter = (ITccSyncDbAdapter)this.adapterVec.get(i);
     String str5 = (String)this.adapterNameVec.get(i);
     QQPimUtils.writeToLog("SyncModel.work, syncType: ", this.syncType.toInt());
     RemoteSync.SyncType localSyncType = this.syncType;
     if (str5 == null)
       str5 = "";
     localRemoteSync.addDataSource(localSyncType, localITccSyncDbAdapter, str5);
     i++;
     break label140;
     label332: if (this.stoppedCommand)
       break label170;
     QQPimUtils.writeToLog("SyncmlEngine, do,while entry/asyncnext leave time: ", String.valueOf(System.currentTimeMillis()));
     k++;
     String str6 = localRemoteSync.getPostUrl();
     byte[] arrayOfByte1 = localRemoteSync.GetPostBuf();
     if (localHttpHelper.postSync(str6, arrayOfByte1) != 0)
     {
       localSyncResult2 = ISyncModel.SyncResult.FAIL;
       this.lastErrorDes = this.syncErrorAlertBecauseNetwork;
       QQPimUtils.writeToLog("SYNC_JAVA", this.syncErrorAlertBecauseNetwork);
     }
     QQPimUtils.writeToLog("SyncmlEngine, post leave time: ", String.valueOf(System.currentTimeMillis()));
     this.uploadBytes += arrayOfByte1.length;
     QQPimUtils.writeToLog("POST UPLOAD TOTAL COUNT", new Long(this.uploadBytes).toString());
     if (this.stoppedCommand)
       break label170;
     QQPimUtils.writeToLog("SyncmlEngine, recv entry time: ", String.valueOf(System.currentTimeMillis()));
     byte[] arrayOfByte2 = localHttpHelper.syncRecv();
     if (arrayOfByte2 == null)
     {
       ISyncModel.SyncResult localSyncResult3 = ISyncModel.SyncResult.FAIL;
       this.lastErrorDes = this.syncErrorAlertBecauseNetwork;
       QQPimUtils.writeToLog("SYNC_JAVA", this.syncErrorAlertBecauseNetwork);
       int m = k;
       localObject = localSyncResult3;
       n = m;
       break label182;
     }
     this.downloadBytes += arrayOfByte2.length;
     QQPimUtils.writeToLog("POST DOWNLOAD TOTAL COUNT", new Long(this.downloadBytes).toString());
     QQPimUtils.writeToLog("SyncmlEngine, writeBackRecvBuf entry time: ", String.valueOf(System.currentTimeMillis()));
     localRemoteSync.writeBackRecvBuf(arrayOfByte2);
     QQPimUtils.writeToLog("SyncmlEngine, writeBackRecvBuf leave time: ", String.valueOf(System.currentTimeMillis()));
     QQPimUtils.writeToLog("SyncmlEngine, asyncNext entry time: ", String.valueOf(System.currentTimeMillis()));
     for (j = localRemoteSync.next(); 3 == j; j = localRemoteSync.nextStep());
     break label165;
     label609: int i1 = localRemoteSync.getLastError();
     if ((n == 1) && (i1 == -32215))
     {
       localObject = ISyncModel.SyncResult.RELOGIN;
       LoginInformation.getSingleInstance().clearLoginInformation();
     }
     else if ((localObject != ISyncModel.SyncResult.FAIL) && (i1 != 0))
     {
       localObject = ISyncModel.SyncResult.FAIL;
       this.lastErrorDes = this.syncErrorAlert;
       QQPimUtils.writeToLog("SYNC_JAVA", this.syncErrorAlertBecauseEngine + i1);
     }
   }
 }
Example #3
0
 public boolean isLogined()
 {
   return LoginInformation.getSingleInstance().isLogined();
 }
Example #4
0
 public void clearLoginInformation()
 {
   LoginInformation.getSingleInstance().clearLoginInformation();
 }
Example #5
0
 private void writeSyncLog(int paramInt1, long paramLong, int paramInt2, int paramInt3)
 {
   while (true)
   {
     try
     {
       boolean bool = this.logWritten;
       if (bool)
         return;
       if (this.syncType == null)
         continue;
       int i = $SWITCH_TABLE$com$tencent$tccsync$RemoteSync$SyncType()[this.syncType.ordinal()];
       j = 0;
       switch (i)
       {
       case 3:
       default:
         k = -1;
         switch ($SWITCH_TABLE$com$tencent$tccsync$ITccSyncDbAdapter$DbAdapterType()[this.adapterType.ordinal()])
         {
         case 3:
         case 5:
         default:
           long l = System.currentTimeMillis();
           SyncLogModel localSyncLogModel = this.syncLogModel;
           String str = LoginInformation.getSingleInstance().getLoginedAccount();
           if (j != 0)
             break label307;
           m = getServerAdddedNum();
           if (j != 0)
             break label316;
           n = getServerModifiededNum();
           if (j != 0)
             break label325;
           i1 = getServerDeletedNum();
           localSyncLogModel.add(str, k, paramLong, l, m, n, i1, j, this.uploadBytes, this.downloadBytes, paramInt1, this.clientAddedNum, this.clientModifiedNum, this.clientDeletedNum, this.serverAddedNum, this.serverModifiedNum, this.serverDeletedNum, paramInt2, paramInt3);
           this.logWritten = true;
           continue;
         case 2:
         case 4:
         case 6:
         case 7:
         }
         break;
       case 4:
       case 5:
       case 9:
       case 6:
       case 7:
       case 8:
       case 2:
       }
     }
     finally
     {
     }
     int j = 0;
     continue;
     j = 1;
     continue;
     j = 2;
     continue;
     int k = 0;
     continue;
     k = 1;
     continue;
     k = 2;
     continue;
     k = 3;
     continue;
     label307: int m = getClientAddedNum();
     continue;
     label316: int n = getClientModifiededNum();
     continue;
     label325: int i2 = getClientDeletedNum();
     int i1 = i2;
   }
 }