-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
62 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,58 @@ | ||
set_perm_recursive $MODPATH 0 0 0755 0755 | ||
ui_print | ||
floating_feature_path="/system/etc/floating_feature.xml" | ||
floating_feature_key="SEC_FLOATING_FEATURE_COMMON_CONFIG_DEX_MODE" | ||
|
||
set_perm_recursive $MODPATH 0 0 0755 0755 | ||
|
||
print_done_message () { | ||
ui_print "Requirements met, avoiding abortion." | ||
ui_print "We won't patch XML right now, patch will apply during each boot." | ||
ui_print "Reinstalling this module after firmware updates won't be needed." | ||
installation_completed() { | ||
ui_print | ||
ui_print "Requirements met." | ||
ui_print "The patch to $floating_feature_path" | ||
ui_print "will be applied on each boot." | ||
ui_print "No need for reinstall after firmware updates." | ||
ui_print | ||
ui_print "[DONE]" | ||
exit 0 | ||
} | ||
|
||
abort_installation() { | ||
ui_print | ||
ui_print "Installation process was cancelled." | ||
touch $MODPATH/remove | ||
exit 1 | ||
} | ||
|
||
if [ -e $(magisk --path)/.magisk/modules/dex_feature_enabler/floating_feature.xml.patched ]; then | ||
ui_print "Seems, it's not a fresh install." | ||
ui_print "Seems like it's not a fresh install." | ||
ui_print "Bypassing checks and inflating new files." | ||
ui_print "If you're experiencing problems, try a clean install." | ||
ui_print | ||
print_done_message | ||
exit 0 | ||
ui_print "If you're experiencing problems, try a fresh install." | ||
installation_completed | ||
fi | ||
|
||
ui_print "Is /system/etc/floating_feature.xml in place?" | ||
if [ ! -f /system/etc/floating_feature.xml ]; then | ||
ui_print "[FAIL] Installation process was cancelled, this path seems not to exist: /system/etc/floating_feature.xml" | ||
touch $MODPATH/remove | ||
exit 1 | ||
ui_print "Is $floating_feature_path in place?" | ||
if [ ! -f "$floating_feature_path" ]; then | ||
ui_print "This file seems not to exist." | ||
ui_print "Nothing to patch." | ||
abort_installation | ||
fi | ||
ui_print "PASS" | ||
ui_print | ||
|
||
ui_print "Does it have SEC_FLOATING_FEATURE_COMMON_CONFIG_DEX_MODE key?" | ||
if ! grep -q SEC_FLOATING_FEATURE_COMMON_CONFIG_DEX_MODE /system/etc/floating_feature.xml; then | ||
ui_print "[UNSUPPORTED] Highly likely, Samsung DEX is unsupported on your platform," | ||
ui_print "or file can't be opened due to other related problems..." | ||
ui_print "Installation process was cancelled." | ||
touch $MODPATH/remove | ||
exit 1 | ||
ui_print | ||
ui_print "Does it have $floating_feature_key key?" | ||
if ! grep -q $floating_feature_key "$floating_feature_path"; then | ||
ui_print "[UNSUPPORTED] Highly likely, Samsung DeX" | ||
ui_print "is unsupported on your device." | ||
abort_installation | ||
fi | ||
ui_print "PASS" | ||
ui_print | ||
|
||
ui_print "Is standalone feature already enabled?" | ||
if grep -q '<SEC_FLOATING_FEATURE_COMMON_CONFIG_DEX_MODE>.*standalone.*</SEC_FLOATING_FEATURE_COMMON_CONFIG_DEX_MODE>' /system/etc/floating_feature.xml; then | ||
ui_print "[SKIP] Installation process was cancelled, due to persistance of 'standalone' feature flag.\nNo need for using this module!" | ||
touch $MODPATH/remove | ||
exit 1 | ||
ui_print | ||
ui_print "Is the standalone feature already enabled?" | ||
if grep -q "<$floating_feature_key>.*standalone.*</$floating_feature_key>" "$floating_feature_path"; then | ||
ui_print "[SKIP] Standalone mode of Samsung DeX is already enabled." | ||
ui_print "No need to use this module!" | ||
abort_installation | ||
fi | ||
ui_print "PASS" | ||
ui_print | ||
|
||
print_done_message | ||
installation_completed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
id=dex_feature_enabler | ||
name=DeX Feature Enabler | ||
version=1.0 | ||
versionCode=1 | ||
version=1.1 | ||
versionCode=2 | ||
author=yukkerike | ||
description=Patches floating_feature.xml to enable Samsung DeX mode on inner display. | ||
updateJson=https://raw.githubusercontent.com/yukkerike/dex_feature_enabler/main/update.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"version": "1.0", | ||
"versionCode": "1", | ||
"version": "1.1", | ||
"versionCode": "2", | ||
"changelog": "Initial release of DeX Feature Enabler.", | ||
"zipUrl": "https://github.com/yukkerike/dex_feature_enabler/releases/download/latest/dex_feature_enabler.zip" | ||
"zipUrl": "https://github.com/yukkerike/dex_feature_enabler/releases/latest/download/dex_feature_enabler.zip" | ||
} |