Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Authenticator to v5.0.0 #147

Closed
wants to merge 3 commits into from
Closed

Updated Authenticator to v5.0.0 #147

wants to merge 3 commits into from

Conversation

akopachov
Copy link
Contributor

Application Submission

Updated Authenticator app to v5.0.0

Extra Requirements

Authenticator CLI was extracted into separate FAL plugins which are getting loaded on demand. So please make sure that your bundles and installers do care about putting not just FAP but also all the FAL files when app is installing to the device

Author Checklist (Fill this out)

Reviewer Checklist (Don't fill this out)

  • Bundle is valid
  • There are no obvious issues with the source code
  • I've ran this application and verified its functionality

@hedger
Copy link
Member

hedger commented Sep 14, 2023

Unfortunately, at the moment .fals are not supported by app delivery system.

@akopachov
Copy link
Contributor Author

Is it planned to implement?

@hedger
Copy link
Member

hedger commented Sep 14, 2023

Yes, in long-term plans.

@akopachov
Copy link
Contributor Author

akopachov commented Sep 14, 2023

Okay, how would you like this PR to be handled?

  • Leave it here open until FAL support arrives?
  • Close PR, open issue and open new PR when FAL support arrives?
  • Any other way?

@hedger
Copy link
Member

hedger commented Sep 14, 2023

We'll come back after discussing that later today.

@hedger
Copy link
Member

hedger commented Sep 14, 2023

OK - so we decided to add an option to the build system to allow packaging .fal files as resources, in order to keep current app distribution scheme in form of a single file.

That will require some changes on apps' side - .fals that are packaged that way will be extracted to apps_assets.

Build system changes are in the works.

@akopachov
Copy link
Contributor Author

So just to make sure I understand correctly:

  • OFW catalog build & deploy pipeline will pack FAL files into FAP and then they will be extracted into apps_assets/plugins/
  • ./fbt launch APPSRC=totp still will be deploying FAL files independently to apps_data/totp/plugins/?

@hedger
Copy link
Member

hedger commented Sep 14, 2023

Nope. Plugins will be getting a new fal_embedded manifest option, which will make the build system embed that plugin into assets of parent app(s). It will work that way for all methods of building and launching the application.

@hedger
Copy link
Member

hedger commented Sep 14, 2023

Please check out the initial implementation of the feature in flipperdevices/flipperzero-firmware#3083

tldr: mark your plugins with fal_embedded=True

@akopachov
Copy link
Contributor Author

Thanks for the implementation.
Is there any way to identify at compile time (via #ifdef or so) whether fal_embedded is enabled\supported or not? Just want to update the code in such a way that it will try to load plugins from apps_assets if fal_embedded was enabled and supported by build pipeline, or from apps_data if fal_embedded was turned off or not supported by build pipeline.

@hedger
Copy link
Member

hedger commented Sep 15, 2023

Nope, we are expecting all firmware versions to maintain same set of basic build system capabilities.

@hedger
Copy link
Member

hedger commented Sep 15, 2023

I understand that you have already developed an advanced scripting system around full firmware sources for building your app - but, I suggest you switch to ufbt and using SDKs for different firmwares. That would reduce complexity of your builds, provide significant speed-ups and make them easier to maintain.

If you need any extra features from the build system, feel free to request them.

@akopachov
Copy link
Contributor Author

akopachov commented Sep 15, 2023

I was thinking about switching to uFBT, but what was really stopped me is that it was pretty unclear from uFBT docs how to:

  1. Use uFBT to build an app using custom firmware (let's be honest - there are custom firmwares, app is compatible with their extended API, so I'd like to be able to have a builds specifically for that firmwares too)
  2. How to do global defines (something like -DFEATURE or -DFEATURE=2)

So I just postponed it for some time. If you have some good examples or good explanations how to achieve two goals above - I'm all in to move to uFBT and actually simplify my custom build scripts

@hedger
Copy link
Member

hedger commented Sep 15, 2023

  1. uFBT can download SDKs from various sources - direct links or using indexers compatible with the one official firmware uses, like Unleashed does. Check out this section for details.

  2. Some time ago, we introduced global defines for firmwares that include their identity - FW_ORIGIN_*. For example, official firmware defines FW_ORIGIN_Official, Unleashed has FW_ORIGIN_Unleashed, etc. That feature was intended for replacing user-defined feature flags. Hope that satisfies your needs.

@akopachov
Copy link
Contributor Author

Yeah, it does help. Will try again with uFBT and will definitely come back if any questions. Thanks

@akopachov
Copy link
Contributor Author

May I request a few help\clarification here?

  • I migrated all the build stuff to uFBT (and it is working pretty good)
  • I added fal_embedded=True to all the plugins
  • When trying to build&launch an app using uFBT it fails with weird issue scons: *** [C:\Users\alexk\.ufbt\build\totp.fap] TypeError : Tried to lookup Dir 'C:\Workspace\Projects\flipper-zero_authenticator\totp\assets\cli\cli' as a File.

Attaching buildlog.txt

@akopachov akopachov closed this Sep 28, 2023
@akopachov akopachov deleted the totp_v5.0 branch September 28, 2023 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants