如何隐藏蟒蛇code文件和其他相关文件中kivy项目 [英] How to hide python code file and other related files in a kivy project

查看:259
本文介绍了如何隐藏蟒蛇code文件和其他相关文件中kivy项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近发表了关于谷歌在Android应用程序播放Python编写/ Kivy。通常情况下,build.py脚本将包住整个项目文件到它是应用程序包文件夹一个单独的文件夹中。但是,如果我在安装APK后,检查我的手机上这个包的内容,我可以找到在android.txt文件,在。KV / .kv〜文件和。PY〜*的和* 的杓文件。

我的问题是:这是安全的暴露源$ C ​​$ C文件还是有,我在我的项目的编译我失去了一些东西?什么是讨厌我更多的是临时文件*的 .kv〜的.py〜被暴露了整个项目的源代码code。的*

但我要提到的感激和尊重我对Kivy项目和Kivy团队。他们的努力让我构建和发布与Python一个不错的Andr​​oid应用程序,我感到很骄傲。谢谢你这么多Kivy团队。


解决方案

  

我最近发表了关于谷歌在Android应用程序播放Python编写/ Kivy


恭喜。请问这是什么程序?


  

我的问题是:这是安全的暴露源$ C ​​$ C文件还是有,我在我的项目的编译我失去了一些东西?什么是讨厌我更多的是临时文件的 .kv〜和的.py〜被暴露了整个项目的源代码code。


由于TwilightSun解释,其中一些文件是编辑的备份,你可以通过修改buildozer.spec文件或等效的蟒蛇换android的命令,如果使用删除或从APK排除直接。

不过,更普遍的,如果你是严重的混淆你的code你将要采取进一步措施。我不是专家,但可能这将包括像移动你千伏code到Python文件( Builder.load_string ),并用Cython编译整个项目。由此产生的二进制文件将更难比默认情况下,包括蟒蛇.pyo字节code反编译。

I have recently published an Android application on Google Play written in Python/Kivy. Normally the "build.py" script would wrap the whole project files into one single folder that is the application package folder. But if i check the content of this package on my phone after the installation of the apk i can find the "android.txt" file, the ".kv/.kv~" file and the ".py~"*and *"pyo" files.

My question is: is this safe to expose the source code files or is there something that i am missing in the compilation of my project ? What is annoying me more are the temporary files *.kv~ and .py~ that are exposing the whole project source code.*

But i should mention the gratitude and the respect i have for the Kivy project and the Kivy team. Their efforts allowed me to build and publish a nice Android application with Python that i am really proud of. Thank you so much Kivy team.

解决方案

I have recently published an Android application on Google Play written in Python/Kivy

Congratulations. May I ask what app it is?

My question is: is this safe to expose the source code files or is there something that i am missing in the compilation of my project ? What is annoying me more are the temporary files .kv~ and .py~ that are exposing the whole project source code.

As TwilightSun has explained, some of these files are editor backups, which you can remove or exclude from the apk by modifying your buildozer.spec file or the equivalent python-for-android commands if using that directly.

However, more generally, if you are serious about obfuscating your code you will want to take further steps. I'm no expert, but probably this would include things like moving your kv code to a python file (with Builder.load_string) and compiling your whole project with cython. The resulting binaries will be harder to decompile than the python .pyo bytecode that is included by default.

这篇关于如何隐藏蟒蛇code文件和其他相关文件中kivy项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