org.tizen.dynamicanalyzer_1.0.0.201310312018

16:50:02.502 INFO  jd.cli.Main - Decompiling org.tizen.dynamicanalyzer_1.0.0.201310312018.jar
package org.tizen.dynamicanalyzer.common;

import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;

public class AnalyzerConstants
{
  public static final String SAVE_DATA_VERSION = "0.86";
  public static final boolean CHECK_INTERNAL = true;
  public static final String TOOLS_FOLDER_NAME = "tools";
  public static final String TARGET_FOLDER_NAME = "target";
  public static final String DYNAMIC_ANALYZER_FOLDER_NAME = "dynamic-analyzer";
  public static final String SAVE_FOLDER_NAME = "save";
  public static final String PLATFORM_FOLDER_NAME = "platforms";
  public static final String LOGS_FOLDER_NAME = "logs";
  public static final String TEMP_FOLDER_NAME = "temp";
  public static final String TEMP_FOLDER_RUN_PREFIX = ".RUN";
  public static final String IMAGE_FOLDER_NAME = "img";
  public static final String SMALL_IMAGE_FOLDER_NAME = "small";
  public static final String ICON_WORKBENCH_FOLDER_NAME = "icons";
  public static final String XML_FOLDER_NAME = "xml";
  public static final String CONFIG_FOLDER_NAME = "config";
  public static final String CONFIG_FILE_NAME = "config";
  public static final String TIZEN_SDK_DATA = "tizen-sdk-data";
  public static final String INSTALL = "tizensdkpath";
  public static final String ABOUT_IDE_FOLDER_NAME = "ide";
  public static final String ABOUT_PLUGINS_FOLDER_NAME = "plugins";
  public static final String ABOUT_BASE_PLATFORM_FOLDER_NAME = "org.tizen.base.platform";
  public static final String ABOUT_WORKBENCH_FOLDER_NAME = "org.tizen.dynamicanalyzer.workbench";
  public static final String ABOUT_FILE_NAME = "about.mappings";
  public static final String LICENSE_FILE_NAME = "license";
  public static final String USER_INTERFACE_API_LIST_FILE_NAME = "user_interface_api_list";
  public static final String TIZEN_FOLDER_ROOTSTRAPS = "rootstraps";
  public static final String TIZEN_FOLDER_USR = "usr";
  public static final String TIZEN_FOLDER_INCLUDE = "include";
  public static final String TIZEN_FOLDER_OSP = "osp";
  public static final String DA_DAEMON_NAME = "da_manager";
  public static final String TOOL_RECORDER_NAME = "da_event";
  public static final String READELF_BIN = "readelf";
  public static final String WIN_INSTALL_NODE = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders";
  public static final String WIN_INSTALL_KEY = "Local AppData";
  public static final String LINUX_INSTALL_ENV = "HOME";
  public static final String VERSION_NAME = "version";
  public static final String DATABASE_NAME = "da.trace";
  public static final String DEFAULT_IMAGE_NAME = "noImage.jpg";
  public static final String PROBE_LIB_TIZEN = "da_probe_tizen.so";
  public static final String PROBE_LIB_OSP = "da_probe_osp.so";
  public static final String LEAK_DATA_TABLE_NAME = "LeakData";
  public static final String FAILED_DATA_TABLE_NAME = "FailedData";
  public static final String LOG_QUEUE_OBSERVING_THREAD = "Log Queue Observing thread";
  public static final String COMMUNICATOR_RECEIVE_THREAD = "Communicator Receive Thread";
  public static final String MESSAGE_INTERNAL_IMAGE_THREAD = "Internal Image Process Thread";
  public static final String STOP_LOG_THREAD = "Stop Log Thread";
  public static final String BATTERY_RECEIVE_THREAD = "Battery Receive Thread";
  public static final String SLP_APP_RUN_THREAD = "SLP App Run Thread";
  public static final String OPEN_TRACE_THREAD = "Open trace input thread";
  public static final String INSERT_LOG_THREAD = "Insert log thread";
  public static final String IDE_COMMUNICATOR_THREAD = "IDE Communicator thread";
  public static final String SEND_MESSAGE_THREAD = "Send message thread";
  public static final String START_STOP_THREAD = "Start stop thread";
  public static final String FILE_CHART_MANAGER_THREAD = "File Chart Manager thread";
  public static final String THREAD_CHART_MANAGER_THREAD = "Thread Chart Manager thread";
  public static final String FUNCTION_USAGE_PROFILING_THREAD = "Function usage profiling thread";
  public static final String USER_INTERFACE_PAGE_MANAGER_THREAD = "User Interface Page Managerthread";
  public static final String SQL_INSERTER_THREAD = "sql_inserter_thread";
  public static final String CALLSTACK_START = "callstack_start";
  public static final String CALLSTACK_END = "callstack_end";
  public static final String CALLSTACK_CUT_MEMORY_TOKEN = "\\[";
  public static final String CALLSTACK_API_TOKEN = "\\(";
  public static final String CALLSTACK_API_TOKEN_STRING = "(";
  public static final String CALLSTACK_API_EMPTY_TOKEN = "\\)";
  public static final String CALLSTACK_API_OFFSET_TOKEN = "\\+";
  public static final String CLASS = "class";
  public static final String DATA_PARSING_TOKEN = "`,";
  public static final int SOCKET_CHECK_INTERVAL = 10;
  public static final int SOCKET_TIMEOUT = 300000;
  public static final int SOCKET_FORWARD_INTERVAL = 1000;
  public static final int LOG_CHECK_INTERVAL = 1000;
  public static final int SAVE_PREPARE_TIME = 2000;
  public static final long TIMER_START_TIME_DEFAULT = 1000L;
  public static final int TIMER_INTERVAL_DEFAULT = 1000;
  public static final int PROJECT_VERSION_INDEX = 0;
  public static final int PROJECT_CREATE_TIME_INDEX = 1;
  public static final int PROJECT_APPNAME_INDEX = 2;
  public static final int PROJECT_DEVICE_INDEX = 3;
  public static final int PROJECT_LAST_DATA_INDEX = 4;
  public static final int PROJECT_LAST_TIME_INDEX = 5;
  public static final int PROJECT_TOTAL_SAMPLE_COUNT = 6;
  public static final int PROJECT_PKG_ID_INDEX = 7;
  public static final int PROJECT_STOP_TIME_INDEX = 8;
  public static final int ERROR_EXTENSION_FAIL = -1;
  public static final int SUCCESS = 1;
  public static final int ERROR_SAVE_FAIL = 0;
  public static final int FAIL = -2;
  public static final int CANCEL = -3;
  public static final int INSERT_DATA_PACKAGE_SIZE = 80;
  public static final int MAX_REPEAT_COUNT = 5;
  public static final int DATABASE_READ_SIZE = 100000;
  public static final String MSG_START = "100";
  public static final String MSG_STOP = "101";
  public static final String MSG_OPTION = "103";
  public static final String MSG_VERSION = "999";
  public static final String MSG_OK = "901";
  public static final String MSG_NOT_OK = "902";
  public static final String MSG_SNAPSHOT = "103";
  public static final int MSG_RECORD = 801;
  public static final int MSG_REPLAY = 802;
  public static final int OPT_OFF = 0;
  public static final int OPT_CPUMEM = 1;
  public static final int OPT_FUNC = 2;
  public static final int OPT_ALLOC = 4;
  public static final int OPT_FILE = 8;
  public static final int OPT_THREAD = 16;
  public static final int OPT_UI = 32;
  public static final int OPT_SNAPSHOT = 64;
  public static final int OPT_EVENT = 128;
  public static final int OPT_RECORD = 256;
  public static final int MSG_APP_INFO = 1;
  public static final int MSG_USER_PROFILING_SAMPLE = 3;
  public static final int MSG_DEVICE_LOG = 4;
  public static final int MSG_LOG = 5;
  public static final int MSG_IMAGE = 6;
  public static final int MSG_TERMINATE = 7;
  public static final int MSG_DEBUG = 9;
  public static final int SNAPSHOT_OFF = 0;
  public static final int SNAPSHOT_ON = 1;
  public static final int DAEMON_LISTEN_TRY = 50;
  public static final int APP_INFO_SYSTEM_MEMORY_SIZE = 0;
  public static final int APP_INFO_STORAGE_SIZE = 1;
  public static final int APP_INFO_BLUETOOTH_SUPPORT = 2;
  public static final int APP_INFO_GPS_SUPPORT = 3;
  public static final int APP_INFO_WIFI_SUPPORT = 4;
  public static final int APP_INFO_CAMERA_COUNT = 5;
  public static final int APP_INFO_NETWORK_TYPE = 6;
  public static final int APP_INFO_MAX_BRIGHTNESS = 7;
  public static final int APP_INFO_WIDTH = 8;
  public static final int APP_INFO_HEIGHT = 9;
  public static final int APP_INFO_THEME = 10;
  public static final int APP_INFO_VERSION = 11;
  public static final int APP_INFO_SCALE = 12;
  public static final int APP_INFO_REMOVABLE = 13;
  public static final int APP_INFO_COMMENT = 14;
  public static final int APP_INFO_PID = 15;
  public static final int APP_INFO_START_TIME = 16;
  public static final int APP_INFO_PIE_BUILD = 17;
  public static final int APP_INFO_BASE_ADDRESS = 18;
  public static final int APP_INFO_APP_TYPE = 19;
  public static final int APP_INFO_BINARY_PATH = 20;
  public static final int APP_INFO_SIZE = 21;
  public static final int APP_TYPE_TIZEN = 0;
  public static final int APP_TYPE_OSP = 1;
  public static final int SOURCELINE_NOERROR = 0;
  public static final int SOURCELINE_NULL_PATH = 1;
  public static final int SOURCELINE_NULL_ADDRESS = 2;
  public static final int SOURCELINE_FILE_NOT_FOUND = 3;
  public static final int SOURCELINE_BAD_ADDRESS = 4;
  public static final int SOURCELINE_NO_SYMBOL_INFORMATION = 5;
  public static final int SOURCELINE_NO_MATCHING_LINE = 6;
  public static final int SOURCELINE_UNKNOWN_ERROR = 7;
  public static final int SOURCELINE_NO_SOURCELINE_DATA = 8;
  public static final int SOURCELINE_PIE_BUILD = 9;
  public static final int SOURCE_FILE_NOT_FOUND = 10;
  public static final String[] sourcelineErrorMsg = {
    AnalyzerLabels.EMPTY_STRING, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NULL_PATH, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NULL_ADDRESS, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_FILE_NOT_FOUND, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_BAD_ADDRESS, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_SYMBOL_INFORMATION, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_MATCHING_LINE, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_UNKNOWN_ERROR, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NO_SOURCELINE_DATA, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_PIE_BUILD, 
    AnalyzerLabels.ANALYZER_CONSTANTS_SOURCELINE_NOT_FOUND };
  public static final String USER_BIN_POS = "/opt/apps/";
  public static final int USER_CALL = 1;
  public static final int INTERNAL_CALL = 2;
  public static final int USER_CALL_CHECK_ERROR = -1;
  public static final String VIRTUAL_THUNK = "virtual base override";
  public static final int SORT_TYPE_NONE = 0;
  public static final int SORT_TYPE_NUM = 1;
  public static final int SORT_TYPE_STRING = 2;
  public static final int SORT_TYPE_GRID = 3;
  public static final int FUPD_APPLICATION = 1;
  public static final int FUPD_DEPENDENT_LIB = 2;
  public static final String DAEMONLOG_PREFIX = "da_daemon_log_";
  public static final int DAEMONLOG_COUNT = 3;
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import java.io.File;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.tizen.dynamicanalyzer.handlers.ClearHandler;
import org.tizen.dynamicanalyzer.handlers.StartHandler;
import org.tizen.dynamicanalyzer.model.BaseLogCenter;
import org.tizen.dynamicanalyzer.model.ImageInfo;
import org.tizen.dynamicanalyzer.model.LeakCheckList;
import org.tizen.dynamicanalyzer.model.LogCenter;
import org.tizen.dynamicanalyzer.project.Project;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.theme.DATheme;
import org.tizen.dynamicanalyzer.theme.DAThemeWhite;
import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackManager;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
import org.tizen.dynamicanalyzer.ui.page.DAPageComposite;
import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
import org.tizen.dynamicanalyzer.ui.summary.failed.FailedChecker;
import org.tizen.dynamicanalyzer.ui.summary.leaks.LeakDetector;
import org.tizen.dynamicanalyzer.ui.summary.profiling.FunctionUsageProfiler;
import org.tizen.dynamicanalyzer.ui.summary.warning.WarningChecker;
import org.tizen.dynamicanalyzer.ui.timeline.calltrace.UserFunctionManager;
import org.tizen.dynamicanalyzer.ui.toolbar.StopProcessManager;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.ExtensionFilter;
import org.tizen.dynamicanalyzer.utils.ImageListSortComparator;
import org.tizen.dynamicanalyzer.utils.XMLManager;

public class AnalyzerManager
{
  private static DATheme theme = null;
  private static Project project = null;
  private static List<BaseLogCenter> baseLogCenters;
  private static List<LogCenter> logCenters;
  private static List<String> projectList = null;
  private static HashMap<String, ImageInfo> imageSet = null;
  private static List<ImageInfo> imageList = null;
  private static int imageListSize = 0;
  private static LeakDetector leakDetector = new LeakDetector();
  private static FailedChecker failedChecker = new FailedChecker();
  private static FailedChecker calledChecker = new FailedChecker();
  private static WarningChecker warningChecker = new WarningChecker();
  private static CallStackManager callstackManager = new CallStackManager();
  private static boolean appInfoArrived = false;
  private static boolean isHaveSampleThread = false;
  private static boolean exit = false;
  private static String startBinaryAddr = null;
  private static String endBinaryAddr = null;
  public static final int THREAD_JOIN_WAIT_TIME = 5000;
  
