-
Notifications
You must be signed in to change notification settings - Fork 545
Xamarin Android: What does "Bundle assemblies into native code" really mean? #4527
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Personally if you want I'm not sure if this still works but it might help https://devblogs.microsoft.com/xamarin/protecting-xamarin-apps-dotfuscator/. |
Thanks for your answer @dellis1972 Unfortunately since I upgraded my project to AndroidX obfuscation doesn't work anymore, so I was looking for an alternative. See:
|
I'm also getting very confused about this, especially since XF4.5, several serious, showstopper, regression bugs (like xamarin/Xamarin.Forms#9900 and dotnet/android-libraries#64) has surfaced and Xamarin members have since strongly demote the use of My decision to use
So ... now ... with Xamarin members questioning us why use Would really appreciate some detail rather than suggesting that it might be removed in .Net 5 which is some time away |
Good, I agree with you |
Good, I agree with you. |
any new when XF 4.6 was release. I still get error on XF 4.6 |
It means "take all of the assemblies, and instead of leaving them uncompressed as
All of the The assemblies themselves are unchanged (aside from linking/etc.). This is "some" protection, to be fair, but it's not much. |
I have updated the Bundle Assemblies into Native Code documentation, which now reads:
|
Commit d236af5 provides a different take on "minimal levels of obfuscation": it does not obfuscate, but it does:
As such, tools like It is not a security solution. It's a way to get smaller |
Someone might want to get in touch with the VS team to update their gui. |
Hi @jonpryor , I don't have much knowledge on this aspect and hope you could shine some light. When you said:
Do you mean I could simply unzip I tried opening up most of the files inside and they are all in binary. And from my shallow knowledge on this, my understanding is that you could go a step further to reverse-engineer to machine code. So, how to unpack |
|
you can see this SO post. App Bundles does same thing as Bundle into native assemblies. |
@EDMIStephen , thanks for the link. I'll need more time to test it out; but a quick look at it, it seems easy to reverse-engineer My initial understanding of this is all wrong; I thought I've re-read this Xamarin Doc. Some sections in the doc has changed even the date at the very top still is at 2018. There is this line that says:
So, there is never a way in Xamarin to compile and pack apk in native code. Also to take note is that So ... it seems like the only way to protect Xamarin app is with obfuscation. And now I understand why Xamarin members have been diminishing the usefulness of Finally, any best practices to follow to make it harder against reverse-engineering (just in the area of Xamarin)? Is there an option to compile into native code instead of generating the dlls? |
@EmilAlipiev , thanks for the link to the SO post. I'll bring my further discussion in the SO post |
@simon10says |
Let me add an important detail: if you use hybrid AOT the code is stripped away from the .Net assemblies leaving only method stubs neede for relfection, thus achieving very good obfuscation. |
@nexxuno I didn't know that. Thanks for the tip, I'll definitely look into it :) |
@tranb3r , yes ... that's my understanding too. What I meant was finding a mean to compile into native code and does away the dlls that could be so easily reverse-engineered. @nexxuno , it seems like using hybrid AOT does not stripped away code from the assemblies. I came upon this fresh post. I've also verified it with the following configuration and it does not strip away the code from the assemblies: <AotAssemblies>true</AotAssemblies>
<AndroidAotMode>hybrid</AndroidAotMode>
<BundleAssemblies>false</BundleAssemblies>
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
<AndroidLinkMode>Full</AndroidLinkMode>
<AndroidLinkTool>r8</AndroidLinkTool>
<AndroidDexTool>d8</AndroidDexTool> This is my test project - App2.zip |
At the moment I can't test if it stopped working, like stated in your link. What I remember is that I used hybrid aot plus llvm and it was working. |
pfff ... this is getting so tiring and frustrating to get it right |
Yeah. I am having no luck with Hybrid AOT. It doesn't seem to be doing what it says it should. |
Are you able to post which version of VS etc you are using. I am on the latest of everything and tried preview too and it isn't working. In the other bug you mentioned it was not working for you. |
https://docs.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows#protect_app
I searched a lot about this topic but there seems a lot of confusion about what this option really does.
I tried to unpack the "libmonodroid_bundle_app.so" file with this project but it didn't work. https://github.com/AigioL/unpack.libmonodroid_bundle_app.so
I'm looking for basic obfuscation (renamed classes, methods, etc.) for my app.
It seems to me that this option compiles your assemblys to IL code, so your code could possibly be read.
So what can you see if you unpack the "libmonodroid_bundle_app.so" file (codewise)?
The text was updated successfully, but these errors were encountered: