HISE Logo Forum
    • Categories
    • Register
    • Login

    Simple copy protection done right :)

    Scheduled Pinned Locked Moved Presets / Scripts / Ideas
    151 Posts 25 Posters 17.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Christoph HartC
      Christoph Hart
      last edited by

      @gorangrooves said in Simple copy protection done right :):

      Serials.js remains with the same codes and nothing new is added. I get no warning or errors.

      Have you tried deleting the old js file? Maybe it can't overwrite an existing file...

      gorangroovesG 1 Reply Last reply Reply Quote 0
      • gorangroovesG
        gorangrooves @Christoph Hart
        last edited by gorangrooves

        @Christoph-Hart I tried only renaming the actual file to "serials.js" (lower case s) to see if it would write a new js file, but it didn't. It only threw an error message that the original Serials.js was missing. It was the copy protection code part of the script that threw the error.

        Should I delete the existing data from the Serials.js?

        BTW I can edit the js file within HISE, when I open it as one of the scripts. So, it is able to write to it.

        Goran Rista
        https://gorangrooves.com

        Handy Drums and Handy Grooves
        https://library.gorangrooves.com

        1 Reply Last reply Reply Quote 0
        • gorangroovesG
          gorangrooves
          last edited by

          @Christoph-Hart I commented out the copy protection script so that I could delete data from Serials.js and that didn't do the trick. I deleted the js file completely and that didn't do the trick either. The script is not generating a js file.

          Goran Rista
          https://gorangrooves.com

          Handy Drums and Handy Grooves
          https://library.gorangrooves.com

          gorangroovesG 1 Reply Last reply Reply Quote 0
          • gorangroovesG
            gorangrooves @gorangrooves
            last edited by

            @Christoph-Hart @dustbro After reading the manual on GitHub, I realized that the file is being generated in the root folder of the project. Now I understand what you were referring to, dustbro.
            @yall Check out the root folder of your project and not the Scripts folder for the Serials.js generated by the script.

            Goran Rista
            https://gorangrooves.com

            Handy Drums and Handy Grooves
            https://library.gorangrooves.com

            1 Reply Last reply Reply Quote 0
            • NatanN
              Natan @Dan Korneff
              last edited by Natan

              @dustbro said in Simple copy protection done right :):

              @gorangrooves The "Serial Generator" does this for you. Just uncomment the last line to run this function.

              /** This namespace contains the logic to create a new list of serials. 
                  
                  Feel free to remove this when not needed. */
              namespace SerialGenerator
              {
                  inline function getNewRandomChar()
                  {
                      // ASCII, fuck yeah!
                      local a = String.fromCharCode(Math.randInt(65, 90));
                      local b = String.fromCharCode(Math.randInt(48, 57));
                  
                      return Math.random() > 0.5 ? a : b;
                  }
              
                  inline function createNewSerial()
                  {
                      local s = "";
                  
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += "-";
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += "-";
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += "-";
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                      s += getNewRandomChar();
                  
                      return s;
                  }
              
                  const var NUM_SERIALS = 1000;
              
                  inline function createNewSerials()
                  {
                      local d = [];
                      d.reserve(NUM_SERIALS);
                  
                      for(i = 0; i < NUM_SERIALS; i++)
                      {
                          d.push(createNewSerial());
                      }
                  
                      local obj = { "Data": d };
                  
                      Engine.dumpAsJSON(obj, "../Serials.js");
                  }
              
                  // Uncomment this line to regenerate serials.
                  //createNewSerials();
              }
              

              I'm Trying To Add A Fixed 4 Digit Name To The Generated Codes, Like:
              "HISE-X44A-6SP4-82AS"
              "HISE-X0IR-Y022-O14Q"
              "HISE-G726-S0GR-C073"

              Any Help?

              NatanN 1 Reply Last reply Reply Quote 0
              • NatanN
                Natan @Natan
                last edited by

                @Natan But EveryTime I Get undefinedundefinedundefinedundefined :) LOL

                1 Reply Last reply Reply Quote 0
                • NatanN
                  Natan
                  last edited by

                  Okey, I Managed To Find My Way With This :)

                  In Case Anyone Wants To Generate Serial Codes With 4 Fixed Digits At First, Check This Out

                  /** This namespace contains the logic to create a new list of serials. 
                      
                      Feel free to remove this when not needed. */
                  namespace SerialGenerator
                  {
                      inline function getNewRandomChar()
                      {
                          // ASCII, fuck yeah!
                          local a = String.fromCharCode(Math.randInt(65, 90));
                          local b = String.fromCharCode(Math.randInt(48, 57));
                          
                          return Math.random() > 0.5 ? a : b;
                      }
                  
                      inline function createNewSerial()
                      {
                          local s = "HISE-";   /// Change This With Whatever You Want
                          
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += "-";
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += "-";
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                          s += getNewRandomChar();
                      
                          return s;
                      }
                  
                      const var NUM_SERIALS = 1;
                  
                      inline function createNewSerials()
                      {
                          local d = [];
                          d.reserve(NUM_SERIALS);
                      
                          for(i = 0; i < NUM_SERIALS; i++)
                          {
                              d.push(createNewSerial());
                          }
                      
                          local obj = { "Data": d };
                      
                          Engine.dumpAsJSON(obj, "../Serials.js");
                      }
                  
                      // Uncomment this line to regenerate serials.
                       //createNewSerials();
                  }
                  
                  1 Reply Last reply Reply Quote 1
                  • NatanN
                    Natan
                    last edited by

                    Anyone Has Scripted a Volume Muter And Attached To The Serial Protection?
                    I Need This For Demo Purpose! So Users Can Use The demo And Register It Anytime They Get A Serial Number.

                    Thank You

                    LindonL 1 Reply Last reply Reply Quote 0
                    • LindonL
                      Lindon @Natan
                      last edited by

                      @Natan said in Simple copy protection done right :):

                      Anyone Has Scripted a Volume Muter And Attached To The Serial Protection?
                      I Need This For Demo Purpose! So Users Can Use The demo And Register It Anytime They Get A Serial Number.

                      Thank You

                      yes its pretty easy to do - replace the MIDI Muter with a simple gain in the master effect chain (lets call it MuterGain). Set its gain level to -100dB, bypass it, and then in your authorisation refer to it instead of the midi muter.

                      HISE Development for hire.
                      www.channelrobot.com

                      1 Reply Last reply Reply Quote 0
                      • S
                        Sawer
                        last edited by

                        Is it normal that every time I open the plugin, it asking me to insert the serial key. Is there any solution so that after the first time, this won’t happen again? Thanks

                        ? ulrikU 2 Replies Last reply Reply Quote 0
                        • ?
                          A Former User @Sawer
                          last edited by A Former User

                          @nesta99 As far as I can tell that is not normal. I implemented this into our plugin just recently and I see that it checks for the serial in the console. It creates a file called RegistrationInfo.js in the plugin root folder (or app data folder in the compiled plugin) and stores the serial in there upon successful registration. So that file should hold your entered serial number! The script should see that running the checkOnLoad() function. Maybe check if that function is alright and not tampered with... 😉 Go check the read.me file as well...

                          1 Reply Last reply Reply Quote 0
                          • ulrikU
                            ulrik @Sawer
                            last edited by

                            @nesta99 is this happening in a compiled plugin?
                            It sounds like the plugin doesn't save the serial to disk, or to wrong location.
                            What happens in your script when the serial is confirmed?

                            this is where I store the confirmed serial number

                            // Stores the file to the hard drive. In HISE it will be the project folder
                                        // but in the compiled plugin it will use the parent directory to the 
                                        // user preset directory (which is usually the app data folder).
                                        Engine.dumpAsJSON(data, "../RegUdu.js");
                                        
                            

                            Hise Develop branch
                            MacOs 15.3.1, Xcode 16.2
                            http://musikboden.se

                            Y S 2 Replies Last reply Reply Quote 0
                            • Y
                              yall @ulrik
                              last edited by

                              @ulrik normally at the first activation, you have a registration.js file which is created in app data ... which avoids reactivation each time the vst is opened. try to create a note with .... "your license number" and name this file registration.js it should work and from there you may understand the problem

                              ulrikU S 2 Replies Last reply Reply Quote 0
                              • ulrikU
                                ulrik @yall
                                last edited by

                                @yall I know

                                Hise Develop branch
                                MacOs 15.3.1, Xcode 16.2
                                http://musikboden.se

                                1 Reply Last reply Reply Quote 0
                                • S
                                  Sawer
                                  last edited by

                                  Alright Everyone... will check that and try again. Thanks a lot!

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    Sawer @ulrik
                                    last edited by

                                    @ulrik yeah, When I open it on logic pro it happens

                                    S 1 Reply Last reply Reply Quote 0
                                    • S
                                      Sawer @Sawer
                                      last edited by

                                      @nesta99 I think I dont have the Registration.js file. Let me create it

                                      ? 1 Reply Last reply Reply Quote 0
                                      • ?
                                        A Former User @Sawer
                                        last edited by

                                        @nesta99 said in Simple copy protection done right :):

                                        @nesta99 I think I dont have the Registration.js file. Let me create it

                                        It should be created automatically! If it’s not being created I’d venture a guess and say that something with the script isn’t as it should be?!

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          Sawer @A Former User
                                          last edited by

                                          @UrsBollhalder
                                          I’ll send you a snippet then.. thanks

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            Sawer @yall
                                            last edited by

                                            @yall So If I got it Right, should I rename "RegistrationInfo.js" into something else?

                                            ? 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            21

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.6k

                                            Posts