  public static boolean isExit()
  {
    return exit;
  }
  
  public static void setExit(boolean e)
  {
    exit = e;
  }
  
  public static List<String> getProjectList()
  {
    if (projectList == null) {
      projectList = new ArrayList();
    }
    return projectList;
  }
  
  public static void removeFromProjectList(String path)
  {
    int size = getProjectList().size();
    for (int i = 0; i < size; i++) {
      if (((String)projectList.get(i)).equals(path))
      {
        projectList.remove(i);
        break;
      }
    }
  }
  
  public static DATheme getTheme()
  {
    if (theme == null) {
      theme = DAThemeWhite.getInstance();
    }
    return theme;
  }
  
  public static void setTheme(DATheme t)
  {
    theme = t;
    ColorResources.initColors();
  }
  
  public static boolean hasSampleThread()
  {
    return isHaveSampleThread;
  }
  
  public static void setSampleThread(boolean b)
  {
    isHaveSampleThread = b;
  }
  
  public static boolean isBinStartEndSet()
  {
    if ((startBinaryAddr != null) && (!startBinaryAddr.isEmpty()) && 
      (endBinaryAddr != null) && (!endBinaryAddr.isEmpty())) {
      return true;
    }
    return false;
  }
  
  public static void setBinaryStartEndAddr(String start, String end)
  {
    startBinaryAddr = start;
    endBinaryAddr = end;
  }
  
