forked from M66B/XPrivacyLua
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhook_130.json
1 lines (1 loc) · 3.07 KB
/
hook_130.json
1
{"builtin":false,"collection":"Fif","group":"Read.Identifiers","name":"AdvertisingIdClient$Info.getId","author":"M66B, Fif_ on XDA.","version":1,"description":"This is an expanded version of the XPL built-in hook with the same name from M66B.\nCompared with the stock hook, this one will return a random advertising ID. The random ID will change every time the app is (re-)started, but will remain the same random value while the app is running.\n\nInstructions:\n1. Disable the stock AdvertisingIdClient$Info.getId hook:\n1.a. Open XPL Pro, open the hamburger menu, choose \"Manage hook definitions\".\n1.b. Search for AdvertisingIdClient.\n1.c. Edit the AdvertisingIdClient$Info.getId hook in the Privacy collection.\n1.d. Set \"Enabled\" to disable (unchecked).\n1.e. Save by clicking \"OK\".\n2. Download this hook.\n3. Make sure that the Fif collection is enabled in XPL Pro.\n4. For every app you want to apply the hook to, either:\n4.a. Toggle the \"Read Identifiers\" category until it's fully enabled (red) in XPL.\nor\n4.b. In XPL Pro, enable the AdvertisingIdClient$Info.getId hook in the Fif collection for that app.\n\nChangelog:\n\nv1 - 2020-09-06\nFirst public release.","className":"com.google.android.gms.ads.identifier.AdvertisingIdClient$Info","methodName":"getId","parameterTypes":[],"returnType":"java.lang.String","minSdk":1,"maxSdk":999,"minApk":0,"maxApk":2147483647,"enabled":true,"optional":true,"usage":true,"notify":false,"luaScript":"-- AdvertisingIdClient$Info.getId is a Lua hook definition designed to work \n-- with XPrivacyLua.\n\n-- AdvertisingIdClient$Info.getId 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-- AdvertisingIdClient$Info.getId 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-- Copyright 2017-2019 Marcel Bokhorst (M66B)\n-- Copyright 2020 Fif_ on XDA.\n\nfunction after(hook, param)\n local result = param:getResult()\n if result == nil then\n return false\n end\n\n local context = param:getApplicationContext()\n local fake = param:getValue('Fif.AdvertisingIdClient$Info.getId.id', context)\n\n if fake == nil then\n local i, digit\n fake = ''\n for i = 1, 36 do\n if i == 9 or i == 14 or i == 19 or i == 24 then\n fake = fake .. '-'\n else\n digit = math.random(0,15)\n if digit < 10 then\n fake = fake .. string.char(string.byte('0')+digit)\n else\n fake = fake .. string.char(string.byte('a')+digit-10)\n end\n end\n end\n\n param:putValue('Fif.AdvertisingIdClient$Info.getId.id', fake, context)\n end\n\n param:setResult(fake)\n return true, result, fake\nend\n"}