How to build AES Crypt for Android shared Library ( JNI )

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
iSgomm
Posts: 4
Joined: Thu Oct 31, 2013 2:58 pm

How to build AES Crypt for Android shared Library ( JNI )

Post by iSgomm »

Hi,
now i am using MAC OSX MAVERICK and I'm trying to create a shared library within an Android project in eclipse to use it via JNI calls, but
when I execute the build command (ndk-build) I receive the following error:

Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile thumb : AESCrypt <= libAESCrypt.c
Compile thumb : AESCrypt <= aes.c
Compile thumb : AESCrypt <= aescrypt.c
jni/aescrypt.c:30:34: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/AESCrypt/aescrypt.o] Error 1

I upload Eclipse ADT project.

Can someone help me?
Greetings
Attachments
test.aes.zip
(1.25 MiB) Downloaded 387 times
User avatar
paulej
Posts: 566
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: How to build AES Crypt for Android shared Library ( JNI

Post by paulej »

It sounds like iconv() is not supported on Android. Just get rid of that and change the code to convert the input format for passwords into UTF16-LE.
iSgomm
Posts: 4
Joined: Thu Oct 31, 2013 2:58 pm

Re: How to build AES Crypt for Android shared Library ( JNI

Post by iSgomm »

Thanks for the reply.
But I do not know how to change the source code to convert the input format for passwords into UTF16-LE.
I attach source of eclipse project of AESCrypt, can you help me ?
Many, many thanks....
Greeting
User avatar
paulej
Posts: 566
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: How to build AES Crypt for Android shared Library ( JNI

Post by paulej »

What format is the text in when enteref into Android? It might already be UTF-16LE, in which case no conservation is even needed.

If no conversion is needed, you can just remove the call to iconv(). If conversion is needed, you just need to know the input character encoding used. The conversion process is surely you something you can handle if you're building this kind of app.

BTW, are you aware that there is already a port of AES Crypt to android? Source is not available, other than the same source you are using. Nonetheless, there is already one tool.
iSgomm
Posts: 4
Joined: Thu Oct 31, 2013 2:58 pm

Re: How to build AES Crypt for Android shared Library ( JNI

Post by iSgomm »

The text that I enter in the Android consists of ASCII characters without any special coding.
I try to remove the function iconv() let's see what happens .....

Could you tell me where I ported to Android AESCrypt.
Many thanks
User avatar
paulej
Posts: 566
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: How to build AES Crypt for Android shared Library ( JNI

Post by paulej »

I'm not referring to the characters you enter. Rather, I'm referring to the character encoding used by Android. Based on this page, UTF-8 is the default encoding: http://developer.android.com/reference/ ... arset.html.

AES Crypt passwords need to be in UTF-16LE format. So, it might be possible to use this method to perform the conversion. Our, it might be possible to just change the default encoding to be UTF-16LE. No BOM is present in password strings.

You might also be able to call this function if the password is in a strong class: http://download.oracle.com/javase/6/doc ... .String%29
iSgomm
Posts: 4
Joined: Thu Oct 31, 2013 2:58 pm

Re: How to build AES Crypt for Android shared Library ( JNI

Post by iSgomm »

Hi,
thanks for your time and patience.
I modified the C sources eliminating the conversion to UTF-16LE, I modified the java source eliminating the conversion to UTF-16LE, I imported everything into an Android project with JNI, and everything works properly.
I still want to properly test the code making sure that everything works properly
Thanks again, greetings
milewheeler
Posts: 1
Joined: Thu Oct 07, 2021 9:44 am

Re: How to build AES Crypt for Android shared Library ( JNI )

Post by milewheeler »

iSgomm wrote: Thu Oct 31, 2013 3:51 pm Hi,
now i am using MAC OSX MAVERICK and I'm trying to create a shared library within an Android project in eclipse to use it via JNI calls, but
when I execute the build command (ndk-build) I receive the following error:

Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile thumb : AESCrypt <= libAESCrypt.c
Compile thumb : AESCrypt <= aes.c
Compile thumb : AESCrypt <= aescrypt.c
jni/aescrypt.c:30:34: fatal error: iconv.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/AESCrypt/aescrypt.o] Error 1

I upload Eclipse ADT project.

Can someone help me?
Greetings
Hi there can you please check your attachment if is it possible? I know this is an old thread but I think you are still on this forum...thanks...
milewheeler

check this gbwhatsapp apk
Post Reply