  public static boolean isInBinaryRange(String addrStr)
  {
    try
    {
      long startAddr = Long.parseLong(startBinaryAddr);
      long endAddr = Long.parseLong(endBinaryAddr);
      long addr = Long.parseLong(addrStr);
      if ((addr > endAddr) || (addr < startAddr)) {
        return false;
      }
      return true;
    }
    catch (NumberFormatException e)
    {
      e.printStackTrace();
    }
    return false;
  }
  
  public static void reset()
  {
    if (project != null)
    {
      if (!project.isValid())
      {
        String sourcePath = project.getSavePath();
        if ((sourcePath != null) && (!sourcePath.isEmpty()))
        {
          boolean success = AnalyzerUtil.deleteFile(new File(
            sourcePath));
          removeFromProjectList(sourcePath);
          if (success) {
            System.out.println("invalid project deleted!");
          } else {
            System.out.println("invalid project delete fail...");
          }
        }
      }
      project = null;
    }
    imageSet = null;
    imageList = null;
    imageListSize = 0;
    
    leakDetector.clear();
    failedChecker.clear();
    warningChecker.clear();
    calledChecker.clear();
    callstackManager.clear();
    isHaveSampleThread = false;
    StopProcessManager.clear();
    UserFunctionManager.getInstance().clear();
    FunctionUsageProfiler.clear();
    FunctionUsageProfiler.stopProfiler();
    RangeDataManager.getInstance().initRange();
    startBinaryAddr = null;
    endBinaryAddr = null;
    appInfoArrived = false;
    System.out.println("exit reset");
    exit = false;
  }
  
