Skip to content

Commit 8ac772e

Browse files
committed
set larger incoming file size limit
1 parent 7c1de8b commit 8ac772e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/MainActivity.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
import static com.zoffcc.applications.trifa.TRIFAGlobals.LOWER_GLOBAL_VIDEO_BITRATE;
239239
import static com.zoffcc.applications.trifa.TRIFAGlobals.LOWER_NGC_VIDEO_BITRATE;
240240
import static com.zoffcc.applications.trifa.TRIFAGlobals.LOWER_NGC_VIDEO_QUANTIZER;
241+
import static com.zoffcc.applications.trifa.TRIFAGlobals.MAX_ALLOWED_INCOMING_FILESIZE_BYTES;
241242
import static com.zoffcc.applications.trifa.TRIFAGlobals.MESSAGE_GROUP_SYNC_DOUBLE_INTERVAL_SECS;
242243
import static com.zoffcc.applications.trifa.TRIFAGlobals.MESSAGE_SYNC_DOUBLE_INTERVAL_SECS;
243244
import static com.zoffcc.applications.trifa.TRIFAGlobals.NGC_AUDIO_BITRATE;
@@ -7152,8 +7153,9 @@ else if (ft.kind == TOX_FILE_KIND_FTV2.value)
71527153

71537154
static void android_tox_callback_file_recv_cb_method(long friend_number, long file_number, int a_TOX_FILE_KIND, long file_size, String filename, long filename_length)
71547155
{
7155-
// HINT: IOCipher can only handle files up to 2GBytes in size
7156-
if (file_size >= ((UINT32_MAX_JAVA / 2L) - 1L))
7156+
// HINT: ~~IOCipher can only handle files up to 2GBytes in size~~
7157+
// ^^^ this is no longer true!!
7158+
if (file_size >= MAX_ALLOWED_INCOMING_FILESIZE_BYTES)
71577159
{
71587160
try
71597161
{
@@ -7164,7 +7166,7 @@ static void android_tox_callback_file_recv_cb_method(long friend_number, long fi
71647166
e.printStackTrace();
71657167
}
71667168

7167-
display_toast(context_s.getString(R.string.incoming_filetransfer_size_too_large), false, 800);
7169+
display_toast("Incoming file is too large", false, 800);
71687170
return;
71697171
}
71707172

android-refimpl-app/app/src/main/java/com/zoffcc/applications/trifa/TRIFAGlobals.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public class TRIFAGlobals
9191
public static final int FAB_SCROLL_TO_BOTTOM_FADEIN_MS = 200;
9292

9393
public static final long UINT32_MAX_JAVA = 4294967295L; // 0xffffffff == UINT32_MAX
94+
public static final long MiByte_BYTES = (1014 * 1024);
95+
public static final long MAX_ALLOWED_INCOMING_FILESIZE_BYTES = 10 * 1024 * MiByte_BYTES; // 10 GiBytes max incoming files !
9496
/*
9597
// HINT: java does NOT have an unsigned 64 bit number!
9698
public static final long UINT64_MAX_JAVA = 0xffffffffffffffffL; // 0xffffffffffffffff == UINT64_MAX

0 commit comments

Comments
 (0)