List of usage examples for java.lang Thread setPriority
public final void setPriority(int newPriority)
From source file:ECallCenter21.java
/** * * @throws SQLException/* w w w . j a v a 2 s . c om*/ * @throws ClassNotFoundException * @throws InstantiationException * @throws IllegalAccessException * @throws NoSuchMethodException * @throws InvocationTargetException * @throws Exception */ @SuppressWarnings({ "static-access", "static-access", "static-access" }) public ECallCenter21() throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException, Exception { eCallCenterReference = this; // A thread doesn't inherit local varables, but it does local finals / constants String[] status = new String[2]; // sipstateUpdateThreadPool = Executors.newCachedThreadPool(); // responseUpdateThreadPool = Executors.newCachedThreadPool(); platform = System.getProperty("os.name").toLowerCase(); if (platform.indexOf("windows") != -1) { fileSeparator = "\\"; lineTerminator = "\r\n"; } else { fileSeparator = "/"; lineTerminator = "\r\n"; } plaf = new String[4]; plafSelected = new String(); plaf[0] = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; plaf[1] = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; plaf[2] = "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"; plaf[3] = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; setLookAndFeel(PLAF_NIMBUS); setMinimumSize(new Dimension(710, 598)); setMaximumSize(new Dimension(710, 830)); setPreferredSize(getMaximumSize()); setResizable(false); setVisible(false); setVisible(true); initComponents(); Thread defaultConstructorThread = new Thread(allThreadsGroup, new Runnable() { @Override public void run() { String[] status = new String[2]; String imgName = "/images/voipstormboxicon.jpg"; URL imgURL = getClass().getResource(imgName); Image image = Toolkit.getDefaultToolkit().getImage(imgURL); setIconImage(image); setImagePanelVisible(true); initSlidersSmooth(); sysMonitor = new SysMonitor(); dataDir = "data" + fileSeparator; soundsDir = dataDir + "sounds" + fileSeparator; vergunningDir = dataDir + "license" + fileSeparator; databasesDir = dataDir + "databases" + fileSeparator; configDir = dataDir + "config" + fileSeparator; binDir = dataDir + "bin" + fileSeparator; logDir = dataDir + "log" + fileSeparator; currentTimeCalendar = Calendar.getInstance(); logDateString = "" + String.format("%04d", currentTimeCalendar.get(Calendar.YEAR)) + String.format("%02d", currentTimeCalendar.get(Calendar.MONTH) + 1) + String.format("%02d", currentTimeCalendar.get(Calendar.DAY_OF_MONTH)) + "_" + String.format("%02d", currentTimeCalendar.get(Calendar.HOUR_OF_DAY)) + String.format("%02d", currentTimeCalendar.get(Calendar.MINUTE)) + String.format("%02d", currentTimeCalendar.get(Calendar.SECOND)); logFileString = logDir + logDateString + "_" + THISPRODUCT + ".log"; // System.out.println("\r\nChecking Directories..."); showStatus(Vergunning.PRODUCT + "Checking Directories...", true, false); boolean missingDirsDetected = false; boolean missingCriticalDirsDetected = false; file = new File(logDir); if (!file.exists()) { if (new File(logDir).mkdir()) { missingDirsDetected = true; showStatus("Info: Creating missing directory: " + logDir, true, false); } } file = new File(dataDir); if (!file.exists()) { if (new File(dataDir).mkdir()) { missingDirsDetected = true; showStatus("Warning: Creating missing directory: " + dataDir, true, true); } } file = new File(soundsDir); if (!file.exists()) { if (new File(soundsDir).mkdir()) { missingDirsDetected = true; showStatus("Critical: Creating missing directory: " + soundsDir, true, true); missingCriticalDirsDetected = true; } } file = new File(vergunningDir); if (!file.exists()) { if (new File(vergunningDir).mkdir()) { missingDirsDetected = true; showStatus("Info: Creating missing directory: " + vergunningDir, true, true); } } file = new File(databasesDir); if (!file.exists()) { if (new File(databasesDir).mkdir()) { missingDirsDetected = true; showStatus("Info: Creating missing directory: " + databasesDir, true, true); } } file = new File(configDir); if (!file.exists()) { if (new File(configDir).mkdir()) { missingDirsDetected = true; showStatus("Info: Creating missing directory: " + configDir, true, true); } } file = new File(binDir); if (!file.exists()) { if (new File(binDir).mkdir()) { missingDirsDetected = true; showStatus("Critical: Creating missing directory: " + binDir, true, true); missingCriticalDirsDetected = true; } } if (missingCriticalDirsDetected) { showStatus( "Critical directories were missing!!! Please download the entire VoipStorm package at: " + Vergunning.WEBLINK, true, true); try { Thread.sleep(4000); } catch (InterruptedException ex) { } } if (missingDirsDetected) { showStatus("VoipStorm directory structure built", true, true); try { Thread.sleep(1000); } catch (InterruptedException ex) { } } try { weblog = new WebLog(); } catch (Exception ex) { } Thread webLogThread = new Thread(new Runnable() { @Override @SuppressWarnings({ "static-access" }) public void run() { try { weblog.send(THISPRODUCT + " Starting"); } catch (Exception ex) { } } }); webLogThread.setName("webLogThread"); webLogThread.setDaemon(runThreadsAsDaemons); webLogThread.start(); registerSpeedValue.setText(Integer.toString(registrationBurstDelay)); registrationBurstDelay = registerSpeedSlider.getValue(); inboundRingingResponseDelayValue .setText(Integer.toString(inboundRingingResponseDelaySlider.getValue())); inboundRingingResponseBusyRatioValue .setText(Integer.toString(inboundRingingResponseBusyRatioSlider.getValue())); inboundEndDelayValue.setText(Integer.toString(inboundEndDelaySlider.getValue())); vmUsagePauseValue.setText(Integer.toString(vmUsageThresholdSlider.getValue())); vmUsagePauseThreashold = vmUsageThresholdSlider.getValue(); memFreeThresholdValue.setText(Integer.toString(memFreeThresholdSlider.getValue())); memFreeThreshold = memFreeThresholdSlider.getValue(); heapMemFreeThresholdValue.setText(Integer.toString(heapMemFreeThresholdSlider.getValue())); heapMemFreeThreshold = heapMemFreeThresholdSlider.getValue(); connectingTallyLimitValue.setText(Integer.toString(connectingTallyLimitSlider.getValue())); connectingTallyLimit = connectingTallyLimitSlider.getValue(); callingTallyLimitValue.setText(Integer.toString(callingTallyLimitSlider.getValue())); callingTallyLimit = callingTallyLimitSlider.getValue(); establishedTallyLimitValue.setText(Integer.toString(establishedTallyLimitSlider.getValue())); establishedTallyLimit = establishedTallyLimitSlider.getValue(); callSpeedValue.setText(Integer.toString(callSpeedSlider.getValue())); outboundBurstDelay = callSpeedSlider.getValue(); status = new String[2]; status[0] = "0"; status[1] = ""; nlLocale = new Locale("nl"); boundMode = "Outbound"; callCenterStatus = POWEREDOFF; // status = shell.getPID(); if (status[0].equals("0")) // { // pid = Integer.parseInt(status[1]); // outboundCallsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "In/Outbound Campaign Controls " + Integer.toString(pid), javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("STHeiti", 0, 14), new java.awt.Color(255, 255, 255))); // NOI18N // } // else { pid = 0; } softphonesQuantity = 0; setTitle(getWindowTitle()); // mainPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, getBrand() + " " + getProduct() + " " + getVersion(), javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("STHeiti", 0, 12), new java.awt.Color(102, 102, 102))); // NOI18N // configurationPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Proxy Configuration", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("STHeiti", 0, 12), new java.awt.Color(255, 255, 255))); // NOI18N // Starting the Database Server ultraShortMessagePeriod = 0; smoothMovementPeriod = 40; // eyeBlinkMessagePeriod = 250; // shortMessagePeriod = 1000; mediumMessagePeriod = 2000; myCoordinate = new Coordinate(); brandLabel.setText(Vergunning.BRAND); brandDescriptionLabel.setText(Vergunning.BRAND_DESCRIPTION); productLabel.setText(Vergunning.PRODUCT); productDescriptionLabel.setText(Vergunning.PRODUCT_DESCRIPTION); copyrightLabel.setText(getWarning() + " " + getCopyright() + " " + getBrand() + " " + getBusiness() + " - Author: " + getAuthor()); debugging = false; allThreadsGroup = new ThreadGroup("AllThreads"); vmUsageStatus = new String[2]; memFreeStatus = new String[2]; localDisplayData = new DisplayData(); // localSpeakerData = new SpeakerData(); vmUsageStatus[0] = "0"; vmUsageStatus[1] = ""; memFreeStatus[0] = "0"; memFreeStatus[1] = ""; // inboundSoftPhonesAvailableCounter = 0; inboundInstanceCounter = 0; outboundInstanceCounter = 0; // outboundPowerToggleButton.setEnabled(false); // myClickOnSoundTool = new SoundTool(SoundTool.CLICKONTONE); // myClickOffSoundTool = new SoundTool(SoundTool.CLICKOFFTONE); // mySuccessSoundTool = new SoundTool(SoundTool.SUCCESSTONE); // myPowerSuccessSoundTool = new SoundTool(SoundTool.POWERSUCCESSTONE); // myFailureSoundTool = new SoundTool(SoundTool.FAILURETONE); // myTickSoundTool = new SoundTool(SoundTool.TICKTONE); // myRegisterEnabledSoundTool = new SoundTool(SoundTool.REGISTERENABLEDTONE); // myRegisterDisabledSoundTool = new SoundTool(SoundTool.REGISTERDISABLEDTONE); // myAnswerEnabledSoundTool = new SoundTool(SoundTool.ANSWERENABLEDTONE); // myAnswerDisabledSoundTool = new SoundTool(SoundTool.ANSWERDISABLEDTONE); // myCancelEnabledSoundTool = new SoundTool(SoundTool.CANCELENABLEDTONE); // myCancelDisabledSoundTool = new SoundTool(SoundTool.CANCELDISABLEDTONE); // myMuteEnabledSoundTool = new SoundTool(SoundTool.MUTEENABLEDTONE); // myMuteDisabledSoundTool = new SoundTool(SoundTool.MUTEDISABLEDTONE); // // myRingToneSoundTool = new SoundTool(SoundTool.RINGTONE); // myDialToneSoundTool = new SoundTool(SoundTool.DEADTONE); // myCallToneSoundTool = new SoundTool(SoundTool.CALLTONE); // myBusyToneSoundTool = new SoundTool(SoundTool.BUSYTONE); // myDeadToneSoundTool = new SoundTool(SoundTool.DEADTONE); // myErrorToneSoundTool = new SoundTool(SoundTool.ERRORTONE); configurationCallCenter = new Configuration(); showStatus("Loading CallCenter Configuration...", true, true); /* true = logToApplic, true = logToFile */ status = configurationCallCenter.loadConfiguration("3"); if (status[0].equals("1")) // loadConfig failed { logToApplication("Loading CallCenter Configuration Failed: " + status[1]); showStatus("Loading CallCenter Configuration Failed, creating new Inbound Config", true, true); /* true = logToApplic, true = logToFile */ configurationCallCenter.createConfiguration(); clientIPField.setText(configurationCallCenter.getClientIP()); pubIPField.setText(configurationCallCenter.getPublicIP()); clientPortField.setText(configurationCallCenter.getClientPort()); domainField.setText(configurationCallCenter.getDomain()); serverIPField.setText(configurationCallCenter.getServerIP()); serverPortField.setText(configurationCallCenter.getServerPort()); prefPhoneLinesSlider.setMaximum(vergunning.getPhoneLines()); prefPhoneLinesSlider.setValue(vergunning.getPhoneLines()); usernameField.setText(configurationCallCenter.getUsername()); toegangField.setText(configurationCallCenter.getToegang()); if (configurationCallCenter.getRegister().equals("1")) { registerCheckBox.setSelected(true); } else { registerCheckBox.setSelected(false); } if (configurationCallCenter.getIcons().equals("1")) { iconsCheckBox.setSelected(true); } else { iconsCheckBox.setSelected(false); } showStatus("Saving new CallCenter Configuration...", true, true); /* true = logToApplic, true = logToFile */ configurationCallCenter.saveConfiguration("3"); // myFailureSoundTool.play(); } else // loadConfig Succeeded { // myPowerSuccessSoundTool.play(); clientIPField.setText(configurationCallCenter.getClientIP()); pubIPField.setText(configurationCallCenter.getPublicIP()); clientPortField.setText(configurationCallCenter.getClientPort()); domainField.setText(configurationCallCenter.getDomain()); serverIPField.setText(configurationCallCenter.getServerIP()); serverPortField.setText(configurationCallCenter.getServerPort()); prefPhoneLinesSlider.setMaximum(Integer.parseInt(configurationCallCenter.getPrefPhoneLines())); prefPhoneLinesSlider.setValue(Integer.parseInt(configurationCallCenter.getPrefPhoneLines())); usernameField.setText(configurationCallCenter.getUsername()); toegangField.setText(configurationCallCenter.getToegang()); if (configurationCallCenter.getRegister().equals("1")) { registerCheckBox.setSelected(true); } else { registerCheckBox.setSelected(false); } if (configurationCallCenter.getIcons().equals("1")) { iconsCheckBox.setSelected(true); } else { iconsCheckBox.setSelected(false); } showStatus("CallCenter Configuration Loaded Successfully", true, true); /* true = logToApplic, true = logToFile */ } icons = new Icons(PHONESPOOLTABLECOLUMNWIDTH, PHONESPOOLTABLECOLUMNHEIGHT, iconsCheckBox.isSelected()); lastTimeDashboardCalendar = Calendar.getInstance(); currentTimeDashboardCalendar = Calendar.getInstance(); // Prevent nullpointer in dashboard timer updateSystemStatsTimer = new Timer(); updateSystemStatsTimer.scheduleAtFixedRate(new UpdateSystemStatsTimer(eCallCenterReference), (long) (0), updateSystemStatsTimerFastInterval); showStatus( "updateSystemStatsTimer Scheduled immediate at " + Math.round(updateSystemStatsTimerFastInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ updateStallerTimer = new Timer(); updateStallerTimer.scheduleAtFixedRate(new UpdateStallerDetectorTimer(eCallCenterReference), (long) (0), updateStallerTimerInterval); showStatus( "updateStallerTimer Scheduled immediate at " + Math.round(updateStallerTimerInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ updateVergunningTimer = new Timer(); updateVergunningTimer.scheduleAtFixedRate(new UpdateVergunningTimer(eCallCenterReference), (long) (0), updateVergunningTimerInterval); showStatus( "updateLicenseTimer Scheduled immediate at " + Math.round(updateVergunningTimerInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ updateDashboardTimer = new Timer(); updateDashboardTimer.scheduleAtFixedRate(new UpdateDashboardTimer(eCallCenterReference), (long) (0), updateDashboardTimerInterval); showStatus( "updateDashboardTimer Scheduled immediate at " + Math.round(updateDashboardTimerInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ updateAutoSpeedTimer = new Timer(); updateAutoSpeedTimer.scheduleAtFixedRate(new UpdateAutoSpeedTimer(eCallCenterReference), (long) (0), updateAutoSpeedTimerInterval); showStatus( "updateAutoSpeedTimer Scheduled immediate at " + Math.round(updateAutoSpeedTimerInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ shell = new Shell(); platform = shell.getPlatform().toLowerCase(); if (platform.indexOf("mac os x") != -1) { systemStatsTable.setValueAt("RealMemFree", 2, 0); } else if (platform.indexOf("linux") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } //phonesPoolTable.setFont(new java.awt.Font("STHeiti", 0, 12)); else if (platform.indexOf("sunos") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } else if (platform.indexOf("hpux") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } else if (platform.indexOf("aix") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } else if (platform.indexOf("bsd") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } else if (platform.indexOf("windows") != -1) { systemStatsTable.setValueAt("TotMemFree", 2, 0); } else { systemStatsTable.setValueAt(platform + "?", 2, 0); setAutoSpeed(false); } // if (snmpCheckBox.isSelected()) // { // mySNMP = new SNMPClient(); // showStatus("Checking your SNMP server...", true, true); status = mySNMP.getStat(mySNMP.CPUIDLEOID); // if (status[0].equals("1")) { showStatus("Is your SNMP server running?", true, true); System.exit(1);} // // // Setup the infrequent SystemStats Timer // updateSystemStatsTimer.cancel(); updateSystemStatsTimer.purge(); // showStatus("updateSystemStatsTimer Canceled!", true, true); /* true = logToApplic, true = logToFile */ // updateSystemStatsTimer = new Timer(); updateSystemStatsTimer.scheduleAtFixedRate(new UpdateSystemStatsTimer(this), (long)(0), (updateSystemStatsTimerFastInterval)); // showStatus("updateSystemStatsTimer Scheduled immediate at " + Math.round(updateSystemStatsTimerFastInterval / 1000) + " Sec Interval", true, true); /* true = logToApplic, true = logToFile */ // } // captionTable.setValueAt(onSymbol + " ON", 0, 0); // captionTable.setValueAt("IDL/REG", 0, 1); // captionTable.setValueAt(connectingSymbol + " CON", 0, 2); // captionTable.setValueAt(callingSymbol + " CLL", 0, 3); // captionTable.setValueAt(ringingSymbol + " RNG", 0, 4); // captionTable.setValueAt(acceptingSymbol + " ACC", 0, 5); // captionTable.setValueAt(talkingSymbol + " TLK" , 0, 6); // captionTable.setValueAt(localcancelSymbol + " CAN", 0, 7); // captionTable.setValueAt(localbusySymbol + " BSY", 0, 8); // captionTable.setValueAt(localbyeSymbol + " " + remotebyeSymbol + " BYE", 0, 9); captionTable.setValueAt("ON", 0, 0); captionTable.setValueAt("IDL/REG", 0, 1); captionTable.setValueAt("CON", 0, 2); captionTable.setValueAt("TRY", 0, 3); captionTable.setValueAt("CLL", 0, 4); captionTable.setValueAt("RNG", 0, 5); captionTable.setValueAt("ACC", 0, 6); captionTable.setValueAt("TLK", 0, 7); captionTable.setValueAt("CAN", 0, 8); captionTable.setValueAt("BSY", 0, 9); captionTable.setValueAt("BYE", 0, 10); // Set the CallRatio Pie Chart callRatioChartData = new DefaultPieDataset(); // callRatioChartData.setValue("Slack", 0); callRatioChartData.setValue("Busy", 0); callRatioChartData.setValue("Success", 0); callRatioChart = ChartFactory.createPieChart("Waiting for Campaign...", callRatioChartData, true, true, false); // legend? // tooltips? // URLs? chartPanel = new ChartPanel(callRatioChart); org.jdesktop.layout.GroupLayout graphInnerPanelLayout = new org.jdesktop.layout.GroupLayout( graphInnerPanel); graphInnerPanel.setLayout(graphInnerPanelLayout); graphInnerPanelLayout.setHorizontalGroup( graphInnerPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add( chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 706, Short.MAX_VALUE)); graphInnerPanelLayout.setVerticalGroup( graphInnerPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add( chartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 247, Short.MAX_VALUE)); chartPanel.setFont(new java.awt.Font("STHeiti", 0, 10)); // NOI18N graphInnerPanel.setVisible(false); chartPanel.setVisible(false); chartPanel.setDoubleBuffered(true); // Set the PerformanceMeter Dial performanceMeter = new PerformanceMeter("Performance", vmUsageDecelerationThreashold, (Vergunning.CALLSPERHOUR_ENTERPRISE / 100)); performanceChartPanel = new ChartPanel(performanceMeter.chart1); org.jdesktop.layout.GroupLayout graphInnerPanelLayout2 = new org.jdesktop.layout.GroupLayout( performanceMeterPanel); performanceMeterPanel.setLayout(graphInnerPanelLayout2); graphInnerPanelLayout2.setHorizontalGroup( graphInnerPanelLayout2.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add( performanceChartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, performanceDialSize, Short.MAX_VALUE)); graphInnerPanelLayout2.setVerticalGroup( graphInnerPanelLayout2.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add( performanceChartPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, performanceDialSize, Short.MAX_VALUE)); performanceChartPanel.setFont(new java.awt.Font("STHeiti", 0, 10)); // NOI18N performanceMeterPanel.setVisible(true); performanceChartPanel.setVisible(true); performanceMeter.setCallPerHourNeedle(0); destination = new Destination(); // destinationElement = new Destination(); campaignStat = new CampaignStat(); lastStallerCampaignStat = new CampaignStat(); lastTimeDashboardCampaignStat = new CampaignStat(); // Last but not least, loading the Database Client try { dbClient = new JavaDBClient(eCallCenterReference, DATABASE); } catch (SQLException ex) { } catch (ClassNotFoundException ex) { } catch (InstantiationException ex) { } catch (IllegalAccessException ex) { } catch (NoSuchMethodException ex) { } catch (InvocationTargetException ex) { } catch (Exception ex) { } // Check for Open Campaigns String[] openCampaigns = dbClient.getOpenCampaigns(); if ((openCampaigns != null) && (openCampaigns.length > 0)) { campaignComboBox.setModel(new javax.swing.DefaultComboBoxModel(openCampaigns)); campaignComboBox.setEnabled(true); } else { campaignComboBox.setEnabled(false); runCampaignToggleButton.setEnabled(false); stopCampaignButton.setEnabled(false); } callCenterIsNetManaged = false; vergunningStartCalendar = Calendar.getInstance(); vergunningEndCalendar = Calendar.getInstance(); vergunningStartCalendar.set(Calendar.HOUR_OF_DAY, (int) 0); vergunningStartCalendar.set(Calendar.MINUTE, (int) 0); vergunningStartCalendar.set(Calendar.SECOND, (int) 0); vergunning = new Vergunning(); executeVergunning(); if (!vergunning.isValid()) { vergunningCodeField.setText(""); } else { performanceMeter.setCallPerHourScale(0, (vergunning.getCallsPerHour() / 100), (vergunning.getCallsPerHour() / 1000)); } timeTool = new TimeTool(); defaultConstructorIsReady = true; } }); defaultConstructorThread.setName("defaultConstructorThread"); defaultConstructorThread.setDaemon(runThreadsAsDaemons); defaultConstructorThread.setPriority(5); defaultConstructorThread.start(); }
From source file:com.android.vending.billing.InAppBillingService.LACK.listAppsFragment.java
private void LvlAdsPatch() { try {/*from w w w .ja va2 s . co m*/ showDialogLP(23); progress_loading.setMessage(Utils.getText(2131165747) + "..."); progress_loading.setCancelable(false); progress_loading.setMax(6); progress_loading.setTitle(Utils.getText(2131165747)); if (isAdded()) { patchAct = (patchActivity) getActivity(); } Thread localThread = new Thread(new Runnable() { public void run() { System.out.println("3"); String str = listAppsFragment.patchData.appdir; str = listAppsFragment.patchData.pkg; str = listAppsFragment.patchData.system_app; str = listAppsFragment.patchData.cmd1; try { listAppsFragment.str = ""; System.out.println(Utils.getCurrentRuntimeValue()); listAppsFragment.this.runToMain(new Runnable() { public void run() { if ((listAppsFragment.progress_loading != null) && (listAppsFragment.progress_loading.isShowing())) { listAppsFragment.progress_loading.setMessage(Utils.getText(2131165597)); listAppsFragment.progress_loading .setProgressNumberFormat(Utils.getText(2131165601)); } } }); listAppsFragment.result = ""; listAppsFragment.str = new Utils("").cmdRoot(new String[] { str }); listAppsFragment.startUnderRoot = Boolean.valueOf(false); if (listAppsFragment.str.contains("chelpus_return_1")) { listAppsFragment.this.runToMain(new Runnable() { public void run() { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165564)); } }); } if (listAppsFragment.str.contains("chelpus_return_2")) { listAppsFragment.this.runToMain(new Runnable() { public void run() { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165434)); } }); } if (listAppsFragment.str.contains("chelpus_return_3")) { listAppsFragment.this.runToMain(new Runnable() { public void run() { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165570)); } }); } if (listAppsFragment.str.contains("chelpus_return_4")) { listAppsFragment.this.runToMain(new Runnable() { public void run() { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165732)); } }); } listAppsFragment.this.afterPatch(listAppsFragment.patchData.result); return; } catch (Exception localException1) { System.out.println("LuckyPatcher Error LVLADS: " + localException1); localException1.printStackTrace(); try { listAppsFragment.this.runToMain(new Runnable() { public void run() { listAppsFragment.removeDialogLP(23); if (listAppsFragment.patchData.typePatch.equals("ADS")) { } try { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).modified = true; if (!listAppsFragment.patchData.result.contains("copyDC")) { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).odex = true; } listAppsFragment.plia.notifyDataSetChanged(listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName)); } catch (Exception localException1) { for (;;) { localException1.printStackTrace(); } } listAppsFragment.getConfig().edit() .putBoolean(listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).pkgName, true) .commit(); if (listAppsFragment.patchData.typePatch.equals("SUPPORT")) { } try { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).modified = true; if (!listAppsFragment.patchData.result.contains("copyDC")) { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).odex = true; } listAppsFragment.plia.notifyDataSetChanged(listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName)); } catch (Exception localException2) { for (;;) { localException2.printStackTrace(); } } listAppsFragment.getConfig().edit() .putBoolean(listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).pkgName, true) .commit(); if (listAppsFragment.patchData.typePatch.equals("LVL")) { } try { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).modified = true; if (!listAppsFragment.patchData.result.contains("copyDC")) { listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName).odex = true; } listAppsFragment.plia.notifyDataSetChanged(listAppsFragment.plia .getItem(listAppsFragment.patchData.pli.pkgName)); listAppsFragment.getConfig().edit() .putBoolean( listAppsFragment.plia.getItem( listAppsFragment.patchData.pli.pkgName).pkgName, true) .commit(); } catch (Exception localException3) { for (;;) { localException3.printStackTrace(); } } listAppsFragment.removeDialogLP(2); listAppsFragment.showDialogLP(2); if (listAppsFragment.str .contains("not enought free space for copy dalvik cache to odex.")) { listAppsFragment.this.showMessage(Utils.getText(2131165748), Utils.getText(2131165564)); } } }); return; } catch (Exception localException2) { System.out.println("LuckyPatcher: handler Null."); } } } }); localThread.setPriority(10); localThread.start(); return; } catch (Exception localException) { for (;;) { localException.printStackTrace(); } } }
From source file:com.android.vending.billing.InAppBillingService.LACK.listAppsFragment.java
private void updateapp() throws PackageManager.NameNotFoundException { Thread localThread = new Thread(new Runnable() { /* Error */ public void run() { // Byte code: // 0: aload_0 // 1: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 4: ldc 35 // 6: putfield 39 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:Text Ljava/lang/String; // 9: aload_0 // 10: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 13: iconst_0 // 14: putfield 43 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:FalseHttp I // 17: aload_0 // 18: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 21: iconst_0 // 22: putfield 46 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:VersionCode I // 25: aload_0 // 26: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 29: ldc 48 // 31: putfield 51 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:ApkName Ljava/lang/String; // 34: aload_0 // 35: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 38: ldc 53 // 40: putfield 56 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:AppName Ljava/lang/String; // 43: aload_0 // 44: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 47: ldc 58 // 49: putfield 61 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:Mirror1 Ljava/lang/String; // 52: aload_0 // 53: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 56: ldc 63 // 58: putfield 66 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:BuildVersionPath Ljava/lang/String; // 61: aload_0 // 62: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 65: ldc 68 // 67: putfield 71 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:BuildVersionChanges Ljava/lang/String; // 70: aload_0 // 71: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 74: new 73 java/lang/StringBuilder // 77: dup // 78: invokespecial 74 java/lang/StringBuilder:<init> ()V // 81: ldc 76 // 83: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 86: getstatic 83 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:luckyPackage Ljava/lang/String; // 89: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 92: invokevirtual 87 java/lang/StringBuilder:toString ()Ljava/lang/String; // 95: putfield 90 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:PackageName Ljava/lang/String; // 98: aload_0 // 99: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 102: new 73 java/lang/StringBuilder // 105: dup // 106: invokespecial 74 java/lang/StringBuilder:<init> ()V // 109: ldc 92 // 111: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 114: aload_0 // 115: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 118: getfield 51 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:ApkName Ljava/lang/String; // 121: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 124: invokevirtual 87 java/lang/StringBuilder:toString ()Ljava/lang/String; // 127: putfield 95 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:urlpath Ljava/lang/String; // 130: new 97 java/io/File // 133: dup // 134: new 97 java/io/File // 137: dup // 138: new 73 java/lang/StringBuilder // 141: dup // 142: invokespecial 74 java/lang/StringBuilder:<init> ()V // 145: getstatic 100 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:basepath Ljava/lang/String; // 148: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 151: ldc 102 // 153: invokevirtual 80 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 156: invokevirtual 87 java/lang/StringBuilder:toString ()Ljava/lang/String; // 159: invokespecial 105 java/io/File:<init> (Ljava/lang/String;)V // 162: aload_0 // 163: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 166: getfield 51 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:ApkName Ljava/lang/String; // 169: invokespecial 108 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V // 172: astore_2 // 173: aload_2 // 174: invokevirtual 112 java/io/File:exists ()Z // 177: ifeq +8 -> 185 // 180: aload_2 // 181: invokevirtual 115 java/io/File:delete ()Z // 184: pop // 185: iconst_1 // 186: istore_1 // 187: iload_1 // 188: ifeq +179 -> 367 // 191: new 117 java/net/URL // 194: dup // 195: aload_0 // 196: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 199: getfield 66 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:BuildVersionPath Ljava/lang/String; // 202: invokespecial 118 java/net/URL:<init> (Ljava/lang/String;)V // 205: invokevirtual 122 java/net/URL:openConnection ()Ljava/net/URLConnection; // 208: checkcast 124 java/net/HttpURLConnection // 211: astore_2 // 212: aload_2 // 213: ldc 126 // 215: invokevirtual 129 java/net/HttpURLConnection:setRequestMethod (Ljava/lang/String;)V // 218: aload_2 // 219: ldc -126 // 221: invokevirtual 134 java/net/HttpURLConnection:setConnectTimeout (I)V // 224: aload_2 // 225: iconst_0 // 226: invokevirtual 138 java/net/HttpURLConnection:setUseCaches (Z)V // 229: aload_2 // 230: ldc -116 // 232: ldc -114 // 234: invokevirtual 146 java/net/HttpURLConnection:setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V // 237: aload_2 // 238: invokevirtual 149 java/net/HttpURLConnection:connect ()V // 241: aload_2 // 242: invokevirtual 153 java/net/HttpURLConnection:getInputStream ()Ljava/io/InputStream; // 245: astore_3 // 246: new 155 java/io/ByteArrayOutputStream // 249: dup // 250: invokespecial 156 java/io/ByteArrayOutputStream:<init> ()V // 253: astore_2 // 254: sipush 8192 // 257: newarray <illegal type> // 259: astore 4 // 261: aload_3 // 262: aload 4 // 264: invokevirtual 162 java/io/InputStream:read ([B)I // 267: istore_1 // 268: iload_1 // 269: iconst_m1 // 270: if_icmpeq +24 -> 294 // 273: aload_2 // 274: aload 4 // 276: iconst_0 // 277: iload_1 // 278: invokevirtual 166 java/io/ByteArrayOutputStream:write ([BII)V // 281: goto -20 -> 261 // 284: astore_2 // 285: aload_2 // 286: invokevirtual 169 java/net/MalformedURLException:printStackTrace ()V // 289: iconst_0 // 290: istore_1 // 291: goto -104 -> 187 // 294: aload_2 // 295: invokevirtual 170 java/io/ByteArrayOutputStream:toString ()Ljava/lang/String; // 298: astore_3 // 299: aload_0 // 300: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 303: aload_3 // 304: invokestatic 176 java/lang/Integer:parseInt (Ljava/lang/String;)I // 307: putfield 46 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:VersionCode I // 310: aload_2 // 311: invokevirtual 179 java/io/ByteArrayOutputStream:close ()V // 314: goto -25 -> 289 // 317: astore_2 // 318: aload_2 // 319: invokevirtual 180 java/io/IOException:printStackTrace ()V // 322: aload_0 // 323: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 326: astore_2 // 327: aload_2 // 328: aload_2 // 329: getfield 43 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:FalseHttp I // 332: iconst_1 // 333: iadd // 334: putfield 43 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:FalseHttp I // 337: goto -48 -> 289 // 340: astore_2 // 341: aload_0 // 342: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 345: astore_2 // 346: aload_2 // 347: aload_2 // 348: getfield 43 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:FalseHttp I // 351: iconst_1 // 352: iadd // 353: putfield 43 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:FalseHttp I // 356: goto -67 -> 289 // 359: astore_2 // 360: aload_2 // 361: invokevirtual 181 java/lang/Exception:printStackTrace ()V // 364: goto -75 -> 289 // 367: aload_0 // 368: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 371: getfield 46 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:VersionCode I // 374: getstatic 184 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:versionCodeLocal I // 377: if_icmple +30 -> 407 // 380: aload_0 // 381: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 384: getfield 46 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:VersionCode I // 387: sipush 999 // 390: if_icmpne +18 -> 408 // 393: invokestatic 188 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:getConfig ()Landroid/content/SharedPreferences; // 396: ldc -66 // 398: iconst_0 // 399: invokeinterface 196 3 0 // 404: ifeq +4 -> 408 // 407: return // 408: new 117 java/net/URL // 411: dup // 412: aload_0 // 413: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 416: getfield 71 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:BuildVersionChanges Ljava/lang/String; // 419: invokespecial 118 java/net/URL:<init> (Ljava/lang/String;)V // 422: invokevirtual 122 java/net/URL:openConnection ()Ljava/net/URLConnection; // 425: checkcast 124 java/net/HttpURLConnection // 428: astore_2 // 429: aload_2 // 430: ldc 126 // 432: invokevirtual 129 java/net/HttpURLConnection:setRequestMethod (Ljava/lang/String;)V // 435: aload_2 // 436: ldc -126 // 438: invokevirtual 134 java/net/HttpURLConnection:setConnectTimeout (I)V // 441: aload_2 // 442: iconst_0 // 443: invokevirtual 138 java/net/HttpURLConnection:setUseCaches (Z)V // 446: aload_2 // 447: ldc -116 // 449: ldc -114 // 451: invokevirtual 146 java/net/HttpURLConnection:setRequestProperty (Ljava/lang/String;Ljava/lang/String;)V // 454: aload_2 // 455: invokevirtual 149 java/net/HttpURLConnection:connect ()V // 458: aload_2 // 459: invokevirtual 153 java/net/HttpURLConnection:getInputStream ()Ljava/io/InputStream; // 462: astore_2 // 463: new 155 java/io/ByteArrayOutputStream // 466: dup // 467: invokespecial 156 java/io/ByteArrayOutputStream:<init> ()V // 470: astore_3 // 471: sipush 8192 // 474: newarray <illegal type> // 476: astore 4 // 478: aload_2 // 479: aload 4 // 481: invokevirtual 162 java/io/InputStream:read ([B)I // 484: istore_1 // 485: iload_1 // 486: iconst_m1 // 487: if_icmpeq +35 -> 522 // 490: aload_3 // 491: aload 4 // 493: iconst_0 // 494: iload_1 // 495: invokevirtual 166 java/io/ByteArrayOutputStream:write ([BII)V // 498: goto -20 -> 478 // 501: astore_2 // 502: aload_2 // 503: invokevirtual 169 java/net/MalformedURLException:printStackTrace ()V // 506: aload_0 // 507: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 510: new 13 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5$1 // 513: dup // 514: aload_0 // 515: invokespecial 199 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5$1:<init> (Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5;)V // 518: invokevirtual 203 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:runToMain (Ljava/lang/Runnable;)V // 521: return // 522: aload_0 // 523: getfield 21 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment$5:this$0 Lcom/android/vending/billing/InAppBillingService/LACK/listAppsFragment; // 526: aload_3 // 527: invokevirtual 170 java/io/ByteArrayOutputStream:toString ()Ljava/lang/String; // 530: putfield 206 com/android/vending/billing/InAppBillingService/LACK/listAppsFragment:Changes Ljava/lang/String; // 533: aload_3 // 534: invokevirtual 179 java/io/ByteArrayOutputStream:close ()V // 537: goto -31 -> 506 // 540: astore_2 // 541: aload_2 // 542: invokevirtual 180 java/io/IOException:printStackTrace ()V // 545: goto -39 -> 506 // 548: astore_2 // 549: aload_2 // 550: invokevirtual 181 java/lang/Exception:printStackTrace ()V // 553: goto -47 -> 506 // 556: astore_2 // 557: goto -51 -> 506 // Local variable table: // start length slot name signature // 0 560 0 this 5 // 186 309 1 i int // 172 102 2 localObject1 Object // 284 27 2 localMalformedURLException1 MalformedURLException // 317 2 2 localIOException1 IOException // 326 3 2 locallistAppsFragment1 listAppsFragment // 340 1 2 localNumberFormatException1 NumberFormatException // 345 3 2 locallistAppsFragment2 listAppsFragment // 359 2 2 localException1 Exception // 428 51 2 localObject2 Object // 501 2 2 localMalformedURLException2 MalformedURLException // 540 2 2 localIOException2 IOException // 548 2 2 localException2 Exception // 556 1 2 localNumberFormatException2 NumberFormatException // 245 289 3 localObject3 Object // 259 233 4 arrayOfByte byte[] // Exception table: // from to target type // 191 261 284 java/net/MalformedURLException // 261 268 284 java/net/MalformedURLException // 273 281 284 java/net/MalformedURLException // 294 314 284 java/net/MalformedURLException // 191 261 317 java/io/IOException // 261 268 317 java/io/IOException // 273 281 317 java/io/IOException // 294 314 317 java/io/IOException // 191 261 340 java/lang/NumberFormatException // 261 268 340 java/lang/NumberFormatException // 273 281 340 java/lang/NumberFormatException // 294 314 340 java/lang/NumberFormatException // 191 261 359 java/lang/Exception // 261 268 359 java/lang/Exception // 273 281 359 java/lang/Exception // 294 314 359 java/lang/Exception // 408 478 501 java/net/MalformedURLException // 478 485 501 java/net/MalformedURLException // 490 498 501 java/net/MalformedURLException // 522 537 501 java/net/MalformedURLException // 408 478 540 java/io/IOException // 478 485 540 java/io/IOException // 490 498 540 java/io/IOException // 522 537 540 java/io/IOException // 408 478 548 java/lang/Exception // 478 485 548 java/lang/Exception // 490 498 548 java/lang/Exception // 522 537 548 java/lang/Exception // 408 478 556 java/lang/NumberFormatException // 478 485 556 java/lang/NumberFormatException // 490 498 556 java/lang/NumberFormatException // 522 537 556 java/lang/NumberFormatException }/* ww w .j a v a 2 s.c o m*/ }); localThread.setPriority(1); localThread.start(); }