user32277: For some reasons of security, I created library for everybody to use, but I don't want people change my library, cause it make device not work. I search around but still not working. Do I need to set password for library or make it unreadable or make it can not modify or another way that you can give the direction ?
P/s: Think like a hacker, I can change library and make an attack to the server from library.

user10794: No, you can't do that. How could a library work if it is unreadable?
If you don't want people changing it, don't publish it.
If you publish it you could put a disclaimer on it:

If you change my library, it may stop working.


(Added to question two days later)

P/s: Think like a hacker, I can change library and make an attack to the server from library.

Yes, but, if you distribute the original library, then someone would have to download it, change it, and then attack themselves with it!
And if your library does something to do with servers (you haven't said what your library does) then someone could make a similar library, and build the attack code into that. Hacking your particular one wouldn't be required.
My other issue is: If your library is a secret, that is, I can't read its source code, then I might presume that your library is where the hack is. At least if people get the source code they can read it and check it.

user4143: Later versions of the IDE have the ability to use pre-compiled libraries.  This means that the end user only gets the compiled version of your library (a .a file) rather than the source code.
Modify your library.properties file to include dot_a_linkage=true. If you don't have a library.properties file you need to make sure you create your library in 1.5.x format.
Then compile your library in the normal way. This will result in a .a file somewhere in the build  tree which gets linked with your sketch.  You need to grab that .a file.
Next make a new copy of your library that has just the header file (needed for compilation) and the .a file (needed for linking). No .cpp files.
Now you in the new library.properties file you add precompiled=true.
As long as you lay out the files right it should now compile using the precompiled .a file.
You can read more about the library.properties contents here.

32277: <p>For some reasons of security, I created library for everybody to use, but I don't want people change my library, cause it make device not work. I search around but still not working. Do I need to set password for library or make it unreadable or make it can not modify or another way that you can give the direction ?</p>

<p>P/s: Think like a hacker, I can change library and make an attack to the server from library.</p>
 10794: <p>No, you can't do that. How could a library work if it is unreadable?</p>

<p>If you don't want people changing it, don't publish it.</p>

<p>If you publish it you could put a disclaimer on it:</p>

<blockquote>
  <p>If you change my library, it may stop working.</p>
</blockquote>

<hr>

<p><strong>(Added to question two days later)</strong></p>

<blockquote>
  <p>P/s: Think like a hacker, I can change library and make an attack to the server from library.</p>
</blockquote>

<p>Yes, but, if you distribute the original library, then someone would have to download it, change it, and then attack themselves with it!</p>

<p>And if your library does something to do with servers (you haven't said <em>what</em> your library does) then someone could make a similar library, and build the attack code into that. Hacking your particular one wouldn't be required.</p>

<p>My other issue is: If your library is a secret, that is, I can't read its source code, then I might presume that <em>your</em> library is where the hack is. At least if people get the source code they can read it and check it.</p>
 4143: <p>Later versions of the IDE have the ability to use pre-compiled libraries.  This means that the end user only gets the compiled version of your library (a <code>.a</code> file) rather than the source code.</p>

<p>Modify your <code>library.properties</code> file to include <code>dot_a_linkage=true</code>. If you don't have a <code>library.properties</code> file you need to make sure you create your library in 1.5.x format.</p>

<p>Then compile your library in the normal way. This will result in a <code>.a</code> file somewhere in the build  tree which gets linked with your sketch.  You need to grab that <code>.a</code> file.</p>

<p>Next make a new copy of your library that has just the header file (needed for compilation) and the <code>.a</code> file (needed for linking). No <code>.cpp</code> files.</p>

<p>Now you in the new <code>library.properties</code> file you add <code>precompiled=true</code>.</p>

<p>As long as you lay out the files right it should now compile using the precompiled <code>.a</code> file.</p>

<p>You can read more about the <code>library.properties</code> contents <a href="https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification" rel="nofollow noreferrer">here</a>.</p>
