I have developed an android library this is for private usage. I want to distribute it to one of my client and also I have to prevent redistribution of the package by the client. I can use AWS codeArtifact or jfrog for private distribution but here the redistribution cannot be prevented as the client can share those details to others as well. So my question is how can I distribute it to my multiple clients preventing redistribution of my library?
Asked
Active
Viewed 220 times
0
-
"I want to distribute it to one of my client and also I have to prevent redistribution of the package by the client" -- that is not possible. Your library is a file. Files can be copied. – CommonsWare Jul 26 '22 at 11:05
2 Answers
0
Restricting the access to the IP address of the client's device in the IAM policies seems the only possible way.

Msvstl
- 1,116
- 5
- 21
0
There might be two different options here, you can try according to your requirement.
- You can create your own public maven repository, hosting that yourself, with password protection and share the credentials with only specific client. Then other people people will not be able to use your library.
Client will require to include your repository in their root gradle file, like below.
maven { credentials { username 'USER_NAME' password 'PASSWORD' } url "http://repo.whateveryounameit.com/repo-maven" content { // this repository only contains artifacts with group "com.something." includeGroupByRegex "com.something." } } }
- Another option might be to introduce some API_KEY and check that api key inside your library code, if not matched then through some run time exception. Then share your API_KEY only with specific client. Though in this case, if client shares the API_KEY with others then, they will be able to use your library. It depends what sort of license you have for your clients to use your library may be.