  public static List<ImageInfo> getImageList()
  {
    if (imageList == null)
    {
      imageList = new ArrayList();
      imageListSize = 0;
    }
    if (imageList.size() != getImageSet().size())
    {
      imageList.clear();
      Collection<ImageInfo> imageCol = getImageSet().values();
      imageList.addAll(imageCol);
      Collections.sort(imageList, new ImageListSortComparator());
      imageListSize = imageList.size();
    }
    return imageList;
  }
  
  public static HashMap<String, ImageInfo> getImageSet()
  {
    if (imageSet == null)
    {
      imageSet = new HashMap();
      ImageInfo noImage = new ImageInfo();
      noImage.setSeq("-1");
      noImage.setTime("-1");
      imageSet.put(noImage.getSeq(), noImage);
    }
    return imageSet;
  }
  
  public static String getImagePathByTime(String timeStr)
  {
    imageList = getImageList();
    String path = null;
    for (int i = 0; i < imageListSize; i++)
    {
      long imgTime = Long.parseLong(((ImageInfo)imageList.get(i)).getTime());
      long time = Long.parseLong(timeStr);
      if (imgTime > time) {
        break;
      }
      path = 
      
        getProject().getSavePath() + File.separator + "img" + File.separator + ((ImageInfo)imageList.get(i)).getImgFileName();
    }
    if (path != null) {
      return path;
    }
    return "noImage.jpg";
  }
  
  public static ImageInfo getImageInfoByTime(String timeStr)
  {
    imageList = getImageList();
    for (int i = imageListSize - 1; i >= 0; i--)
    {
      long imgTime = Long.parseLong(((ImageInfo)imageList.get(i)).getTime());
      long time = Long.parseLong(timeStr);
      if (imgTime <= time) {
        return (ImageInfo)imageList.get(i);
      }
    }
    return null;
  }
  
  public static int getImageIndexByTime(String timeStr)
  {
    imageList = getImageList();
    for (int i = imageListSize - 1; i >= 0; i--)
    {
      long imgTime = Long.parseLong(((ImageInfo)imageList.get(i)).getTime());
      long time = Long.parseLong(timeStr);
      if (imgTime <= time) {
        return i;
      }
    }
    return -1;
  }
  
  public static void setProject(Project p)
  {
    project = p;
    getProjectList().add(p.getSavePath());
  }
  
  public static void setProjectNoRegist(Project p)
  {
    project = p;
  }
  
  public static Project getProject()
  {
    return project;
  }
  
  public static List<BaseLogCenter> getBaseLogCenters()
  {
    if (baseLogCenters == null) {
      baseLogCenters = getAvailableLogCenters();
    }
    return baseLogCenters;
  }
  
