rafalense a4e9947d42 - Added swipe left/right to change between tabs
- Added option to enable/disable infinite swipe between tabs
- Added new menu Plus and moved there all additional Plus features
- Added option to show/hide direct share button in any chat
- Added switch to use direct share without quoting sender
- Added date indicator toast in chat
- Added current download/upload size in chat screen
- Added sort options (default/unread) to all tabs
- Added different options in groups/supergroups for admins when user avatar is clicked in chat screen: ‘Show profile’, ‘Delete from group’ and ‘Set as admin’
- Added option to remove from admin list if user is already an admin
- Added ‘Mark as read’ for individual chats and ‘Mark all as read’ for every tab
- Added option in Plus settings to show username instead of mobile number in menu
- Bug fixes
2016-02-25 10:36:58 +01:00

62 lines
1.7 KiB
C

#include <stdio.h>
#include <string.h>
#include <jni.h>
#include <sys/types.h>
#include <inttypes.h>
#include <stdlib.h>
#include <openssl/aes.h>
#include "utils.h"
#include "sqlite.h"
#include "image.h"
int registerNativeTgNetFunctions(JavaVM *vm, JNIEnv *env);
int gifvideoOnJNILoad(JavaVM *vm, JNIEnv *env);
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
JNIEnv *env = 0;
srand(time(NULL));
if ((*vm)->GetEnv(vm, (void **) &env, JNI_VERSION_1_6) != JNI_OK) {
return -1;
}
if (sqliteOnJNILoad(vm, reserved, env) == -1) {
return -1;
}
if (imageOnJNILoad(vm, reserved, env) == -1) {
return -1;
}
if (gifvideoOnJNILoad(vm, env) == -1) {
return -1;
}
if (registerNativeTgNetFunctions(vm, env) != JNI_TRUE) {
return -1;
}
return JNI_VERSION_1_6;
}
void JNI_OnUnload(JavaVM *vm, void *reserved) {
}
JNIEXPORT void Java_org_telegram_messenger_Utilities_aesIgeEncryption(JNIEnv *env, jclass class, jobject buffer, jbyteArray key, jbyteArray iv, jboolean encrypt, int offset, int length) {
jbyte *what = (*env)->GetDirectBufferAddress(env, buffer) + offset;
unsigned char *keyBuff = (unsigned char *)(*env)->GetByteArrayElements(env, key, NULL);
unsigned char *ivBuff = (unsigned char *)(*env)->GetByteArrayElements(env, iv, NULL);
AES_KEY akey;
if (!encrypt) {
AES_set_decrypt_key(keyBuff, 32 * 8, &akey);
AES_ige_encrypt(what, what, length, &akey, ivBuff, AES_DECRYPT);
} else {
AES_set_encrypt_key(keyBuff, 32 * 8, &akey);
AES_ige_encrypt(what, what, length, &akey, ivBuff, AES_ENCRYPT);
}
(*env)->ReleaseByteArrayElements(env, key, keyBuff, JNI_ABORT);
(*env)->ReleaseByteArrayElements(env, iv, ivBuff, 0);
}