Skip to content

Conversation

@caballoninja
Copy link
Contributor

@caballoninja caballoninja commented Jan 10, 2025

Docs Checklist

Please ensure you have addressed documentation updates if needed as part of this PR:

  • I have created a separate PR on the sequence docs repository for documentation updates: Link to docs PR
  • No documentation update is needed for this change.

@caballoninja caballoninja requested a review from a team January 10, 2025 11:28
@caballoninja caballoninja requested a review from a team as a code owner January 10, 2025 11:28
Copy link
Contributor

@BellringerQuinn BellringerQuinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding a few things to make an easier onboarding experience for integrators. Let's hold off on merging for just a touch

…ecorrect name of the library it uses for storage
…e so that if an integrator doesn't want to use secure storage, then they won't need to add a bunch of unnecessary android specific build files (manifests, gradle templates, etc.) in their publishing settings and can just use the Unity defaults. Without the script define, failure to include these will either cause a build failure or an exception on startup when Unity runtime is unable to locate the Java class, whether or not we use the code that tries to access the Java dependancy (if it is in the build, it will throw). Before building, either enable or disable the scripting define based on whether or not we have enabled the secure storage in SequenceConfig.
… running at the end (as you must click to confirm and continue if a build fails
…re-processor define script is being added/removed and that the android key bridge plugin is being enabled/disabled accordingly.
…storage will not work - if not present log a warning and re-direct integrator to our docs. One of these two files are required in order to build, without it, the build will fail - in this case, the warning logs will not appear, so we display a popup to make sure the user sees the warning.
@BellringerQuinn
Copy link
Contributor

@caballoninja check this out, I've added a couple things to make the integration process easier.

Starting with a docs PR (linked above in description). Since adding the custom gradle files are only needed for the secure storage, I've added them there.

I noticed that if the Android Java plugin is present in the project when we try to build, the build will fail if we don't have the custom gradle files. So, I've added a pre-build script that will enable or disable the plugin based on whether or not we have enabled secure storage in SequenceConfig

Then, once we've built the project without the Android Java plugin, we will get an exception at startup. This is because we have code in the project (AndroidKeystoreStorage.cs) that attempts to access it; whether or not this code is reached, it will throw an exception on startup. So, I nested this in a pre-processor directive/scripting define symbol; this is also added/removed by pre-build script based on SequenceConfig

Finally, I've assumed that integrators don't actually read our documentation 😮‍💨; I have a script that will check if you have enabled using custom gradle files (for each of them we need) and will log a warning if you don't so that integrators have more context on why things aren't working and direct them to the docs. Since a failing build will clear the warnings, I also trigger a popup that displays the warnings as well

Sequence_Build_Warnings_and_Demo_-2sequence-unity-Android-Unity_2021_3_6f1_Personal__Personal___Metal

@andygruening andygruening merged commit da85e77 into master Jan 16, 2025
1 check passed
@andygruening andygruening deleted the feature/androidSecureStorage_zemind branch January 16, 2025 12:45
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.

4 participants