I made these low-risk changes on the GitHub UI, not yet tested. I think there should be a low risk of build failure and even lower risk of new run-time issues.
remove redundant @TargetApi from callback method, as a higher @TargetApi value was already specified for the plugin class
cleanup: remove an extra semicolon (that is not needed)
cleanup: split long KeyChain.choosePrivateKeyAlias() line
rename inner class to PrivateKeyAliasCallback
rename the internal methods (and make the second internal method private)
cleanup: add blank line to imports
cleanup: remove extra blank lines before final constants
use internal CRYPTO_RSA constant instead of hardcoded string
make other internal constant strings private
cleanup: remove more extra blank lines
TODO items:
[ ] test that this plugin continues to build and run correctly with these changes
[ ] I think JavaDoc comments should be added for the sake of clarity. This idea was triggered by the extra blank lines.
I made these low-risk changes on the GitHub UI, not yet tested. I think there should be a low risk of build failure and even lower risk of new run-time issues.
@TargetApi
from callback method, as a higher@TargetApi
value was already specified for the plugin classKeyChain.choosePrivateKeyAlias()
linePrivateKeyAliasCallback
CRYPTO_RSA
constant instead of hardcoded stringTODO items:
android.security.keystore.KeyProperties.KEY_ALGORITHM_RSA
(KeyProperties.KEY_ALGORITHM_RSA
) - see https://github.com/mibrito707/cordova-plugin-secure-storage/blob/f07cf1e2d14607c60f7cd5c17b7fe7c1149922cb/src/android/RSA.java#L176PrivateKeyAliasCallback
class should be privateThis proposal was triggered by my attempt to understand the general behavior and “how it works” of this implementation.
I hope I will get a chance to continue with these changes with some decent testing, someday.