title: Anti-debug in android
body: <p>Anyone did the actual android anti-debug check. I know there are things like</p>
  
  <pre><code>IsDebuggerConnected()
  
  boolean isDebuggable = (0 != (getApplicationInfo().flags &amp; ApplicationInfo.FLAG_DEBUGGABLE));
  </code></pre>
  
  <p>I'm looking for something which is like ptrace using NDK or any other mechanism where the handle of the process cannot be debugged by others. Like, a self-debug in diff thread when the application starts which doesnot allow other debugger to get hold of the process.</p>
  
  <p>Any insight on this will be very useful. </p>