Check encrypted image dimensions across the Android bridge
This commit is contained in:
1 parent
b3e7db7b26
commit
154c76068c
2 files changed
+3
-4
No files matched your search
@@ -66,7 +66,7 @@ static int check_encrypted_attachment(const char* channel, const char* directory
|
||||
snprintf(req->source, sizeof(req->source), "%s", source);
|
||||
snprintf(req->info.name, sizeof(req->info.name), "Секрет | 😀.png");
|
||||
snprintf(req->content_type, sizeof(req->content_type), "image/png");
|
||||
req->info.kind = ATTACHMENT_FILE;
|
||||
req->info.kind = ATTACHMENT_PNG; req->info.width = 1080; req->info.height = 1920;
|
||||
attachment_send_trampoline(req); REQUIRE(wait_result(10) == 1);
|
||||
sqlite3_stmt* st = NULL; uint8_t id[32];
|
||||
REQUIRE(sqlite3_prepare_v2(instance->topo_sqlite_db, "SELECT message_id FROM attachment_keys", -1, &st, NULL) == SQLITE_OK);
|
||||
@@ -78,8 +78,8 @@ static int check_encrypted_attachment(const char* channel, const char* directory
|
||||
REQUIRE(!extract(json, "$[0].contentType", value, sizeof(value)) && !strcmp(value, "image/png"));
|
||||
REQUIRE(!extract(json, "$[0].filePath", value, sizeof(value)) && !access(value, F_OK) && !strstr(value, ".uenc"));
|
||||
REQUIRE(!extract(json, "$[0].fileSize", value, sizeof(value)) && !strcmp(value, "13"));
|
||||
REQUIRE(!extract(json, "$[0].width", value, sizeof(value)) && !strcmp(value, "0"));
|
||||
REQUIRE(!extract(json, "$[0].height", value, sizeof(value)) && !strcmp(value, "0")); u_free(json);
|
||||
REQUIRE(!extract(json, "$[0].width", value, sizeof(value)) && !strcmp(value, "1080"));
|
||||
REQUIRE(!extract(json, "$[0].height", value, sizeof(value)) && !strcmp(value, "1920")); u_free(json);
|
||||
json = utun_bridge_get_channels_json(); REQUIRE(json);
|
||||
REQUIRE(!extract(json, "$[0].lastMsgEncrypted", value, sizeof(value)) && !strcmp(value, "1"));
|
||||
REQUIRE(!strstr(json, ".uenc")); u_free(json);
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.utun.chat.viewmodel
|
||||
import com.utun.chat.R
|
||||
import com.utun.chat.data.AppLanguage
|
||||
import android.content.Context
|
||||
import android.graphics.BitmapFactory
|
||||
import android.media.MediaMetadataRetriever
|
||||
import android.net.Uri
|
||||
import android.util.Log
|
||||
|
||||
Reference in new issue
Block a user