Protecting addon code!
#1
Hi,
Is there any way to protect an addon code ?
I know it is not possible to protect python script like a C or C++ by compiling it! and also I know there is near to impossible to protect any code 100%
I only want to make it harder to crack/null/modify it to noob's! that's all.

Thanks a lot Smile
Reply
#2
(2015-11-24, 03:56)sonixax Wrote: Hi,
Is there any way to protect an addon code ?
I know it is not possible to protect python script like a C or C++ by compiling it! and also I know there is near to impossible to protect any code 100%
I only want to make it harder to crack/null/modify it to noob's! that's all.

Thanks a lot Smile

The Kodi project is first and foremost an open-source project, so sharing code, knowledge and being creative is what it's all about.
Reply
#3
I just make my code really horrible to read and really difficult to parse.

Works for me.
Reply
#4
even asking about this shows your utter ignorance of FOSS and what kodi stands for.
If you don't want to adhere to GPL standards, please go elsewhere.
Reply
#5
(2015-11-24, 09:37)wsnipex Wrote: even asking about this shows your utter ignorance of FOSS and what kodi stands for.
If you don't want to adhere to GPL standards, please go elsewhere.

GPL covers 'derived' works while an addon written from scratch is not a 'derivative' work. And if API is copyrightable is a subject to discussion. If we ever have official content plugins for Kodi from providers like Netflix or Amazon, I'm afraid they will be closed source due to DRM.

Personally, I'm completely support open source paradigm, but see noting wrong if someone wants to write a closed source addon due to some reasons, if those reasons are substantial like protecting legally owned copyrighted material/algorithm.
Reply
#6
(2015-11-24, 03:56)sonixax Wrote: Hi,
Is there any way to protect an addon code ?

Obfuscating Python code helps to some degree, but only moving 'protected' code to binary modules guarantees the best (but not absolute) protection. But using binary modules in addons comes for a price - you need to compile binary modules for every hardware/software platform you are going to support, and compiling binary modules for some platforms (like Android) is not a trivial task.

Quote:I know it is not possible to protect python script like a C or C++ by compiling it!

Not quite true. There are Python-C translators like Cython or Nutika that can translate a quite broad subset of Python code into C/C++ code that can then be compiled to binary Python modules. I've tried a simple Cython-produced module with Kodi just out of curiosity, and it worked.

And you can also write binary Python modules using raw Python-C API or helper tools like SWIG or Boost-Python. But again, binary modules need to be compiled for every target platform. They are not universal, like pure Python scripts which are essentially text files and can be executed on every platform that has Python runtime.
Reply
#7
(2015-11-24, 10:06)Roman_V_M Wrote:
(2015-11-24, 09:37)wsnipex Wrote: even asking about this shows your utter ignorance of FOSS and what kodi stands for.
If you don't want to adhere to GPL standards, please go elsewhere.
GPL covers 'derived' works while an addon written from scratch is not a 'derivative' work. And if API is copyrightable is a subject to discussion. If we ever have official content plugins for Kodi from providers like Netflix or Amazon, I'm afraid they will be closed source due to DRM.

Personally, I'm completely support open source paradigm, but see noting wrong if someone wants to write a closed source addon due to some reasons, if those reasons are substantial like protecting legally owned copyrighted material/algorithm.
Not sure what you are talking about but the xbmc* modules are actual programs and licensed under GPL. If you use them, you create derived work; the GPL is pretty clear on this.
Reply
#8
(2015-11-24, 11:39)takoi Wrote: Not sure what you are talking about but the xbmc* modules are actual programs and licensed under GPL. If you use them, you create derived work; the GPL is pretty clear on this.

You cannot "use" xbmc* modules in addons, they are C++ libraries, and GPL applies only if you re-distribute/modify those libraries as C++ code. API calls like

Code:
import xbmc

xbmc.log('Some message')

are not covered by GPL because you do not include C++ code (which is under GPL) in your code.

So you understand: Kodi on Windows uses DirectX API which is proprietary, but it does not make Kodi proprietary. The same is here, using GPL-ed API does not extend GPL to your code, unless you directly incorporate GPL-ed code into your work.
Reply
#9
Nobody knows what a derivate work is. Life itself is a derivate work.Just as all the fruits of life.

5 years ago, a similar discussion (around thesis) was in wordpress camp. Then SFLC and R. Stallmann backed up matt. However, in this community, I see a lot of addons with a different license. And that's with the same SFLC advising XBMC....

But protecting Python addons seems useless either way.
Reply
#10
(2015-11-24, 11:54)Roman_V_M Wrote: You cannot "use" xbmc* modules in addons, they are C++ libraries, and GPL applies only if you re-distribute/modify those libraries as C++ code. API calls like

Code:
import xbmc

xbmc.log('Some message')

