Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revising Offline License Activation #43

Open
nstilt1 opened this issue Aug 1, 2024 · 1 comment
Open

Revising Offline License Activation #43

nstilt1 opened this issue Aug 1, 2024 · 1 comment

Comments

@nstilt1
Copy link
Owner

nstilt1 commented Aug 1, 2024

Offline license activation probably shouldn't involve a 4 character code for the end user to append to their license code because it's kind of silly and could be susceptible to brute force, should someone find out someone else's license code.

The revision I have in mind is requiring the end user to click to enter an "Offline License Activation" menu, where there are two buttons: one for copying their machine ID to the clipboard (or saving a file containing their machine ID to their machine), and a button to activate the license using a key file.

The key file would need to be generated by the store's website, where they will need a form that accepts either a file or a machine ID, and then the website will need to send a request to the license_activation_refactor function using the user's machine ID, and the server will need to append -offline-[4 character offline code] to the end of the license code that is stored for the user. Don't worry, the store should already have access to this value if the user has a license, and if the store has saved their license data in the store's database. The store will also need to sign this request in the same manner that all of the other requests are signed with the store's private key.

@nstilt1
Copy link
Owner Author

nstilt1 commented Aug 26, 2024

This has been partially resolved. Stores that wish to implement offline license activations will have to do implement it. Here is a recap of the required implementation:

Client Side Code (such as JUCE)

A button needs to appear somewhere that says something like Offline Activation. After clicking the button, a menu shows up with two buttons:

  • Export Machine Info
    • This button either copies the machine ID to the clipboard, or it saves a file to the machine with a file saving interface. Preferably, the file will include hardware information if the user checks a checkbox that says Share hardware info?
  • Import Key File
    • This button opens a file picker. For simplicity, it could filter files to look for a file with a specific extension, such as .license or .my_store_key_file. After selecting the key file, it should save it to a location where it can be easily found by the client side code. Review the locations in the client side Rust library for OS-specific locations.

Server-Side Code (such as a PHP WordPress plugin)

A section needs to appear in the user's dashboard called Offline License Activation. This page should have a form that either accepts a text input for the machine ID, or it could include a file upload input. After uploading the file, the backend code needs to format the data so that a license_activation_refactor API call is made using Protobuf format, including the license code that is stored on the server with the -offline-XXXX appended to the end of the license code. The decrypted payload should be saved to the user's machine if the request was successful. The user will then need to select Import Key File in the client.

Client-Side Code (static Rust library)

There may need to be an additional extern "C" function to be added that copies the data from a file into the locally stored license.bin file.

@nstilt1 nstilt1 pinned this issue Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant