For OnePlus 5 running OOS 9.0 only (may work on other OnePlus devices and OOS versions). This hook has nothing to do with privacy. It prevents the three-state alert slider from having any effect on the ringer/vibration. You can then remap it for your own purposes by reading as root /sys/devices/virtual/switch/tri-state-key/state with Tasker, Automate or other device automation tools. Tested with OOS 9.0.13 on OP5. Instructions: 1. Download this hook. 2. Make sure that the Fif collection is enabled in XPL Pro. 3. In XPL, navigate to the "Android System" app (you may have to change the filter to "Show all apps" first), and expand the restriction categories. 4.a. Check the "Use slider" category. 4.b. Or, alternately, enable ThreeKeyHw.isSupportSocThreeKey hook for "Android System" in XPL Pro. Changelog: v1 - 2020-05-23 First public release.
|Author||Fif_ on XDA|
|Updated (UTC)||2020-05-25 01:00:57|
|Created (UTC)||2020-05-25 01:00:57|
-- ThreeKeyHw.isSupportSocThreeKey is a Lua hook definition -- designed to work with XPrivacyLua. -- ThreeKeyHw.isSupportSocThreeKey is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- ThreeKeyHw.isSupportSocThreeKey is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- You should have received a copy of the GNU General Public License -- along with XPrivacyLua. If not, see <http://www.gnu.org/licenses/>. -- Copyright (C) 2020 Philippe Troin (Fif_ on XDA) function after(hook, params) local value = params:getResult() if not value then local fake = true params:setResult(fake) return true, tostring(value), tostring(fake) else return false end end