title: Get app signature hash code in jni
body: <p>i want to get app signature in native with these code: (<a href="http://www.programering.com/a/MjN4QzNwATc.html" rel="nofollow">source</a>)</p>
  
  <pre><code>// For class Context
      jclass native_clazz = (*env)-&gt;GetObjectClass(env, context);
  
      // Get the getPackageManager method ID
      jmethodID methodID_func = (*env)-&gt;GetMethodID(env, native_clazz,
              "getPackageManager", "()Landroid/content/pm/PackageManager;");
  
      // Access manager application package
      jobject package_manager = (*env)-&gt;CallObjectMethod(env, thiz, methodID_func);
  
      // For class PackageManager
      jclass pm_clazz = (*env)-&gt;GetObjectClass(env, package_manager);
  
      // Get the getPackageInfo method ID
      jmethodID methodID_pm = (*env)-&gt;GetMethodID(env, pm_clazz,
              "getPackageInfo", "(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;");
  
      // To obtain the application package information
      jobject package_info = (*env)-&gt;CallObjectMethod(env, package_manager,
              methodID_pm, (*env)-&gt;NewStringUTF(env, "com.example.hellojni"), 64);
  </code></pre>
  
  <p>but i got this: </p>
  
  <pre><code>error: 'context' undeclared (first use in this function)
  </code></pre>
  
  <p>how do i get context in native? 
  how do i return signature hashcode as string?</p>