forked from 0bbedCode/XPL-EX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhook_152.json
1 lines (1 loc) · 3.41 KB
/
hook_152.json
1
{"builtin":false,"collection":"Intika-Google-FCM","group":"Use firebase","name":"PackageManager.queryIntentServices","author":"Intika","version":2,"description":"Use firebase (Block Google Firebase Cloud Messaging)\nDescription: Check main hook\nPart: 15\/15 (Optional)","className":"android.content.pm.PackageManager","methodName":"queryIntentServices","parameterTypes":["android.content.Intent","int"],"returnType":"java.util.List","minSdk":19,"maxSdk":999,"minApk":0,"maxApk":2147483647,"enabled":true,"optional":false,"usage":true,"notify":false,"luaScript":"-- Copyright 2022-2022 Intika\n-- Copyright 2017-2019 Marcel Bokhorst (M66B)\n\n-- This is free software: you can redistribute it and\/or modify\n-- it under the terms of the GNU General Public License as published by\n-- the Free Software Foundation, either version 3 of the License, or\n-- (at your option) any later version.\n\n-- This is distributed in the hope that it will be useful,\n-- but WITHOUT ANY WARRANTY; without even the implied warranty of\n-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-- GNU General Public License for more details.\n\n-- You should have received a copy of the GNU General Public License\n-- along with XPrivacyLua. If not, see <http:\/\/www.gnu.org\/licenses\/>.\n\nfunction after(hook, param)\n local list = param:getResult()\n if list == nil then\n return false\n end\n\n local filtered = false\n local name = hook:getName()\n\n local index\n local info = list:toArray()\n for index = info['length'], 1, -1 do\n local item = info[index]\n\n local pname\n if item == nil then\n pname = nil\n elseif name == 'PackageManager.getInstalledPackages' or\n name == 'PackageManager.getPackagesHoldingPermissions' or\n name == 'PackagieManager.getPreferredPackages' then\n -- PackageInfo\n pname = item.packageName\n elseif name == 'PackageManager.queryIntentActivities' or\n name == 'PackageManager.queryIntentActivityOptions' then\n -- ResolveInfo\n pname = item.activityInfo.packageName\n elseif name == 'PackageManager.queryIntentContentProviders' then\n -- ResolveInfo\n pname = item.providerInfo.packageName\n elseif name == 'PackageManager.queryIntentServices' then\n -- ResolveInfo\n pname = item.serviceInfo.packageName\n else\n pname = item.packageName\n end\n\n local target = 'com.google.android.gms'\n local starget = 'com.google.android.gsf'\n\n if pname ~= nil then\n if pname==target or pname==starget then\n -- our target\n filtered = true\n list:remove(index - 1)\n end\n end\n\n end\n\n return filtered\n\n-- Possible system app filter with\n-- applicationInfo.FLAG_SYSTEM (if set to int 1 mean the app is on the system partition)\n\n-- Alternative implementation\n-- local intent = param:getArgument(0)\n-- local action = intent:getAction()\n-- local target = 'com.google.android'\n-- local starget = 'com.google.firebase'\n-- if \n--string.sub(action,1,string.len(target))~=target and string.sub(action,1,string.len(starget))~=starget then\n-- -- not our target\n-- return false\n-- else\n-- param:setResult(nil)\n-- return true\n-- end\n--\n\nend\n\n\n\n\n\n\n\n\n"}