B4J Question How to decompile your own library for B4X?

ThRuST

Well-Known Member
Licensed User
Longtime User
As the headline says, how to decompile a library created for B4X? In this case B4J, if it might differ. I want to retrieve the source code from a library.
 
Last edited:

keirS

Well-Known Member
Licensed User
Longtime User
As a courtesy I would PM the developer and ask if it's possible to have the source code. It's common courtesy to do so. Depending on the licence the developer may not allow decompiling. There are many decompilers for Java; I have used JD-GUI in the past.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@keirS Indeed. I even put this question up to help @DonManfred get his source code back from his jToggleSwitch library.
Because I asked a question if he could update his library to meet the standards of the new Java v11, but only the library remains.
With respect to the original author or a library it should of course be used for learning, and not distributed without the permission of the author.
Well said, right?
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
Actually I've been thinking about this for quite some time now, that everybodys code snippets are the owned property of each author.
And it will so remain until everybody attach a UNLICENSE notification together with the files or source code. But nobody does this.
A new thread might be posted to discuss this further, even though it seems relevant to this thread it should go into the discussions thread.
So advice how to decompile is more related to the technical part in this thread, then we leave morals and rules out for now
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I think the best thing is to create a CustomView with the Switch you need.

It is not complicated, indeed easier to decompile and modify.
At most it will take 15 minutes, especially if you use XUI.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@Star-Dust It would be nice to see an example. You might want to post it in my new B4J question about how to make a Switch button.
It will be more relevant for people to find it in the right thread I mean. I'd love to see a simple source code example in there that I can play with
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User

Actually not so.

https://www.b4x.com/android/forum/threads/important-notice-about-libraries-license.12556/#content

All libraries posted by forum members unless otherwise stated are released under the creative commons licence. Creative commons is highly permissive so in theory decompiling and modifying the source code and redistributing it is OK if no other licence is mentioned. The core libraries released with each B4X product are covered in the T&C's of that product.

I am not sure how many library developers realize this is the case though as it's a very old post and not stickied.
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@keirS Thanks do you mind posting your answer in this general discussion I started. It will be relevant to all programmers not only B4J Go here
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User
You are not allowed to decompile libraries unless you have explicit permission from the library author.

Could do with some clarity in exactly what the default license is then where developers contribute libraries. Because what you are saying now is not what the creative commons license says.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. I'm not sure that you are correct.
2. Don't forget that the library author most probably never seen this post and I'm not sure at all that you can say that this post applies to all third party libraries.
3. This is not the place for legal discussions.

Lets all use common sense. If a library author decided not to post the source code then you are expected not to decompile it without the developer approval. I think that this is the minimum respect that members should give to other developers.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I did see the post. If i still had the source i have published it already.
As i lost the source with the hdd crash i am fine with decompiling the lib.

Though i guess it is easier to build a new wrap than to change the decompiled source...
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
I did see the post. If i still had the source i have published it already.
As i lost the source with the hdd crash i am fine with decompiling the lib.

Though i guess it is easier to build a new wrap than to change the decompiled source...
It's what I said before, it's easier and much faster to create a new one with XUI to decompile and edit.
If one is able to decompile and modify as much as he could do it again.
I do not understand the insistence on decompiling another's work, with or without permission of the author for something so simple
 
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
The main reason I posted this question is because to decompile a library you created yourself, and lost the source module. So when the library files only exist there might be a technical way to get it back. If I had specified that as "my library" in the headline the moral ramblings would not be relevant to this tread. That's why I posted a new question in the general discussion about terms of LICENSE and UNLICENSE. Moral and law issues has nothing to do with this tread. Please post a new question to continue that. I mentioned I posted this question to help Don Manfred in the first place, since I felt sorry that he couldn't update his nice library. It turned out that me and Steve05 created a new toggleswich that can be found >here<
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
My observation is not moral, but technical.
All the time you wasted writing and explaining this post you would have made 3 library. The time you will use to decompile understanding the code and modifying it corresponds to the time you would invite to develop 5 library with XUI.

If you read my post I say that my reasoning is regardless of whether or not you have permission from the author, it is more profitable to realize one from the beginning.
...I do not understand the insistence on decompiling another's work, with or without permission of the author for something so simple

The legal moral question does not have relevance to your question but has relevance to others who respond.

As you know it is not mandatory for other users to answer your question. If before answering your question, explaining how to reverse engineer a library, they want to make sure that both morally and legally is correct, I think that their faculty, by virtue of the fact that they are not obliged to answer you
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…