  public static List<LogCenter> getInnerLogCenters()
  {
    if ((logCenters == null) || (logCenters.isEmpty()))
    {
      if (logCenters == null) {
        logCenters = new ArrayList();
      }
      List<BaseLogCenter> baseLogcs = getBaseLogCenters();
      if ((baseLogcs == null) || (baseLogcs.isEmpty()))
      {
        System.out.println("DynamicAnalyzer folder or logc file is missing! ");
        return null;
      }
      int size = baseLogcs.size();
      for (int i = 0; i < size; i++) {
        logCenters.add(copyLogCenter((BaseLogCenter)baseLogcs.get(i)));
      }
    }
    return logCenters;
  }
  
  public static LogCenter copyLogCenter(BaseLogCenter from)
  {
    LogCenter to = new LogCenter();
    to.setId(from.getId());
    to.setName(from.getName());
    to.setTotalColumnCount(from.getTotalColumnCount());
    to.setCustomColumn(from.isCustomColumn());
    
    to.getColumnName().addAll(from.getColumnName());
    to.getType().addAll(from.getType());
    to.getColumnSizes().addAll(from.getColumnSize());
    to.getColumnOrder().addAll(from.getColumnOrder());
    to.getColumnVisibility().addAll(from.getColumnVisibility());
    to.getTableColumnName().addAll(from.getTableColumnName());
    return to;
  }
  
  public static BaseLogCenter getBaseLogCenterById(int id)
  {
    if (baseLogCenters != null)
    {
      int size = baseLogCenters.size();
      for (int i = 0; i < size; i++) {
        if (id == ((BaseLogCenter)baseLogCenters.get(i)).getId()) {
          return (BaseLogCenter)baseLogCenters.get(i);
        }
      }
    }
    return null;
  }
  
  public static List<BaseLogCenter> getAvailableLogCenters()
  {
    String path = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH + 
      File.separator + "xml";
    File file = new File(path);
    if (!file.exists()) {
      return null;
    }
    File[] fileList = file.listFiles(new ExtensionFilter(
      ".logc"));
    if ((fileList == null) || (1 > fileList.length)) {
      return null;
    }
    int fileListLength = fileList.length;
    
    List<BaseLogCenter> logcs = new ArrayList();
    BaseLogCenter logc = new BaseLogCenter();
    for (int i = 0; i < fileListLength; i++)
    {
      logc = (BaseLogCenter)XMLManager.unmarshal(new File(path + 
        File.separator + fileList[i].getName()));
      if (logc != null) {
        logcs.add(logc);
      }
    }
    return logcs;
  }
  
  public static LeakDetector getLeakDetector()
  {
    return leakDetector;
  }
  
  public static FailedChecker getFailedChecker()
  {
    return failedChecker;
  }
  
  public static WarningChecker getWarningChecker()
  {
    return warningChecker;
  }
  
  public static CallStackManager getCallstackManager()
  {
    return callstackManager;
  }
  
  public static FailedChecker getCalledFunctionChecker()
  {
    return calledChecker;
  }
  
  public static void initRecordStart()
  {
    AnalyzerUtil.executeCommand(ClearHandler.ID);
    if (!isExit())
    {
      Project project = new Project();
      project.init();
    }
    if (!isExit()) {
      AnalyzerUtil.executeCommand(StartHandler.ID);
    }
  }
  
  public static List<LogCenter> getLogCenters()
  {
    if (project != null) {
      return project.getLogCenters();
    }
    return getInnerLogCenters();
  }
  
  public void initLogCenters()
  {
    if (logCenters != null) {
      logCenters.clear();
    } else {
      logCenters = new ArrayList();
    }
    logCenters.addAll(getLogCenters());
  }
  
  public static LogCenter getLogCenterById(int id)
  {
    List<LogCenter> logcs = getLogCenters();
    if (logcs != null)
    {
      int size = logcs.size();
      for (int i = 0; i < size; i++) {
        if (id == ((LogCenter)logcs.get(i)).getId()) {
          return (LogCenter)logcs.get(i);
        }
      }
    }
    return null;
  }
  
  public static LeakCheckList getLeakCheckList()
  {
    String path = AnalyzerPaths.DYNAMIC_ANALYZER_INSTALL_PATH + 
      File.separator + "xml";
    
    File file = new File(path);
    if (!file.exists()) {
      return null;
    }
    File[] fileList = file.listFiles(new ExtensionFilter(
      ".leak"));
    if ((fileList == null) || (1 > fileList.length)) {
      return null;
    }
    int fileListLength = fileList.length;
    
    LeakCheckList output = new LeakCheckList();
    LeakCheckList leakCheckList = new LeakCheckList();
    for (int i = 0; i < fileListLength; i++)
    {
      leakCheckList = (LeakCheckList)XMLManager.unmarshal(new File(path + 
        File.separator + fileList[i].getName()));
      output.getChecks().addAll(leakCheckList.getChecks());
    }
    leakCheckList = null;
    return output;
  }
  
  public static boolean isOsp()
  {
    int type = Integer.parseInt((String)getProject().getAppInfo().get(
      19));
    if (type == 1) {
      return true;
    }
    return false;
  }
  
