Skip to content

Commit

Permalink
wth?
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagabe19 committed Sep 7, 2024
1 parent cda5a64 commit 8c82872
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/mobile/funkin/backend/utils/SUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package mobile.funkin.backend.utils;
#if android
import android.content.Context;
import android.os.Environment;
import android.os.Build;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.Permissions;
import android.Settings;
#end
Expand Down Expand Up @@ -97,19 +98,19 @@ class SUtil
#if android
public static function doPermissionsShit():Void
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
if (VERSION.SDK_INT >= VERSION_CODES.TIRAMISU)
Permissions.requestPermissions(['READ_MEDIA_IMAGES', 'READ_MEDIA_VIDEO', 'READ_MEDIA_AUDIO']);
else
Permissions.requestPermissions(['READ_EXTERNAL_STORAGE', 'WRITE_EXTERNAL_STORAGE']);

if (!Environment.isExternalStorageManager())
{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
if (VERSION.SDK_INT >= VERSION_CODES.S)
Settings.requestSetting('REQUEST_MANAGE_MEDIA');
Settings.requestSetting('MANAGE_APP_ALL_FILES_ACCESS_PERMISSION');
}

if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && !Permissions.getGrantedPermissions().contains('android.permission.READ_MEDIA_IMAGES')) || (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU && !Permissions.getGrantedPermissions().contains('android.permission.READ_EXTERNAL_STORAGE')))
if ((VERSION.SDK_INT >= VERSION_CODES.TIRAMISU && !Permissions.getGrantedPermissions().contains('android.permission.READ_MEDIA_IMAGES')) || (VERSION.SDK_INT < VERSION_CODES.TIRAMISU && !Permissions.getGrantedPermissions().contains('android.permission.READ_EXTERNAL_STORAGE')))
NativeAPI.showMessageBox('Notice!', 'If you accepted the permissions you are all good!' + '\nIf you didn\'t then expect a crash' + '\nPress Ok to see what happens', MSG_INFORMATION);

try
Expand Down

0 comments on commit 8c82872

Please sign in to comment.