OnePlusHighPowerDetector.isProcInWhiteList

For OnePlus OS (OOS) ROMs only. This hook has nothing to do with privacy. It disables OOS background process kills by making all apps white-listed. Tested with OOS 4.5.15 (Nougat 7.1). Instructions: 1. Download both hooks: - OnePlusHighPowerDetector.isProcInWhiteList - OnePlusHighPowerDetector.isForkedProcInWhiteList 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 "Kill background apps" category. 4.b. Or, alternately, enable the two hooks listed above for "Android System" in XPL Pro. Changelog: v1 - 2019-03-18 First public release.

CollectionFif
GroupKill background apps
NameOnePlusHighPowerDetector.isProcInWhiteList
AuthorFif_
Version1
Updated (UTC)2019-03-19 15:40:20
Created (UTC)2019-03-19 15:40:20
Downloads356
Class namecom.android.server.am.OnePlusHighPowerDetector
Method nameisProcInWhiteList
Parameter typescom.android.server.am.ProcessRecord
Return typeboolean
Min SDK0
Max SDK999
Min APK0
Max APK2147483647
Excluded packages^(?!android$).*
EnabledYes
OptionalNo
UsageYes
NotifyNo
Settings-
-- Fif.OnePlusHighPowerDetector is a Lua hook definition 
-- designed to work with XPrivacyLua.

-- Fif.OnePlusHighPowerDetector 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.

-- Fif.OnePlusHighPowerDetector 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) 2019 Philippe Troin (Fif_ on XDA)

function after(hook, param)
  local arg = param:getArgument(0)
  local result = param:getResult()
  local hookName = hook:getName()
  local logPrefix

  if hookName == 'OnePlusHighPowerDetector.isProcInWhiteList' then
    logPrefix = tostring(arg.info.packageName) .. ': '
  else 
    if hookName == 'OnePlusHighPowerDetector.isForkedProcInWhiteList' then
      logPrefix = tostring(arg.pkgName) .. ': '
    else
      log('Unknown hook name: "' .. tostring(hookName) .. '"')
      param:die_by_calling_missing_method()
    end
  end

  -- log(logPrefix .. tostring(result))

  if result ~= true then
    param:setResult(true)
    return true, logPrefix .. tostring(result), logPrefix .. 'true'
  else
    return false
  end
end