sign.gradle 932 B

123456789101112131415161718192021222324
  1. tasks.register('generateKeystore') {
  2. group 'sign'
  3. description 'create jks'
  4. doFirst {
  5. def keytoolPath=project.property("sign.keytool.path")
  6. def keypass=project.property("sign.keytool.keypass")
  7. def keystore=project.property("sign.keytool.storepass")
  8. def dName=project.property("sign.keytool.dname")
  9. def appAlias=project.property("sign.keytool.appAlias")
  10. def keystorePath = "$project.project.projectDir.absolutePath\\app\\sign\\jxit.jks"
  11. exec {
  12. workingDir "."
  13. commandLine "$keytoolPath", "-genkey","-v",
  14. "-alias", appAlias,
  15. "-keyalg", "RSA",
  16. "-keypass", keypass,
  17. "-storepass", keystore,
  18. "-keystore", keystorePath,
  19. "-keysize" ,2048,
  20. "-validity", 30,
  21. "-dname",dName
  22. }
  23. }
  24. }