  public static void setAppInfoArrived(boolean arrived)
  {
    appInfoArrived = arrived;
  }
  
  public static boolean isAppInfoArrived()
  {
    return appInfoArrived;
  }
  
  public static DAPageComposite getCurrentPage()
  {
    BaseView bv = (BaseView)AnalyzerUtil.getViewPart(BaseView.ID);
    return bv.getTopComposite();
  }
  
  public static boolean isRunning()
  {
    String state = AnalyzerUtil.getRecordState();
    if (state.equals("recording")) {
      return true;
    }
    return false;
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerManager
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import java.io.File;

public class AnalyzerPaths
{
  public static final String TIZEN_SDK_DATA_PATH = ;
  public static final String TIZEN_ROOT_PATH = PathManager.getDefaultRoot();
  public static final String DYNAMIC_ANALYZER_INSTALL_PATH = PathManager.getInstallPath();
  public static final String DYNAMIC_ANALYZER_SAVE_PATH = PathManager.getSavePath();
  public static final String TOOL_FOLDER_PATH = DYNAMIC_ANALYZER_INSTALL_PATH + 
    File.separator + "tools";
  public static final String TEMP_FOLDER_PATH = DYNAMIC_ANALYZER_SAVE_PATH + 
    File.separator + "temp";
  public static final String CONFIG_FOLDER_PATH = PathManager.getConfigFolderPath();
  public static final String WORKBENCH_FOLDER_PATH = PathManager.getWorkbenchPath();
  public static final String ABOUT_FILE_PATH = PathManager.getAboutPath();
  public static final String SDB_PATH = PathManager.getSdbPath();
  public static final String READELF_PATH = DYNAMIC_ANALYZER_INSTALL_PATH + 
    File.separator + "target" + 
    File.separator;
  public static final String TARGET_PATH = PathManager.getTargetPath();
  public static final String DA_SINGLETON_FILE_PATH = PathManager.getSavePath() + File.separator + "active_da";
  public static final String IDE_ACTIVE_PORT_PATH = PathManager.getSavePath() + 
    File.separator + "active_da_plugin";
  public static final String IDE_ACTIVE_SAVE_PORT_PATH = PathManager.getSavePath() + File.separator + "current_active_ide_port";
  public static final String WINDOW_ACTIVATOR_LINUX_PATH = TIZEN_ROOT_PATH + 
    "/tools/dynamic-analyzer/tool/windowactivator.sh";
  public static final String WINDOW_ACTIVATOR_WIDOWS_PATH = TIZEN_ROOT_PATH + 
    "/tools/dynamic-analyzer/tool/windowactivator.bat";
  public static final String WINDOW_ACTIVATOR_MACOS_PATH = TIZEN_ROOT_PATH + 
    "/tools/dynamic-analyzer/tool/macoswindowactivator.sh";
  public static final String TIZEN_HEADER_SOUECE_PATH = PathManager.getTizenHeaderSouecePath();
  public static final String DA_REMOTE_PROBE_PATH = "/home/developer/sdk_tools/da/";
  public static final String DA_REMOTE_PATH = "/home/developer/sdk_tools/da/";
  public static final String DA_REMOTE_DAEMON_BINARY_PATH = "/home/developer/sdk_tools/da/da_manager";
  public static final String TOOL_REMOTE_RECORDER_BINARY_PATH = "/home/developer/sdk_tools/da/da_event";
  public static final String APPLICATION_LIST_PATH = "/opt/share/applications/";
  public static final String DA_DAEMON_LOG_PATH = "/tmp/daemonlog.da";
  public static final String SDK_INFO_RELATIVE_PATH = "../../sdk.info";
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerPaths
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import java.io.File;
import java.io.PrintStream;
import java.util.List;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchListener;
import org.tizen.dynamicanalyzer.sql.SqlManager;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;

class AnalyzerPlugin$1
  implements IWorkbenchListener
{
  AnalyzerPlugin$1(AnalyzerPlugin paramAnalyzerPlugin) {}
  
  public void postShutdown(IWorkbench workbench)
  {
    List<String> tempProjects = AnalyzerManager.getProjectList();
    int size = tempProjects.size();
    for (int i = 0; i < size; i++)
    {
      File tempFile = new File((String)tempProjects.get(i));
      if ((tempFile.isFile()) && (tempFile.exists())) {
        AnalyzerUtil.deleteFile(tempFile);
      }
    }
    boolean delete = true;
    if (delete)
    {
      SqlManager.getInstance().closeConnection();
      File tempDir = new File(AnalyzerPaths.TEMP_FOLDER_PATH);
      if ((tempDir.isDirectory()) && (tempDir.exists())) {
        if (AnalyzerUtil.deleteFile(tempDir)) {
          System.out.println("Delete temp folder!");
        } else {
          System.out.println("Delete temp folder fail...");
        }
      }
    }
  }
  
  public boolean preShutdown(IWorkbench workbench, boolean forced)
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerPlugin.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;

class AnalyzerPlugin$2
  implements Listener
{
  AnalyzerPlugin$2(AnalyzerPlugin paramAnalyzerPlugin) {}
  
  public void handleEvent(Event event)
  {
    ShortCutManager.getInstance().handleShortCutEvent(event);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerPlugin.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import java.io.File;
import java.io.PrintStream;
import java.util.List;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IPartService;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchListener;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.themes.IThemeManager;
import org.osgi.framework.BundleContext;
import org.tizen.dynamicanalyzer.listeners.AnalyzerPartListener;
import org.tizen.dynamicanalyzer.listeners.AnalyzerPerspectiveListener;
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
import org.tizen.dynamicanalyzer.sql.SqlManager;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
import org.tizen.dynamicanalyzer.utils.InternalLogManager;

public class AnalyzerPlugin
  extends AbstractUIPlugin
{
  private static final String THEME_ID = "org.tizen.dynamicanalyzer.theme";
  private static AnalyzerPlugin plugin;
  
  public static AnalyzerPlugin getDefault()
  {
    return plugin;
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    plugin = this;
    
    InternalLogManager.getInstance().logHostStart();
    
    IWorkbench workbench = PlatformUI.getWorkbench();
    workbench.getActiveWorkbenchWindow().getPages();
    workbench.addWorkbenchListener(new IWorkbenchListener()
    {
      public void postShutdown(IWorkbench workbench)
      {
        List<String> tempProjects = AnalyzerManager.getProjectList();
        int size = tempProjects.size();
        for (int i = 0; i < size; i++)
        {
          File tempFile = new File((String)tempProjects.get(i));
          if ((tempFile.isFile()) && (tempFile.exists())) {
            AnalyzerUtil.deleteFile(tempFile);
          }
        }
        boolean delete = true;
        if (delete)
        {
          SqlManager.getInstance().closeConnection();
          File tempDir = new File(AnalyzerPaths.TEMP_FOLDER_PATH);
          if ((tempDir.isDirectory()) && (tempDir.exists())) {
            if (AnalyzerUtil.deleteFile(tempDir)) {
              System.out.println("Delete temp folder!");
            } else {
              System.out.println("Delete temp folder fail...");
            }
          }
        }
      }
      
      public boolean preShutdown(IWorkbench workbench, boolean forced)
      {
        return true;
      }
    });
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    window.addPerspectiveListener(new AnalyzerPerspectiveListener());
    
    workbench.getThemeManager().setCurrentTheme("org.tizen.dynamicanalyzer.theme");
    Shell shell = window.getShell();
    shell.setBackgroundMode(2);
    shell.setBackground(ColorResources.WINDOW_BG_COLOR);
    
    File saveFolder = new File(AnalyzerPaths.TEMP_FOLDER_PATH);
    if (saveFolder.exists()) {
      if (AnalyzerUtil.deleteFile(saveFolder)) {
        System.out.println("delete temp folder");
      } else {
        System.out.println("BUG: temp folder is already exists but failed to delete");
      }
    }
    if (!saveFolder.isDirectory()) {
      saveFolder.mkdirs();
    }
    IPartService partService = PlatformUI.getWorkbench()
      .getActiveWorkbenchWindow().getPartService();
    
    AnalyzerPartListener partListener = new AnalyzerPartListener();
    partService.addPartListener(partListener);
    
    AnalyzerUtil.getWorkbenchWindow().getShell().getDisplay()
      .addFilter(2, new Listener()
      {
        public void handleEvent(Event event)
        {
          ShortCutManager.getInstance().handleShortCutEvent(event);
        }
      });
  }
  
  public void stop(BundleContext context)
    throws Exception
  {
    InternalLogManager.getInstance().logHostEnd();
    plugin = null;
    
    super.stop(context);
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerPlugin
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

public class AnalyzerShellCommands
{
  public static final String CMD_REMOVE = "rm -rf";
  public static final String CMD_APPLICATION_LIST = "/usr/bin/pkginfo --listpkg";
  public static final String CMD_UPLOAD_FILE_LIST = "du -b /home/developer/sdk_tools/da/readelf";
  public static final String DACOMMAND_KILL_MANAGER = "da killmanager";
  public static final String DACOMMAND_KILL_APP = "da killapp";
  public static final String DACOMMAND_RUN_MANAGER = "da runmanager";
  public static final String DACOMMAND_RUN_EVENT = "da runevent";
  public static final String DACOMMAND_FIND_UNITTEST = "da findunittest";
  public static final String DACOMMAND_FIND_IME = "/usr/bin/pkginfo --arg-flt 10 http://tizen.org/category/ime";
  public static final String CMD_IS_ARM_ARCH = "uname -m";
  public static final String CMD_CAT_PORT_FILE = "cat /tmp/port.da";
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.AnalyzerShellCommands
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

public class CommonConstants
{
  public static final String EMPTY = "";
  public static final String SPACE = " ";
  public static final String TAB = "\t";
  public static final String SLASH = "/";
  public static final String BSLASH = "\\";
  public static final String CMD_SPLIT = "|";
  public static final String CMD_SPLIT_READ = "\\|";
  public static final String CMD_SPLIT_DOT = "\\.";
  public static final String NEW_LINE_CHAR = "\\n";
  public static final String NEW_LINE = "\n";
  public static final String DOT = ".";
  public static final String COMMA = ",";
  public static final String COLON = ":";
  public static final String DOUBLE_COLON = "::";
  public static final String SEMICOLON = ";";
  public static final String DASH = "-";
  public static final String UNDERBAR = "_";
  public static final String OPEN_BRACKET = "(";
  public static final String CLOSE_BRACKET = ")";
  public static final String OPEN_SQUARE_BRACKET = "[";
  public static final String CLOSE_SQUARE_BRACKET = "]";
  public static final String TILDE = "~";
  public static final String ELLIPSIS = "...";
  public static final String ZERO = "0";
  public static final String EQUAL = "=";
  public static final String ASTERISK = "*";
  public static final String GRAVE_ACCENT = "`";
  public static final String PERCENT = "%";
  public static final String EMULATOR = "emulator";
  public static final String ON = "on";
  public static final String OFF = "off";
  public static final String PLUS = "+";
  public static final String LOCAL_HOST = "127.0.0.1";
  public static final String EXTENSION_LOG_CENTER = ".logc";
  public static final String EXTENSION_LEAK_CHECK = ".leak";
  public static final String EXTENSION_JPG_IMAGE = ".jpg";
  public static final String EXTENSION_PNG_IMAGE = ".png";
  public static final String EXTENSION_GIF_IMAGE = ".gif";
  public static final String ARM_ARCH = "arm";
  public static final String X86_ARCH = "x86";
  public static final String OS_KEY = "os.name";
  public static final String LINUX = "linux";
  public static final String MAC = "mac";
  public static final String WIN = "win";
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.CommonConstants
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import org.eclipse.swt.widgets.Control;

public class DASelectionData
{
  private String viewId;
  private long startTime;
  private long endTime;
  private Object data;
  private Control control;
  
  public DASelectionData() {}
  
  public DASelectionData(String id, long start, long end, Object data, Control ctrl)
  {
    viewId = id;
    startTime = start;
    endTime = end;
    this.data = data;
    control = ctrl;
  }
  
  public Control getControl()
  {
    return control;
  }
  
  public void setControl(Control control)
  {
    this.control = control;
  }
  
  public String getViewId()
  {
    return viewId;
  }
  
  public void setViewId(String viewId)
  {
    this.viewId = viewId;
  }
  
  public long getStartTime()
  {
    return startTime;
  }
  
  public void setStartTime(long startTime)
  {
    this.startTime = startTime;
  }
  
  public long getEndTime()
  {
    return endTime;
  }
  
  public void setEndTime(long endTime)
  {
    this.endTime = endTime;
  }
  
  public Object getData()
  {
    return data;
  }
  
  public void setData(Object data)
  {
    this.data = data;
  }
}

/* Location:
 * Qualified Name:     org.tizen.dynamicanalyzer.common.DASelectionData
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.tizen.dynamicanalyzer.common;

import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchWindow;
import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
import org.tizen.dynamicanalyzer.resources.ImageResources;
import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
import org.tizen.dynamicanalyzer.ui.widgets.DADialog;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;

public class DASingletonFocusManager
{
  private static String pid = null;
  private static String Processid = null;
  private static int selfPid = 0;
  private static Runtime runtime;
  private static Process process;
  
  private DASingletonFocusManager()
  {
    selfPid = -1;
  }
  
  private DASingletonFocusManager(int iPid)
  {
    selfPid = iPid;
  }
  
  private static void getPid()
  {
    if (selfPid > 0)
    {
      pid = String.valueOf(selfPid);
    }
    else
    {
      ManagementFactory.getRuntimeMXBean();
      RuntimeMXBean rt = ManagementFactory.getRuntimeMXBean();
      Processid = rt.getName();
      pid = Processid.substring(0, Processid.indexOf("@"));
    }
  }
  
  private static String[] getSaveFocusPath()
  {
    String[] returnStr = (String[])null;
    String strPid = ConfigureManager.getInstance().getValue(
      ConfigureLabels.SINGLETON_FOCUS_DA_PID);
    if (AnalyzerUtil.isWin())
    {
      returnStr = new String[] {
        AnalyzerPaths.WINDOW_ACTIVATOR_WIDOWS_PATH, strPid };
    }
    else if (AnalyzerUtil.isMac())
    {
      returnStr = new String[] {
        AnalyzerPaths.WINDOW_ACTIVATOR_MACOS_PATH, strPid };
    }
    else if (AnalyzerUtil.isLinux())
    {
      returnStr = new String[] {
        AnalyzerPaths.WINDOW_ACTIVATOR_LINUX_PATH, strPid };
    }
    else
    {
      Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
      DADialog warning = new DADialog(shell, 0);
      
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd