ERR_READELF_UPLOAD_FAILED(-205, "readelf file size is different!!"),
- ERR_DEVICE_IS_NULL(-301, "current device is null"),
+ ERR_DEVICE_IS_NULL(-301, "Current device is not available"),
ERR_DEVICE_IS_OFFLINE(-302, "current device is offline"),
ERR_SELECTED_APP_IS_NULL(-401, "selected app is null"),
- ERR_MSG_START_FAIL(-501, "start message is not ok"),
+ ERR_MSG_START_FAIL(-501, "Current application is not available"),
ERR_MSG_STOP_FAIL(-502, "stop message is not ok"),
ERR_BIN_INFO_GET_FAIL(-507, "binary info get fail..."),
ERR_RECEIVE_ACK_FAIL(-508, "receiving ack message fail..."),
+
+ ERR_BY_SECURITY_REASON(-601, "error by security reason"),
ERR_DA_IS_EXIT(-901, "Dynamic Analyzer is closing"),
import org.tizen.dynamicanalyzer.model.AddrSymbolPair;
import org.tizen.dynamicanalyzer.model.DeviceInfo;
import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
+import org.tizen.dynamicanalyzer.nl.UserErrorWarningLabels;
import org.tizen.dynamicanalyzer.project.AppInfo;
import org.tizen.dynamicanalyzer.project.BinaryInfo;
import org.tizen.dynamicanalyzer.project.DeviceStatusInfo;
}
private HostResult pullTheFile(String from, String to) {
+ boolean becomeSuper = false;
try {
- Global.getCurrentDeviceInfo().getIDevice().becomeSuperUser(true);
+ becomeSuper = Global.getCurrentDeviceInfo().getIDevice().becomeSuperUser(true);
} catch (TimeoutException e) {
e.printStackTrace();
} catch (SdbCommandRejectedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
+ } finally {
+ if (!becomeSuper) {
+ return HostResult.ERR_BY_SECURITY_REASON;
+ }
}
SyncResult res = CommunicatorUtils.pull(from, to);
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
binInfo.setTempBinaryPath(localBinaryPath);
+ } else if (result.equals(HostResult.ERR_BY_SECURITY_REASON)) {
+ // popup by security reason
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE, 480, 153);
+ dialog.setIcon(ImageResources.DIALOG_ERROR_ICON);
+ dialog.setMessage(UserErrorWarningLabels.ERROR_BY_SECURITY_REASON);
+ dialog.open();
+ }
+ });
+
+ return;
}
} else {
// if local binary exist already, then check for md5sum
result = pullTheFile(targetPath, localBinaryPath);
if (result.isSuccess()) {
binInfo.setTempBinaryPath(localBinaryPath);
+ } else if (result.equals(HostResult.ERR_BY_SECURITY_REASON)) {
+ // popup by security reason
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ final Shell shell = WorkbenchUtil.getWorkbenchWindow().getShell();
+ DADialog dialog = new DADialog(shell, SWT.NONE, 480, 153);
+ dialog.setIcon(ImageResources.DIALOG_ERROR_ICON);
+ dialog.setMessage(UserErrorWarningLabels.ERROR_BY_SECURITY_REASON);
+ dialog.open();
+ }
+ });
+
+ return;
}
} else {
binInfo.setTempBinaryPath(localBinaryPath);
import org.tizen.dynamicanalyzer.util.CommonUtil;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.dynamicanalyzer.util.UnsignedInt;
-import org.tizen.dynamicanalyzer.util.WorkbenchUtil;
import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
public class MessageParser {
static final int MSG_BUFFER_MAX = 5000;
static final int MSG_BUFFER_TIMER_DELAY = 5;
static final int MSG_BUFFER_TIMER_PERIOD = 1000; // 1 second
- static final int WAITING_TIME = 100;
+ static final int WAITING_TIME = 10;
public static final int MSG_HEADER_SIZE = 20;
final int MSG_PAYLOAD_SIZE_INDEX = 16;