SIGN: Added new cert policy for emulator 49/17149/1
authorJihoon Song <jihoon80.song@samsung.com>
Tue, 4 Mar 2014 09:53:51 +0000 (18:53 +0900)
committerJihoon Song <jihoon80.song@samsung.com>
Tue, 4 Mar 2014 09:53:51 +0000 (18:53 +0900)
If emulator only and no launched, use emulator certificates when build

Change-Id: Ifb034458af6369949a222e48be2d65494ef301b6
Signed-off-by: Jihoon Song <jihoon80.song@samsung.com>
org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java

index 52b6677..e1834aa 100644 (file)
@@ -89,6 +89,15 @@ public class SignatureGenerator {
         return ! ArrayUtil.isEmpty( devices );
     }
     
+    protected boolean isEmulatorAvailableOnly() {
+        IDevice[] devices = SmartDevelopmentBridge.getBridge().getDevices();
+        if ( ! ArrayUtil.isEmpty( devices ) ) {
+            return devices[0].isEmulator();
+        }
+        
+        return false;
+    }
+    
     protected boolean isEmulator(String deviceSerialNumber) {
         if ( StringUtil.isEmpty( deviceSerialNumber ) ) {
             return false;
@@ -137,7 +146,8 @@ public class SignatureGenerator {
         // Enable by new certification policy
         if ( SigningProfileUtil.isAvailableNewCertPolicy() ) {
             if ( hasAvailableDevice() ) {
-                if ( isEmulator( this.deviceSerialNumber ) ) {
+                if ( isEmulator( this.deviceSerialNumber )
+                        || isEmulatorAvailableOnly() ) {
                     // If selected device is an emulator, use default certificates.
                     return getEmulatorProfile();
                 }