diff options
-rw-r--r-- | org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java | 5 | ||||
-rw-r--r-- | org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java | 43 |
2 files changed, 28 insertions, 20 deletions
diff --git a/org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java b/org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java index 13c507613..f163a5e54 100644 --- a/org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java +++ b/org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java @@ -191,6 +191,11 @@ public class SignatureGenerator { break; } } + } else { + // Comment note: + // If it is a target without profile, allow the Emulator profile. + // If doesn't have a profile, use default certificates. + return getEmulatorProfile(); } // interact user for setting profiles diff --git a/org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java b/org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java index ea81eb430..7487c5db0 100644 --- a/org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java +++ b/org.tizen.common.sign/src/org/tizen/common/sign/signer/TizenSigner.java @@ -26,8 +26,12 @@ package org.tizen.common.sign.signer; +import static org.slf4j.LoggerFactory.getLogger; + import java.io.File; +import org.slf4j.Logger; +import org.tizen.common.sign.model.ResolverCustomResource; import org.tizen.common.sign.preferences.SigningProfile; import org.tizen.common.sign.preferences.SigningProfileItem; import org.tizen.common.sign.util.SignatureUtility; @@ -35,6 +39,8 @@ import org.tizen.common.util.StringUtil; public class TizenSigner { + protected static final Logger logger = getLogger( TizenSigner.class ); + public static void usage() { System.out.println(BuildNumber.DESCRIPTION + " " + BuildNumber.VERSION_NUMBER); @@ -64,35 +70,35 @@ public class TizenSigner { String dist2CAPath = args[9]; String dist2RootPath = args[10]; -// if(StringUtil.isEmpty(authorCAPath)) { -// authorCAPath = SigningPathUtil.getAuthorCAPath(); -// dist1P12Path = SigningPathUtil.getDeveloperKeyPath(); -// dist1Pass = SigningPathUtil.DISTRIBUTOR1_PWD; -// dist1CAPath = SigningPathUtil.getDeveloperCAPath(); -// } -// -// authorSign(targetDir, authorP12Path, authorPass, authorCAPath, null); -// distSign(targetDir, dist1P12Path, dist1Pass, dist1CAPath, null, 1); -// dist2SignWithParameterCheck(targetDir, dist2P12Path, dist2Pass, dist2CAPath, dist2RootPath); SigningProfile profile = new SigningProfile( "temp" ); - if ( StringUtil.isEmpty( authorCAPath ) ) { - profile.createProfileItemForDeveloper(); - } else { - profile.createProfileItem(0, authorP12Path, authorPass, authorCAPath, null ); - } + + profile.createProfileItem( 0, authorP12Path, authorPass, authorCAPath, null ); + logger.info( "[Author] p12: {}, CA: {}", authorP12Path, authorCAPath ); + checkNullParameters( targetDir, authorP12Path, authorPass ); + profile.createProfileItem( 1, dist1P12Path, dist1Pass, dist1CAPath, null ); + logger.info( "[Distributor1] p12: {}, CA: {}", dist1P12Path, dist1CAPath ); + checkNullParameters( targetDir, dist1P12Path, dist1Pass ); + if ( ! StringUtil.isEmpty( dist2P12Path ) ) { + logger.info( "[Distributor2] p12: {}, CA: {}, RootCA: {}", + new Object[] { dist2P12Path, dist2CAPath, dist2RootPath } ); profile.createProfileItem( 2, dist2P12Path, dist2Pass, dist2CAPath, dist2RootPath ); + checkNullParameters( targetDir, dist2P12Path, dist2Pass ); } - TizenIncrementalSigner signer = new TizenIncrementalSigner( profile, targetDir ); + TizenIncrementalSigner signer = new TizenIncrementalSigner( profile, targetDir ) { + @Override + protected ResolverCustomResource getResourceResolver() { + return null; + } + }; signer.sign( false ); } public static void authorSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception { checkNullParameters(targetDir, authorP12Path, authorPass); -// HashingSigning.AuthorSignature(targetDir, authorP12Path, authorPass, authorCAPath, null); SigningProfileItem item = new SigningProfileItem(); item.setKeyLocation( authorP12Path ); @@ -107,7 +113,6 @@ public class TizenSigner { public static void distSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception { checkNullParameters(targetDir, distP12Path, distPass); -// HashingSigning.DistributorSignature(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber); SigningProfileItem item = new SigningProfileItem(); item.setKeyLocation( distP12Path ); @@ -122,7 +127,6 @@ public class TizenSigner { public static void authorIncrementalSign(String targetDir, String authorP12Path, String authorPass, String authorCAPath, String rootCaPath) throws Exception { checkNullParameters(targetDir, authorP12Path, authorPass); -// HashingSigning.AuthorSignatureRDS(targetDir, authorP12Path, authorPass, authorCAPath, null); SigningProfileItem item = new SigningProfileItem(); item.setKeyLocation( authorP12Path ); @@ -137,7 +141,6 @@ public class TizenSigner { public static void distIncrementalSign(String targetDir, String distP12Path, String distPass, String distCAPath, String distRootPath, int distNumber) throws Exception { checkNullParameters(targetDir, distP12Path, distPass); -// HashingSigning.DistributorSignatureRDS(targetDir, distP12Path, distPass, distCAPath, distRootPath, distNumber); SigningProfileItem item = new SigningProfileItem(); item.setKeyLocation( distP12Path ); |