are not covered by GPL because you do not include C++ code (which is under GPL) in your code.
I don't know where you get your information from, but to "include C++ code" and "directly incorporate" are not words the GPL use. Linking is, and linking makes derived work. The language something is written in is completely irrelevant.
(2015-11-24, 11:54)Roman_V_M Wrote: So you understand: Kodi on Windows uses DirectX API which is proprietary, but it does not make Kodi proprietary. The same is here, using GPL-ed API does not extend GPL to your code, unless you directly incorporate GPL-ed code into your work.
http://www.gnu.org/licenses/gpl-faq.en.h...yException Not the same things.

And Robotica is right: this has been discussed to death in several other larger gpl projects. Look there.
Reply
#11
(2015-11-24, 09:37)wsnipex Wrote: even asking about this shows your utter ignorance of FOSS and what kodi stands for.
If you don't want to adhere to GPL standards, please go elsewhere.

I do not want to re brand / or re distribute or Modify KODI!!! and after that protect it !!!! I want to protect my own Addon, Which is not published under GPL License! (But it is Free Big Grin)
For example Linux is an open source software under GPL License! but there is lot of proprietary software's for it : https://en.wikipedia.org/wiki/List_of_pr..._for_Linux
I believe it is better you read GPL License again.
Reply
#12
(2015-11-24, 11:39)takoi Wrote: Not sure what you are talking about but the xbmc* modules are actual programs and licensed under GPL. If you use them, you create derived work; the GPL is pretty clear on this.

The intent back when was that the bindings would be LGPL. Not sure if they actually are though. Anyways, GPL doesn't cross barriers like that. The API is written and specified, someone using that API doesn't make it GPL.

If that were the case everything written in Python GPL as Python is GPL Smile And anything using a GPL licensed servers rest api would also be forced to be GPL.

Anyway, on topic. The only way to close off python is to either link to pyc files, or link to shared libraries. Both of these are terrible for multi platform work and just opens up a heap of troubles for you. It is possible but rarely worth the effort IMO.

If your doing work for a company providing content, say something like netflix, then your protecting the code because you want the content secure, which IMO, should be handled on the servers (which is completely possible).

In short, unless you have a damn good reason (most aren't) for closing it off, just don't. You never know where open source takes you, perhaps 14 people line up to help you. Its easy to vision an awesome app but it takes lots of manhours to complete it, those 14 people might be extremely valuable and not possible without Smile
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#13
(2015-11-24, 13:09)takoi Wrote: I don't know where you get your information from, but to "include C++ code" and "directly incorporate" are not words the GPL use. Linking is, and linking makes derived work. The language something is written in is completely irrelevant.

I don't know where you get your information from, but there is no such thing as "linking" in Python. Technically, every addon is absolutely independent and can be run without Kodi with no internal changes. You just need to stub/mock Kodi API calls. And, as it said above, API is not covered by GPL, otherwise you would not be able to develop, for example, proprietary software for Linux or proprietary Python programs that surely do exist.
Reply
#14
(2015-11-25, 08:58)topfs2 Wrote: The intent back when was that the bindings would be LGPL. Not sure if they actually are though. Anyways, GPL doesn't cross barriers like that. The API is written and specified, someone using that API doesn't make it GPL.

If that were the case everything written in Python GPL as Python is GPL Smile And anything using a GPL licensed servers rest api would also be forced to be GPL.
You are missing the point. I'm not talking about the API, I'm talking about kodi, the program. Nobody is saying "using an API" makes it GPL, but using gpl libraries does. Every library also defines an API, so if you call that just "using an API", by that logic it's impossible to apply GPL to a library.

And linking creates derivative work, communicating over http does not. Completely different. It's spelled out if the faq: http://www.gnu.org/licenses/gpl-faq.en.h...ggregation

(2015-11-25, 09:43)Roman_V_M Wrote: I don't know where you get your information from, but there is no such thing as "linking" in Python. Technically, every addon is absolutely independent and can be run without Kodi with no internal changes. You just need to stub/mock Kodi API calls. And, as it said above, API is not covered by GPL, otherwise you would not be able to develop, for example, proprietary software for Linux or proprietary Python programs that surely do exist.
It's the same as dynamic linking. When you make use of a library (I repeat: "library". Stop saying "API") you make a combined work. The lgpl was created specifically to allow this, but the gpl does not. This is widely understood in the python community. See the pyqt case for instance.

And I already said above, the 'example' you mention is explicitly excepted: http://www.gnu.org/licenses/gpl-faq.en.h...yException Therefore, proprietary software for Linux possible.
Reply
#15
It depens how Kodi invokes its plugins and addon if they should be considered as derivative work and thus make the GPL license transfered or not, just read:

http://www.gnu.org/licenses/gpl-faq.html#GPLAndPlugins

"QUESTION: If I write a plug-in to use with a GPL-covered program, what requirements does that impose on the licenses I can use for distributing my plug-in?

ANSWER: It depends on how the program invokes its plug-ins. If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them.

If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means you must license the plug-in under the GPL or a GPL-compatible free software license and distribute it with source code in a GPL-compliant way.

If the program dynamically links plug-ins, but the communication between them is limited to invoking the ‘main’ function of the plug-in with some options and waiting for it to return, that is a borderline case
. "
Reply

Logout Mark Read Team Forum Stats Members Help
Protecting addon code!0