|
25 | 25 |
|
26 | 26 | from adb import adb_commands |
27 | 27 | from adb import common_cli |
| 28 | +from adb import android_pubkey |
28 | 29 |
|
29 | 30 | try: |
30 | 31 | from adb import sign_m2crypto |
@@ -149,6 +150,14 @@ def main(): |
149 | 150 | subparser.add_argument( |
150 | 151 | '--output_port_path', action='store_true', |
151 | 152 | help='Outputs the port_path alongside the serial') |
| 153 | + subparser = subparsers.add_parser( |
| 154 | + name='keygen', help='generate adb public/private key ' |
| 155 | + 'private key stored in {filepath} ' |
| 156 | + 'public key stored in {filepath}.pub ' |
| 157 | + '(existing files overwritten)') |
| 158 | + subparser.add_argument( |
| 159 | + 'filepath', |
| 160 | + help='File path to write the private/public keypair (existing files overwritten)') |
152 | 161 |
|
153 | 162 | common_cli.MakeSubparser( |
154 | 163 | subparsers, parents, adb_commands.AdbCommands.Install) |
@@ -195,6 +204,8 @@ def main(): |
195 | 204 | if args.command_name == 'help': |
196 | 205 | parser.print_help() |
197 | 206 | return 0 |
| 207 | + if args.command_name == 'keygen': |
| 208 | + return android_pubkey.keygen(args.filepath) |
198 | 209 | if args.command_name == 'logcat': |
199 | 210 | args.positional = args.options |
200 | 211 | elif args.command_name == 'shell': |
|
0 commit comments