return aboutFilePath;
}
-
+
+ /**
+ * isPlatformSDK() functionality is replaced.
+ *
+ * @deprecated use SettingDataManager.INSTANCE.isPlatformDA() instead.
+ */
+ @Deprecated
public static boolean isPlatformSDK() {
return checkPlatformPlugin();
}
+ /**
+ * checkPlatformPlugin() functionality is replaced.
+ *
+ * @deprecated use SettingDataManager.INSTANCE.isPlatformDA() instead.
+ */
+ @Deprecated
public static boolean checkPlatformPlugin() {
String idePluginPath = TIZEN_SDK_INSTALL_PATH + File.separator
+ PathConstants.IDE_FOLDER_NAME + File.separator
configurer.setTitle("Dynamic Analyzer");
configurer.setShowCoolBar(false);
configurer.setShowFastViewBars(false);
- if (PathManager.isPlatformSDK())
- configurer.setTitle(WorkbenchLabels.DA_PLATFORM_WORKBENCH_TITLE);
- else
- configurer.setTitle(WorkbenchLabels.DA_PUBLIC_WORKBENCH_TITLE);
}
public void postWindowOpen() {
}
public static boolean enableRoot(IDevice device) {
+ // the getPlatformCapability() method is working differently between
+ // platform & product and Tizen platform versions.
+
+ // Tizen Platform | 2.3 | 2.3.1 | 2.3.2 / 2.4 / 3.0
+ // ----------------+----------------+-----------------+-------------------
+ // product | available | available | available
+ // emulator | not available | not available | available
+
+ // If the capability function is available, DA can get the root privilege via getSdbRootPerm().
+ // but if the target image uses "user" binary it dose not permit it. So it returns "sdbd_rootperm:disabled".
+
boolean availability = false;
try {
} catch (TimeoutException e) {
Logger.exception(e);
} catch (SdbCommandRejectedException e) {
- Logger.exception(e);
+ Logger.debug("getPlatformCapability() failed");
+
+ // If the platform doesn't have the capability,
+ // check the root privilege with device.becomeSuperUser API.
+ if(becomeSuperUser(device,true) == true){
+ availability = true;
+
+ // Reset if the "root on" was successes to avoid the system runs as root.
+ becomeSuperUser(device, false);
+ } else {
+ availability = false;
+ }
+
} catch (IOException e) {
Logger.exception(e);
}
import org.tizen.dynamicanalyzer.common.path.PathManager;
import org.tizen.dynamicanalyzer.handlers.UIActionHolder;
import org.tizen.dynamicanalyzer.protocol.Protocol;
+import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
import org.tizen.dynamicanalyzer.util.Logger;
import org.tizen.sdblib.IDevice;
}
// set availability of root
- devInfo.setAvailabilityOfRoot(CommunicatorUtils.enableRoot(device));
+ if(SettingDataManager.INSTANCE.isPlatformDA() == true)
+ devInfo.setAvailabilityOfRoot(CommunicatorUtils.enableRoot(device));
+
// connect with swap of device
DAResult result = devInfo.getCommunicator().connect();
if (result.isSuccess()) {
protected DAResult pullTheFile(String from, String to) {
DeviceInfo curDev = parent.getDevice();
- if (!curDev.isRootAvailable()) {
- return new DAResult(ErrorCode.ERR_BY_SECURITY);
- }
+ // First try to pull the binary from device.
+ SyncResult res = CommunicatorUtils.pull(curDev.getIDevice(), from, to);
- if (!CommunicatorUtils.becomeSuperUser(curDev.getIDevice(), true)) {
- return new DAResult(ErrorCode.ERR_BY_SECURITY);
- }
+ if (null != res && res.isOk() == false){
+ // if fail to get the binary, Do Second try with the root privilege for Platform DA
+ if(SettingDataManager.INSTANCE.isPlatformDA() == true){
+ // to support platform DA features, DA should get the root privilege.
+ if (!curDev.isRootAvailable()) {
+ return new DAResult(ErrorCode.ERR_BY_SECURITY);
+ }
- SyncResult res = CommunicatorUtils.pull(curDev.getIDevice(), from, to);
+ // set root on here
+ if (!CommunicatorUtils.becomeSuperUser(curDev.getIDevice(), true)) {
+ return new DAResult(ErrorCode.ERR_BY_SECURITY);
+ }
- CommunicatorUtils.becomeSuperUser(curDev.getIDevice(), false);
+ res = CommunicatorUtils.pull(curDev.getIDevice(), from, to);
+
+ CommunicatorUtils.becomeSuperUser(curDev.getIDevice(), false);
+
+ }
+ }
if (null != res && res.isOk()) {
Logger.debug("binary copy success : " + from);//$NON-NLS-1$
} else {
Logger.warning("Failed to get " + from); //$NON-NLS-1$
DAResult ret = new DAResult(ErrorCode.ERR_DOWNLOAD_FILE_FAILED);
+
ret.setDetailMessage(CommonConstants.OPEN_BRACKET + from
+ CommonConstants.CLOSE_BRACKET);
return ret;