Skip to content

Commit

Permalink
Xposed Dex for One UI 3.1 with features: Make all apps immersive, Fix…
Browse files Browse the repository at this point in the history
… samsung browser secret mode and always visible scrollbar, Fix SoundTouch landscape mode, Hide task button, Hide date below clock on right side, Hide taskbar separators and if both checked increment size of icons in taskbar.
  • Loading branch information
root committed Jul 23, 2021
1 parent c33d969 commit 38d160b
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 80 deletions.
6 changes: 3 additions & 3 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="org.eclipse.andmore.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="org.eclipse.andmore.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="org.eclipse.andmore.DEPENDENCIES"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="lib" path="lib/api-82.jar" sourcepath="lib/api-82-sources.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
8 changes: 4 additions & 4 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.andmore.ResourceManagerBuilder</name>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.andmore.PreCompilerBuilder</name>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
Expand All @@ -21,13 +21,13 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.andmore.ApkBuilder</name>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.andmore.AndroidNature</nature>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Binary file modified bin/com.pijulius.xposeddex.apk
Binary file not shown.
10 changes: 4 additions & 6 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
<string name="settings_make_apps_immersive_sum">Will remove window titlebar for maximized applications.</string>
<string name="settings_fix_sbrowser">Fix Samsung Browser</string>
<string name="settings_fix_sbrowser_sum">Enables secret mode and disable always visible scroll bar.</string>
<string name="settings_fix_soundtouch">Fix SoundTouch</string>
<string name="settings_fix_soundtouch_sum">Make Bose SoundTouch app to be landscape and always show volume control slider.</string>

<string name="settings_samsung_dex_taskbar">Dex Taskbar</string>
<string name="settings_fix_taskbar">Taskbar Fixes</string>
<string name="settings_fix_taskbar_sum">Add small space above app docks running marker.</string>
<string name="settings_hide_tasks_button">Hide Tasks Button</string>
<string name="settings_hide_tasks_button_sum">Removes the Tasks button from the taskbar.</string>
<string name="settings_hide_nosim_icon">Hide NoSIM Icon</string>
<string name="settings_hide_nosim_icon_sum">Removes the NoSIM icon from statusbar.</string>
<string name="settings_hide_battery_percentage">Hide Battery Percentage</string>
<string name="settings_hide_battery_percentage_sum">Removes the battery percentage from statusbar.</string>
<string name="settings_hide_date">Hide Date</string>
<string name="settings_hide_date_sum">Removes the date from the taskbar below the clock.</string>
<string name="settings_hide_taskbar_separators">Hide Taskbar Separators</string>
<string name="settings_hide_taskbar_separators_sum">Removes empty gaps (separators) from taskbar.</string>

Expand Down
29 changes: 11 additions & 18 deletions res/xml/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
android:title="@string/settings_fix_sbrowser"
android:key="fixSBrowser" />

<CheckBoxPreference
android:name="@string/settings_fix_soundtouch"
android:summary="@string/settings_fix_soundtouch_sum"
android:defaultValue="true"
android:title="@string/settings_fix_soundtouch"
android:key="fixSoundTouch" />

</PreferenceCategory>

<PreferenceCategory
android:title="@string/settings_samsung_dex_taskbar">

<CheckBoxPreference
android:name="@string/settings_fix_taskbar"
android:summary="@string/settings_fix_taskbar_sum"
android:defaultValue="true"
android:title="@string/settings_fix_taskbar"
android:key="fixTaskbar" />

<CheckBoxPreference
android:name="@string/settings_hide_tasks_button"
android:summary="@string/settings_hide_tasks_button_sum"
Expand All @@ -39,18 +39,11 @@
android:key="hideTasksButton" />

<CheckBoxPreference
android:name="@string/settings_hide_nosim_icon"
android:summary="@string/settings_hide_nosim_icon_sum"
android:defaultValue="true"
android:title="@string/settings_hide_nosim_icon"
android:key="hideNoSIMIcon" />

<CheckBoxPreference
android:name="@string/settings_hide_battery_percentage"
android:summary="@string/settings_hide_battery_percentage_sum"
android:name="@string/settings_hide_date"
android:summary="@string/settings_hide_date_sum"
android:defaultValue="true"
android:title="@string/settings_hide_battery_percentage"
android:key="hideBatteryPercentage" />
android:title="@string/settings_hide_date"
android:key="hideDate" />

