├── LICENSE ├── META-INF └── com │ └── google │ └── android │ ├── update-binary │ └── updater-script ├── README.md ├── module.prop └── sepolicy.rule /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Alexander Georgievskiy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /META-INF/com/google/android/update-binary: -------------------------------------------------------------------------------- 1 | #!/sbin/sh 2 | 3 | ################# 4 | # Initialization 5 | ################# 6 | 7 | umask 022 8 | 9 | # echo before loading util_functions 10 | ui_print() { echo "$1"; } 11 | 12 | require_new_magisk() { 13 | ui_print "*******************************" 14 | ui_print " Please install Magisk v20.4+! " 15 | ui_print "*******************************" 16 | exit 1 17 | } 18 | 19 | ######################### 20 | # Load util_functions.sh 21 | ######################### 22 | 23 | OUTFD=$2 24 | ZIPFILE=$3 25 | 26 | mount /data 2>/dev/null 27 | 28 | [ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk 29 | . /data/adb/magisk/util_functions.sh 30 | [ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk 31 | 32 | install_module 33 | exit 0 34 | -------------------------------------------------------------------------------- /META-INF/com/google/android/updater-script: -------------------------------------------------------------------------------- 1 | #MAGISK 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # app-data-file-exec 2 | [Magisk](https://github.com/topjohnwu/Magisk) [module](https://topjohnwu.github.io/Magisk/guides.html) allowing execution of binaries in apps `data` folder 3 | 4 | ### What does 5 | 6 | 1. Modifies one `Android` `SELinux` rule. 7 | 8 | ### Why does 9 | 1. Fixes [Elementum](https://github.com/elgatito/plugin.video.elementum) on [Kodi](https://kodi.tv/) version 19+ and `Android` version 10+ 10 | > [Elementum](https://github.com/elgatito/plugin.video.elementum) fails to start on [Kodi](https://kodi.tv/) version 19+ and `Android` version 10+ with error `Daemon error: b"PermissionError(13, 'Permission denied')"`. Issue is `Android` version 10+ [SELinux](https://source.android.com/security/selinux) [restriction](https://android.googlesource.com/platform/system/sepolicy/+/master/private/app_neverallows.te#54) for executing binaries located in application `data` folder. 11 | > 12 | > Solution has been [suggested](https://github.com/elgatito/plugin.video.elementum/issues/669#issuecomment-804882665) by **@notgood** 13 | 14 | #### How to install (exact steps for `Magisk` 23.0) 15 | 16 | 1. [Download](https://github.com/galeksandrp/app-data-file-exec/releases/latest) `.zip` asset to device 17 | 2. Open `Magisk Manager` 18 | 3. Tap `Modules` tab (first tab on the right, with `puzzle` icon) 19 | 4. Tap `Install from storage` button 20 | 5. Choose downloaded `.zip` 21 | 6. Wait for `- Done` message 22 | 7. Reboot device 23 | 24 | #### Troubleshooting 25 | 26 | - Q: `! Unzip error` 27 | - A: You downloaded `Source code (zip)` instead of `.zip` asset. 28 | 29 | #### What contains and redistributes 30 | 31 | | File | SPDX License Identifier | 32 | | - | - | 33 | | `META-INF/com/google/android/update-binary` | [GPL-3.0-only](https://spdx.org/licenses/GPL-3.0-only.html) | 34 | 35 | #### Github topics 36 | `magisk` `magisk-module` `magisk-modules` `android` `root` `selinux` `selinux-policy` 37 | -------------------------------------------------------------------------------- /module.prop: -------------------------------------------------------------------------------- 1 | id=app-data-file-exec 2 | name=app-data-file-exec 3 | version=0.1.0 4 | versionCode=1 5 | author=galeksandrp 6 | description=Allow execution of binaries in apps data folder 7 | -------------------------------------------------------------------------------- /sepolicy.rule: -------------------------------------------------------------------------------- 1 | allow * { app_data_file privapp_data_file } file { execute_no_trans } 2 | --------------------------------------------------------------------------------