使用Unity编译后是否可以读取apk文件脚本?

Is it possible to read an apk files scripts after being compiled with Unity?

在使用 Unity 编译的 Andriod .apk 文件中使用的脚本是否被认为是安全的?

我一直在努力解决的问题是,如果我编译 .apk 文件,任何人都可以再次反编译它以阅读我用 c# 编写的脚本,即使它只是机器代码我不认为它安全。

Is it possible to read an apk files scripts after being compiled with Unity?

是的,这是可能的,而且很容易做到。您可以通过将 "Scripting Backend" 更改为 IL2CPP 来增加阅读脚本的难度。您也可以使用 Gradle。 post shows how to use a custom Gradle in Unity. You can find how to enable minify on Gradle with Proguard here。这向您展示了 Gradle 应该是什么样子。

请注意,这些不会阻止人们阅读或更改您的代码。这样做只会让事情变得更难..