From: Vsevolod Stakhov Date: Tue, 24 Sep 2019 11:57:33 +0000 (+0100) Subject: [Minor] Lua_magic: Add types for .jar and for .apk X-Git-Tag: 2.0~141 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0b5f43d31ee401931d65e4627e0bcebab571be7c;p=rspamd.git [Minor] Lua_magic: Add types for .jar and for .apk --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 8fb83bb0d..700932051 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -244,7 +244,8 @@ local function detect_archive_flaw(part, arch, log_obj) jar = 0, odt = 0, odp = 0, - ods = 0 + ods = 0, + apk = 0, } -- ext + confidence pairs -- General msoffice patterns @@ -268,6 +269,8 @@ local function detect_archive_flaw(part, arch, log_obj) res.pptx = res.pptx + 30 elseif file == 'META-INF/MANIFEST.MF' then res.jar = res.jar + 40 + elseif file == 'AndroidManifest.xml' then + res.apk = res.apk + 60 end end diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 2b2545d87..5626b3445 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -39,6 +39,14 @@ local types = { ct = 'application/x-java-applet', type = 'executable', }, + jar = { + ct = 'application/java-archive', + type = 'archive', + }, + apk = { + ct = 'application/vnd.android.package-archive', + type = 'archive', + }, -- text rtf = { ct = "application/rtf",