Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed May 25, 2024
1 parent bc06132 commit c635f72
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mobsf/MobSF/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@
'application/x-zip-compressed',
'binary/octet-stream',
]
# Supported File Extensions
APPX_MIME = [
'application/octet-stream',
'application/vns.ms-appx',
'application/x-zip-compressed',
]
# Supported File Extensions
ANDROID_EXTS = (
'apk', 'xapk', 'apks', 'zip',
'aab', 'so', 'jar', 'aar',
Expand Down
4 changes: 4 additions & 0 deletions mobsf/MobSF/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,13 @@ def index(request):
+ settings.IPA_MIME
+ settings.ZIP_MIME
+ settings.APPX_MIME)
exts = (settings.ANDROID_EXTS
+ settings.IOS_EXTS
+ settings.WINDOWS_EXTS)
context = {
'version': settings.MOBSF_VER,
'mimes': mimes,
'exts': '|'.join(exts),
}
template = 'general/home.html'
return render(request, template, context)
Expand Down
2 changes: 1 addition & 1 deletion mobsf/templates/general/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ <h6> <a href="{% url 'recent' %}">RECENT SCANS</a> | <a href="{% url 'dynamic'
// Is valid file extensions
function isValidExt(file_name){
var val = file_name.toLowerCase();
var regex = new RegExp("^(.{1,300}?)\.(ipa|apk|apks|xapk|aab|jar|aar|so|dylib|a|zip|appx)$");
var regex = new RegExp("^(.{1,300}?)\.({{exts}})$");
val = val.replace(/^.*[\\\/]/, '');
if (!(regex.test(val))) {
_('status').innerText = "MobSF only supports APK, APKS, XAPK, AAB, JAR, AAR, SO, IPA, DYLIB, A, ZIP, and APPX files.";
Expand Down

0 comments on commit c635f72

Please sign in to comment.