<CheckBoxPreference
android:name="@string/settings_hide_taskbar_separators"
Expand Down
82 changes: 33 additions & 49 deletions src/com/pijulius/xposeddex/XposedDex.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ public void handleInitPackageResources(InitPackageResourcesParam resparam) throw
settings = new XSharedPreferences(new File(settingsFile));

taskbarResourceFixes(resparam);

if (settings.getBoolean("fixSoundTouch", true))
soundtouchResourceFixes(resparam);
}

public void makeAppsImmersive(LoadPackageParam lpparam) {
Class<?> hookClass = findClass("com.android.internal.policy.MultiWindowDecorSupport",
Class<?> hookClass = findClass("com.android.internal.policy.DecorView",
lpparam.classLoader);

XposedBridge.hookAllMethods(hookClass, "isImmersiveMode", new XC_MethodHook() {
Expand All @@ -67,9 +70,9 @@ public void taskbarResourceFixes(InitPackageResourcesParam resparam) {

final boolean hideTasksButton = settings.getBoolean("hideTasksButton", true);
final boolean hideTaskbarSeparators = settings.getBoolean("hideTaskbarSeparators", true);
final boolean spaceAboveAppDock = settings.getBoolean("fixTaskbar", true);
final boolean hideDate = settings.getBoolean("hideDate", true);

if (hideTasksButton || hideTaskbarSeparators || spaceAboveAppDock) {
if (hideTasksButton || hideTaskbarSeparators || hideDate) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "taskbar", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
Expand Down Expand Up @@ -111,70 +114,51 @@ public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam)
marginParams.setMarginEnd(0);
}

if (spaceAboveAppDock) {
if (hideTasksButton && hideTaskbarSeparators) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"appdock_container", "id", "com.samsung.desktopsystemui"));

view.setPadding(0, 4, 0, 0);
MarginLayoutParams marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(400);
marginParams.setMarginEnd(550);
}
}
});
}

if (settings.getBoolean("hideNoSIMIcon", true)) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "desk_signal_cluster_view_25", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
View view = null;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"no_sims_combo", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"sec_no_sim_slot1", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"sec_no_sim_slot2", "id", "com.samsung.desktopsystemui"));
if (hideDate) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"date", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;
view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;
view.setPadding(0, 0, 0, 0);
}
}
});
}

if (settings.getBoolean("hideBatteryPercentage", true)) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "battery_percentage_view", new XC_LayoutInflated() {
if (hideTaskbarSeparators) {
resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "pinned_apps_divider", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
View view = null;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"battery_percentage_view", "id", "com.samsung.desktopsystemui"));
if (hideTaskbarSeparators) {
view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"pinned_apps_divider", "id", "com.samsung.desktopsystemui"));

view.setVisibility(View.GONE);
view.setVisibility(View.GONE);
view.getLayoutParams().width = 0;
view.setPadding(0, 0, 0, 0);
}
}
});
}
}

resparam.res.hookLayout("com.samsung.desktopsystemui", "layout", "desk_system_icons", new XC_LayoutInflated() {
@Override
public void handleLayoutInflated(XC_LayoutInflated.LayoutInflatedParam liparam) throws Throwable {
View view = null;

view = (View)liparam.view.findViewById(liparam.res.getIdentifier(
"system_icons_battery_container", "id", "com.samsung.desktopsystemui"));
public void soundtouchResourceFixes(InitPackageResourcesParam resparam) {
if (!resparam.packageName.equals("com.bose.soundtouch"))
return;

MarginLayoutParams marginParams = (MarginLayoutParams)view.getLayoutParams();
marginParams.setMarginStart(10);
marginParams.setMarginEnd(10);
}
});
}
resparam.res.setReplacement("com.bose.soundtouch", "bool", "allow_rotation", true);
}

public void sbrowserFixes(LoadPackageParam lpparam) {
Expand All @@ -184,7 +168,7 @@ public void sbrowserFixes(LoadPackageParam lpparam) {

Class<?> hookClass = null;

hookClass = findClass("com.sec.android.app.sbrowser.SBrowserCommandLine",
hookClass = findClass("com.sec.android.app.sbrowser.init.SBrowserCommandLine",
lpparam.classLoader);

XposedBridge.hookAllMethods(hookClass, "setSamsungDexEnabled", new XC_MethodHook() {
Expand Down

0 comments on commit 38d160b

Please sign in to comment.