Browse Source

[Minor] Lua_magic: Add types for .jar and for .apk

tags/2.0
Vsevolod Stakhov 4 years ago
parent
commit
0b5f43d31e
2 changed files with 12 additions and 1 deletions
  1. 4
    1
      lualib/lua_magic/heuristics.lua
  2. 8
    0
      lualib/lua_magic/types.lua

+ 4
- 1
lualib/lua_magic/heuristics.lua View File

@@ -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


+ 8
- 0
lualib/lua_magic/types.lua View File

@@ -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",

Loading…
Cancel
Save