About NDK and installation and usage

Source: Internet
Author: User

In

1 ). Add it by yourself: Aygwin

 

2) perform JNI. Import

3) customize

4) JNI

5)

 

/**

* After the android project is released, it is decompiled and cracked to define the Web Service interface address and parameters,

* Therefore, it is necessary to encrypt the transmitted data. Considering the problem of decompilation in Java code, Android NDK is used for the final implementation,

* Uses the NDK to call the encryption algorithm written in C language to generate an MD5 verification code,

* Considering that SO written in C is stolen (SO files are directly referenced into the project), the C language is used to call Java code for caller Identity confirmation.

*/

Static

{

System. loadLibrary ("hello-jni ");

}

Load local

Decompress android-ndk-r5c-windows.zip

Decompress cygwin package.rar

Cygwin

Run

 

 

Set

 

 

Location of the installation program

 

Select only

 

Cygwin

Required

Home

D: \ ndk \ cygwin \ home \ username \. bash_profile (username) two rows below

NDK =/cygdrive/d/android-ndk-r5c-windows/android-ndk-r5c (d)

Export NDK

Home

After installation, add the following two lines to the. bash_profile file under \ cygwin \ etc \ skel \.

NDK =/cygdrive/d/android-ndk-r5c-windows/android-ndk-r5c

Export NDK
Then copy to some reboot

 

Test

Double-click cygwin

$ Cd $ NDK

Display

 

Write

View in D: \ android-ndk-r5c-windows \ android-ndk-r5c \ samples \ hello-jni \ hello-jni.c

Generate

Tttadasdfdsfdsafd @ zjj ~

$ Cd $ NDK

 

Tttadasdfdsfdsafd @ zjj/cygdrive/d/android-ndk-r5c-windows/android-ndk-r5c

$ Cd samples

 

Tttadasdfdsfdsafd @ zjj/cygdrive/d/android-ndk-r5c-windows/android-ndk-r5c/sample

S

$ Cd hello-jni

 

Tttadasdfdsfdsafd @ zjj/cygdrive/d/android-ndk-r5c-windows/android-ndk-r5c/sample

S/hello-jni

$ NDK/ndk-build

Gdbserver: [arm-linux-androideabi-4.4.3] libs/armeabi/gdbserver

Gdbsetup: libs/armeabi/gdb. setup

Compile thumb: hello-jni <= hello-jni.c

SharedLibrary: libhello-jni.so

Install: libhello-jni.so => libs/armeabi/libhello-jni.so

In

Set

 

 

In

 

Use

Protection Code

Code reuse.

C

You can manually allocate memory, such as videos.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.