App(
    appid="totp",
    name="Authenticator",
    apptype=FlipperAppType.EXTERNAL,
    entry_point="totp_app",
    cdefines=["APP_TOTP"],
    requires=["gui", "cli", "dialogs", "storage", "input", "notification", "bt"],
    stack_size=2 * 1024,
    order=20,
    fap_version="5.91",
    fap_author="Alexander Kopachov (@akopachov)",
    fap_description="Software-based TOTP/HOTP authenticator for Flipper Zero device",
    fap_weburl="https://github.com/akopachov/flipper-zero_authenticator",
    fap_category="Tools",
    fap_icon_assets="images",
    fap_icon="totp_10px.png",
    fap_file_assets="assets",
    fap_private_libs=[
        Lib(
            name="base32",
        ),
        Lib(
            name="polyfills",
        ),
        Lib(
            name="roll_value",
        ),
        Lib(
            name="wolfssl",
            sources=[
                "wolfcrypt/src/pwdbased.c",
                "wolfcrypt/src/hmac.c",
                "wolfcrypt/src/hash.c",
                "wolfcrypt/src/sha.c",
                "wolfcrypt/src/sha256.c",
                "wolfcrypt/src/sha512.c",
                "wolfcrypt/src/coding.c",
            ],
            cflags=["-Wno-error"],
            cdefines=["HAVE_CONFIG_H"],
            cincludes=["config/wolfssl"],
        ),
    ],
)

App(
    appid="totp_cli_timezone_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_timezone_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/timezone/timezone.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_version_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_version_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/version/version.c"],
)

App(
    appid="totp_cli_help_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_help_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/help/help.c"],
)

App(
    appid="totp_cli_list_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_list_plugin_ep",
    requires=["totp"],
    sources=[
        "cli/plugins/list/list.c",
        "cli/cli_shared_methods.c",
        "cli/plugins/list/formatters/table/list_output_formatter_table.c",
        "cli/plugins/list/formatters/tsv/list_output_formatter_tsv.c",
    ],
)

App(
    appid="totp_cli_details_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_details_plugin_ep",
    requires=["totp"],
    sources=[
        "cli/plugins/details/details.c",
        "cli/cli_shared_methods.c",
        "cli/plugins/details/formatters/table/details_output_formatter_table.c",
        "cli/plugins/details/formatters/tsv/details_output_formatter_tsv.c",
    ],
)

App(
    appid="totp_cli_add_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_add_plugin_ep",
    requires=["totp"],
    sources=[
        "cli/plugins/modify/add/add.c",
        "cli/plugins/modify/common.c",
        "cli/cli_shared_methods.c",
    ],
)

App(
    appid="totp_cli_update_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_update_plugin_ep",
    requires=["totp"],
    sources=[
        "cli/plugins/modify/update/update.c",
        "cli/plugins/modify/common.c",
        "cli/cli_shared_methods.c",
    ],
)

App(
    appid="totp_cli_delete_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_delete_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/delete/delete.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_move_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_move_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/move/move.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_reset_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_reset_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/reset/reset.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_pin_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_pin_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/pin/pin.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_automation_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_automation_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/automation/automation.c", "cli/cli_shared_methods.c"],
)

App(
    appid="totp_cli_notification_plugin",
    apptype=FlipperAppType.PLUGIN,
    entry_point="totp_cli_notification_plugin_ep",
    requires=["totp"],
    sources=["cli/plugins/notification/notification.c", "cli/cli_shared_methods.c"],
)
