Advertisement
Guest User

Extract Xiaomi.eu PIF v1.1

a guest
Dec 28th, 2023
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.88 KB | Source Code | 0 0
  1. Task: Extract Xiaomi.eu PIF
  2.  
  3. A1: Variable Set [
  4. Name: %pkgname
  5. To: eu.xiaomi.module.inject ]
  6.  
  7. A2: Java Function [
  8. Return: pm
  9. Class Or Object: CONTEXT
  10. Function: getPackageManager
  11. {PackageManager} () ]
  12.  
  13. A3: Java Function [
  14. Return: pi
  15. Class Or Object: pm
  16. Function: getPackageInfo
  17. {PackageInfo} (String, int)
  18. Param 1 (String): %pkgname
  19. Param 2 (int): 0
  20. Continue Task After Error:On ]
  21.  
  22. A4: Java Function [
  23. Return: isInstalledAndEnabled
  24. Class Or Object: Boolean
  25. Function: valueOf
  26. {Boolean} (boolean)
  27. Param 1 (boolean): pi.applicationInfo.enabled ]
  28.  
  29. A5: If [ isInstalledAndEnabled ~ true ]
  30.  
  31. A6: Java Function [
  32. Return: resources
  33. Class Or Object: pm
  34. Function: getResourcesForApplication
  35. {Resources} (String)
  36. Param 1 (String): %pkgname ]
  37.  
  38. A7: Java Function [
  39. Return: resourceId
  40. Class Or Object: resources
  41. Function: getIdentifier
  42. {int} (String, String, String)
  43. Param 1 (String): inject_fields
  44. Param 2 (String): xml
  45. Param 3 (String): %pkgname ]
  46.  
  47. A8: If [ resourceId neq 0 ]
  48.  
  49. A9: Flash [
  50. Text: Extracting FINGERPRINT props now...
  51. Tasker Layout: On
  52. Title: XiaomiEUModule app found
  53. Dismiss On Click: On ]
  54.  
  55. A10: Java Function [
  56. Return: injectFields
  57. Class Or Object: resources
  58. Function: getXml
  59. {XmlResourceParser} (int)
  60. Param 1 (int): resourceId ]
  61.  
  62. A11: Variable Set [
  63. Name: %pif_json
  64. To: {
  65. Structure Output (JSON, etc): On ]
  66.  
  67. A12: Java Function [
  68. Return: eventType
  69. Class Or Object: injectFields
  70. Function: next
  71. {int} () ]
  72.  
  73. <While != XmlResourceParser.END_DOCUMENT>
  74. A13: Stop [ ]
  75. If [ eventType eq 1 ]
  76.  
  77. <If is XmlResourceParser.START_TAG>
  78. A14: If [ eventType eq 2 ]
  79.  
  80. A15: Java Function [
  81. Return: %tag_name
  82. Class Or Object: injectFields
  83. Function: getName
  84. {String} () ]
  85.  
  86. A16: If [ %tag_name ~ field ]
  87.  
  88. A17: Java Function [
  89. Return: %name
  90. Class Or Object: injectFields
  91. Function: getAttributeValue
  92. {String} (String, String)
  93. Param 1 (String): null
  94. Param 2 (String): name ]
  95.  
  96. A18: Java Function [
  97. Return: %value
  98. Class Or Object: injectFields
  99. Function: getAttributeValue
  100. {String} (String, String)
  101. Param 1 (String): null
  102. Param 2 (String): value ]
  103.  
  104. <Rename DEVICE_INITIAL_SDK_INT to FIRST_API_LEVEL>
  105. A19: Variable Set [
  106. Name: %name
  107. To: FIRST_API_LEVEL
  108. Structure Output (JSON, etc): On ]
  109. If [ %name ~ DEVICE_INITIAL_SDK_INT ]
  110.  
  111. A20: Variable Set [
  112. Name: %pif_json
  113. To:
  114. "%name": "%value",
  115. Append: On
  116. Structure Output (JSON, etc): On ]
  117.  
  118. A21: End If
  119.  
  120. A22: End If
  121.  
  122. A23: Java Function [
  123. Return: eventType
  124. Class Or Object: injectFields
  125. Function: next
  126. {int} () ]
  127.  
  128. A24: Goto [
  129. Type: Action Label
  130. Label: While != XmlResourceParser.END_DOCUMENT ]
  131. If [ eventType neq 1 ]
  132.  
  133. A25: Java Function [
  134. Class Or Object: injectFields
  135. Function: close
  136. {} () ]
  137.  
  138. <Add FIRST_API_LEVEL=23 if missing from XiaomiEUModule>
  139. A26: Variable Set [
  140. Name: %pif_json
  141. To:
  142. "FIRST_API_LEVEL": "23",
  143. Append: On
  144. Structure Output (JSON, etc): On ]
  145. If [ %pif_json !~R .*"FIRST_API_LEVEL".* ]
  146.  
  147. A27: Variable Search Replace [
  148. Variable: %pif_json
  149. Search: ,$
  150. One Match Only: On
  151. Replace Matches: On ]
  152.  
  153. A28: Variable Set [
  154. Name: %pif_json
  155. To:
  156. }
  157. Append: On
  158. Structure Output (JSON, etc): On ]
  159.  
  160. A29: Java Function [
  161. Return: extPifDir
  162. Class Or Object: CONTEXT
  163. Function: getExternalFilesDir
  164. {File} (String) ]
  165.  
  166. A30: Java Function [
  167. Return: %pif_dir
  168. Class Or Object: extPifDir
  169. Function: getCanonicalPath
  170. {String} () ]
  171.  
  172. A31: Write File [
  173. File: %pif_dir/XiaomiEU.pif.json
  174. Text: %pif_json
  175. Add Newline: On ]
  176.  
  177. A32: Flash [
  178. Text: XiaomiEU.pif.json is saved to %pif_dir directory
  179. Long: On
  180. Tasker Layout: On
  181. Title: Extraction successful
  182. Continue Task Immediately: On
  183. Dismiss On Click: On
  184. Use HTML: On ]
  185.  
  186. A33: Text/Image Dialog [
  187. Title: Update Custom PIF
  188. Text: Do you want to update your custom PIF with XiaomiEU.pif.json?
  189. Button 1: Cancel
  190. Button 2: Update
  191. Close After (Seconds): 30 ]
  192.  
  193. A34: If [ %td_button ~ Update ]
  194.  
  195. A35: Perform Task [
  196. Name: Update Custom PIF
  197. Priority: %priority
  198. Structure Output (JSON, etc): On ]
  199.  
  200. A36: Else
  201.  
  202. A37: Flash [
  203. Text: Custom PIF not updated
  204. Tasker Layout: On
  205. Dismiss On Click: On
  206. Use HTML: On ]
  207.  
  208. A38: Stop [ ]
  209.  
  210. A39: End If
  211.  
  212. A40: End If
  213.  
  214. A41: Else
  215.  
  216. A42: Flash [
  217. Text: XiaomiEUModule app not installed
  218. Tasker Layout: On
  219. Dismiss On Click: On
  220. Use HTML: On ]
  221.  
  222. A43: End If
  223.  
  224. A44: Disable
  225.  
  226.  
  227. ==========================================================
  228.  
  229.  
  230. Task: Update Custom PIF
  231.  
  232. A1: Run Shell [
  233. Command: cat /data/adb/modules/playintegrityfix/module.prop | sed -n 's/name=\(.*\)/\1/ip'
  234. Timeout (Seconds): 0
  235. Use Root: On
  236. Store Output In: %stdout
  237. Store Errors In: %stderr
  238. Use Global Namespace: On
  239. Continue Task After Error:On ]
  240.  
  241. A2: If [ %stdout Set ]
  242.  
  243. A3: Flash [
  244. Text: Updating custom PIF...
  245. Tasker Layout: On
  246. Title: %stdout found
  247. Dismiss On Click: On ]
  248.  
  249. A4: Java Function [
  250. Return: extPifDir
  251. Class Or Object: CONTEXT
  252. Function: getExternalFilesDir
  253. {File} (String) ]
  254.  
  255. A5: Java Function [
  256. Return: %pif_dir
  257. Class Or Object: extPifDir
  258. Function: getCanonicalPath
  259. {String} () ]
  260.  
  261. A6: Test File [
  262. Type: Exists
  263. Data: %pif_dir/XiaomiEU.pif.json
  264. Store Result In: %pif_exists
  265. Use Global Namespace: On ]
  266.  
  267. A7: If [ %pif_exists ~ true ]
  268.  
  269. A8: Flash [
  270. Text: Copying custom PIF into module directory...
  271. Tasker Layout: On
  272. Title: XiaomiEU.pif.json found
  273. Dismiss On Click: On ]
  274.  
  275. A9: If [ %stdout ~R (?i).*fix.* ]
  276.  
  277. A10: Run Shell [
  278. Command: cp %pif_dir/XiaomiEU.pif.json /data/adb/pif.json
  279. Timeout (Seconds): 0
  280. Use Root: On
  281. Use Global Namespace: On ]
  282.  
  283. A11: Else
  284. If [ %stdout ~R (?i).*fork.* ]
  285.  
  286. A12: Run Shell [
  287. Command: cp %pif_dir/XiaomiEU.pif.json /data/adb/modules/playintegrityfix/custom.pif.json
  288. Timeout (Seconds): 0
  289. Use Root: On
  290. Use Global Namespace: On ]
  291.  
  292. A13: Run Shell [
  293. Command: test -f /data/adb/modules/playintegrityfix/migrate.sh && echo "true" || echo "false"
  294. Timeout (Seconds): 0
  295. Use Root: On
  296. Store Output In: %migrate_exists
  297. Use Global Namespace: On
  298. Continue Task After Error:On ]
  299.  
  300. A14: If [ %migrate_exists ~ true ]
  301.  
  302. A15: Run Shell [
  303. Command: sh /data/adb/modules/playintegrityfix/migrate.sh /data/adb/modules/playintegrityfix/custom.pif.json
  304. Timeout (Seconds): 0
  305. Use Root: On
  306. Use Global Namespace: On
  307. Continue Task After Error:On ]
  308.  
  309. A16: End If
  310.  
  311. A17: End If
  312.  
  313. A18: Flash [
  314. Text: Stopping GMS unstable process...
  315. Tasker Layout: On
  316. Title: Custom PIF updated
  317. Dismiss On Click: On ]
  318.  
  319. A19: Run Shell [
  320. Command: killall com.google.android.gms.unstable
  321. Timeout (Seconds): 0
  322. Use Root: On
  323. Store Errors In: %stderr
  324. Use Global Namespace: On
  325. Continue Task After Error:On ]
  326.  
  327. A20: If [ %stderr Set ]
  328.  
  329. A21: Flash [
  330. Text: GMS unstable process is not running
  331. Tasker Layout: On
  332. Dismiss On Click: On ]
  333.  
  334. A22: Else
  335.  
  336. A23: Flash [
  337. Text: GMS unstable process is stopped
  338. Tasker Layout: On
  339. Dismiss On Click: On ]
  340.  
  341. A24: End If
  342.  
  343. A25: Flash [
  344. Text: You can test for Play Integrity now
  345. Tasker Layout: On
  346. Title: Success
  347. Continue Task Immediately: On
  348. Dismiss On Click: On ]
  349.  
  350. A26: Else
  351.  
  352. A27: Flash [
  353. Text: XiaomiEU.pif.json not found
  354. Tasker Layout: On
  355. Continue Task Immediately: On
  356. Dismiss On Click: On ]
  357.  
  358. A28: End If
  359.  
  360. A29: Else
  361.  
  362. A30: Flash [
  363. Text: PIF module for Magisk or KSU not found
  364. Tasker Layout: On
  365. Continue Task Immediately: On
  366. Dismiss On Click: On ]
  367.  
  368. A31: End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement