android-plugin icon indicating copy to clipboard operation
android-plugin copied to clipboard

System keyring integration for apk signing

Open naufraghi opened this issue 12 years ago • 4 comments

I have seen that there is some integration only with the Os X keyring, perhaps using a library can help a lot. Using Scala + sbt to write seamlessly integrated OSX Apps has a section explaining the use of the Netbeans keyring module (cited from the site):

It consists of two parts: A platform-independent API and implementations of this API for all major operating systems. Currently there are implementations for OSX, Windows, KDE, Gnome, SPI and a fallback using a Java keystore. We start by adding all of that to our build.sbt:

libraryDependencies ++= Seq(
  "org.netbeans.api" % "org-netbeans-modules-keyring" % "RELEASE721",
  "org.netbeans.modules" % "org-netbeans-modules-keyring-impl" % "RELEASE721"
)

resolvers += "netbeans" at "http://bits.netbeans.org/maven2/"

Usage is straightforward, once you know that the keyring only stores char arrays:

private val keyName = "doctivity"

def readToken =
   Keyring.read(keyName) match {
      case null  => None
      case chars => Some(chars.mkString)
   }

 def storeToken(token: String) {
   Keyring.save(keyName, token.toCharArray, "access token for doctivity")
 }

 def deleteToken {
   Keyring.delete(keyName)
 }

naufraghi avatar Mar 25 '14 23:03 naufraghi

Interesting request. However this keyring implementation is unsuitable for use on windows.

pfn avatar Jul 16 '14 19:07 pfn

In fact on windows there is the Windows Credential Vault, it is supported in https://bitbucket.org/kang/python-keyring-lib and I'm using the "spawn-some-service" solution already in gradle: http://stackoverflow.com/a/22597752/317518

On Wed, Jul 16, 2014 at 9:41 PM, Perry [email protected] wrote:

Interesting request. However this keyring implementation is unsuitable for use on windows.

— Reply to this email directly or view it on GitHub https://github.com/jberkel/android-plugin/issues/201#issuecomment-49216217 .

Matteo Bertini http://www.slug.it/naufraghi

naufraghi avatar Jul 17 '14 08:07 naufraghi

I'm not saying keychain support in general won't work on windows. I'm pointing out that the keyring library you pointed out is unsuitable for windows.

pfn avatar Jul 18 '14 14:07 pfn

OK, sorry, I often forget that windows is used as a non-only-gaming-but-also-development platform too :)

naufraghi avatar Jul 18 '14 15:07 naufraghi