@Override public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam initPackageResourcesParam) throws Throwable { if (!initPackageResourcesParam.packageName.equals("com.whatsapp")) return; modRes = XModuleResources.createInstance(MODULE_PATH, initPackageResourcesParam.res); if (sharedPreferences != null && sharedPreferences.getBoolean("hideTabs", false)) initPackageResourcesParam.res.setReplacement("com.whatsapp", "dimen", "tab_height", modRes.fwd(R.dimen.tab_height)); if (sharedPreferences != null && sharedPreferences.getBoolean("showBlackTicks", false)) { initPackageResourcesParam.res.setReplacement("com.whatsapp", "drawable", "message_got_read_receipt_from_target", modRes.fwd(R.mipmap.ic_black_tick_conv)); initPackageResourcesParam.res.setReplacement("com.whatsapp", "drawable", "message_got_read_receipt_from_target_onmedia", modRes.fwd(R.mipmap.ic_black_tick_conv)); initPackageResourcesParam.res.setReplacement("com.whatsapp", "drawable", "msg_status_client_read", modRes.fwd(R.mipmap.ic_black_tick_main)); } }
public static void hookResSystemui(XC_InitPackageResources.InitPackageResourcesParam resparam, String modulePath) { try { ConfigUtils config = ConfigUtils.getInstance(); XModuleResources modRes = XModuleResources.createInstance(modulePath, resparam.res); if (config.recents.no_recents_image) { resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "recents_stack_top_padding", modRes.fwd(R.dimen.recents_stack_top_padding)); try { resparam.res.setReplacement(PACKAGE_SYSTEMUI, "layout", "recents_empty", modRes.fwd(R.layout.recents_empty)); } catch (Throwable t) { // AICP resparam.res.setReplacement(PACKAGE_SYSTEMUI, "layout", "no_recents_holder", modRes.fwd(R.layout.recents_empty)); } } if (config.recents.large_recents) { resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "recents_stack_top_padding", modRes.fwd(R.dimen.recents_stack_top_padding)); // srsly bliss? 12 dp looks ugly as hell... resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "recents_task_view_rounded_corners_radius", new XResources.DimensionReplacement(2, TypedValue.COMPLEX_UNIT_DIP)); } } catch (Throwable t) { XposedHook.logE(TAG, "Error hooking SystemUI resources", t); } }
public static void hookRes(final XC_InitPackageResources.InitPackageResourcesParam resparam, String modulePath) { try { if (ConfigUtils.others().package_installer) { final XModuleResources modRes = XModuleResources.createInstance(modulePath, resparam.res); resparam.res.setReplacement(PACKAGE_PACKAGEINSTALLER, "string", "install_failed_inconsistent_certificates", modRes.fwd(R.string.install_failed_conflict)); resparam.res.setReplacement(PACKAGE_PACKAGEINSTALLER, "string", "install_failed_cpu_abi_incompatible", modRes.fwd(R.string.install_failed_incompatible)); resparam.res.setReplacement(PACKAGE_PACKAGEINSTALLER, "string", "install_failed_older_sdk", modRes.fwd(R.string.install_failed_blocked)); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "install_start", install_start); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "app_details", app_details); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "install_confirm", install_confirm); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "op_progress", op_progress); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "uninstall_confirm", uninstall_confirm); resparam.res.hookLayout(PACKAGE_PACKAGEINSTALLER, "layout", "uninstall_progress", uninstall_progress); } } catch (Throwable t) { XposedHook.logE(TAG, "Error hooking PackageInstaller resources", t); } }
resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_panel_width", modRes.fwd(R.dimen.notification_panel_width)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "qs_peek_height", zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "status_bar_header_height", modRes.fwd(R.dimen.status_bar_header_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "status_bar_header_height_expanded", modRes.fwd(R.dimen.status_bar_header_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "qs_emergency_calls_only_text_size", modRes.fwd(R.dimen.emergency_calls_only_text_size)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "qs_date_collapsed_size", modRes.fwd(R.dimen.date_time_collapsed_size)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "multi_user_avatar_collapsed_size", modRes.fwd(R.dimen.multi_user_avatar_size)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "qs_brightness_padding_top", modRes.fwd(R.dimen.brightness_slider_padding_top)); if (ConfigUtils.M) resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "multi_user_avatar_expanded_size", modRes.fwd(R.dimen.multi_user_avatar_size));
resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_side_padding", zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notifications_top_padding", zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_padding", ConfigUtils.notifications().enable_notifications_background ? modRes.fwd(R.dimen.notification_divider_height) : zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_padding_dimmed", ConfigUtils.notifications().enable_notifications_background ? modRes.fwd(R.dimen.notification_divider_height) : zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_material_rounded_rect_radius", zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "speed_bump_height", zero); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_min_height", modRes.fwd(R.dimen.notification_min_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_mid_height", modRes.fwd(R.dimen.notification_mid_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "notification_max_height", modRes.fwd(R.dimen.notification_max_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "min_stack_height", modRes.fwd(R.dimen.min_stack_height)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "keyguard_clock_notifications_margin_min", modRes.fwd(R.dimen.keyguard_clock_notifications_margin_min)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "dimen", "keyguard_clock_notifications_margin_max", modRes.fwd(R.dimen.keyguard_clock_notifications_margin_max)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "color", "notification_material_background_color", modRes.fwd(R.color.notification_material_background_color)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "color", "notification_material_background_dimmed_color", modRes.fwd(R.color.notification_material_background_dimmed_color)); resparam.res.setReplacement(PACKAGE_SYSTEMUI, "color", "notification_material_background_low_priority_color", modRes.fwd(R.color.notification_material_background_low_priority_color));
resparam.res.setReplacement(FriendListDialog.name, modRes.fwd(name)); resparam.res.setReplacement(FriendListDialog.checkBox, modRes.fwd(checkBox)); resparam.res.setReplacement(FriendListDialog.friend_item, modRes.fwd(friend_item)); resparam.res.setReplacement(GroupDialog.group_item, modRes.fwd(group_item));