Файлы System/bin Android 12. Справочник.


  Все     Команда     Скрипт     Служба     Приложение  

keystore_cli_v2 - исходный текст
int main(int argc, char** argv) {
    CommandLine::Init(argc, argv);
    CommandLine* command_line = CommandLine::ForCurrentProcess();
    CommandLine::StringVector args = command_line->GetArgs();
    ABinderProcess_startThreadPool();
    if (args.empty()) {
        PrintUsageAndExit();
    }
    if (args[0] == "brillo-platform-test") {
        return BrilloPlatformTest(command_line->GetSwitchValueASCII("prefix"),
                                  command_line->HasSwitch("test_for_0_3"));
    } else if (args[0] == "list-brillo-tests") {
        return ListTestCases();
    } else if (args[0] == "generate") {
        return GenerateKey(command_line->GetSwitchValueASCII("name"),
                           securityLevelOption2SecurlityLevel(*command_line),
                           command_line->HasSwitch("auth_bound"));
    } else if (args[0] == "get-chars") {
        return GetCharacteristics(command_line->GetSwitchValueASCII("name"));
    } else if (args[0] == "export") {
        return ExportKey(command_line->GetSwitchValueASCII("name"));
    } else if (args[0] == "delete") {
        return DeleteKey(command_line->GetSwitchValueASCII("name"));
    } else if (args[0] == "exists") {
        return DoesKeyExist(command_line->GetSwitchValueASCII("name"));
    } else if (args[0] == "list") {
        return List();
    } else if (args[0] == "sign-verify") {
        return SignAndVerify(command_line->GetSwitchValueASCII("name"));
    } else if (args[0] == "encrypt") {
        return Encrypt(command_line->GetSwitchValueASCII("name"),
                       command_line->GetSwitchValueASCII("in"),
                       command_line->GetSwitchValueASCII("out"),
                       securityLevelOption2SecurlityLevel(*command_line));
    } else if (args[0] == "decrypt") {
        return Decrypt(command_line->GetSwitchValueASCII("name"),
                       command_line->GetSwitchValueASCII("in"),
                       command_line->GetSwitchValueASCII("out"));
    } else if (args[0] == "confirmation") {
        return Confirmation(command_line->GetSwitchValueNative("prompt_text"),
                            command_line->GetSwitchValueASCII("extra_data"),
                            command_line->GetSwitchValueASCII("locale"),
                            command_line->GetSwitchValueASCII("ui_options"),
                            command_line->GetSwitchValueASCII("cancel_after"));
    } else {
        PrintUsageAndExit();
    }
    return 0;
}