A pair of people can have a kitten, a puppy or a lion cub in place of TikTok's streak creature: it grows with the days of the streak (cub, teen, adult, elder), goes grey while the streak is about to burn out, can be dragged in the chat and is also shown on the big streak screen. An animal is given by a link (lihont.space/pet) that the friend accepts. The drawings are made by scripts/make_pet_designs.py and served as strips of frames. Also here: the promo video scripts (make_pet_video.py on top of make_store_video.py), a retry pause for strips that failed to load, stricter checks in the answer to a gift. Work in progress: the gift service is not switched on for everyone yet and there is no public build with the animals. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
41 lines
1.9 KiB
Python
41 lines
1.9 KiB
Python
"""Seek bar on every video: with the switch on, TikTok never hides the scrubbing bar under a video.
|
|
|
|
TikTok 47.1.3 decides how the bar looks in LX/1Azi;->setSeekBarShowType(I)V: types 0, 1, 2, 4 and 0x64..0x66 show it in
|
|
different ways, type 3 hides it (it makes the view gone and stops dragging). With the switch on the type 3 is read as
|
|
type 0, the plain visible bar. With it off, or for any other type, TikTok's own code runs untouched.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
|
|
SEEKBAR_CLASS = "LX/1Azi;"
|
|
HOOK = "Llihont/two/look/Seekbar;->type(I)I"
|
|
|
|
_METHOD = re.compile(r"^\.method public final setSeekBarShowType\(I\)V\n.*?^\.end method", re.M | re.S)
|
|
_FIRST = re.compile(r"^ iget v0, p0, LX/1Azi;->\w+:I\n", re.M)
|
|
|
|
|
|
def runtime_targets():
|
|
"""Runtime methods the rewrite calls, as they appear in a method table."""
|
|
return [HOOK]
|
|
|
|
|
|
def rewrite_seek_bar(text: str) -> str:
|
|
"""Let the runtime change the show type before TikTok looks at it."""
|
|
match = _METHOD.search(text)
|
|
if match is None:
|
|
raise ValueError("LX/1Azi;->setSeekBarShowType(I)V not found")
|
|
method = match.group()
|
|
if "Seekbar;" in method:
|
|
raise ValueError("Seekbar hook already present in LX/1Azi;->setSeekBarShowType")
|
|
# The shape that identifies it: it logs the change and hides the bar with visibility 8 for one of the types.
|
|
if "seekbar show type change, change to:" not in method or "const/16 v0, 0x8" not in method:
|
|
raise ValueError("LX/1Azi;->setSeekBarShowType has an unexpected shape")
|
|
first = _FIRST.search(method)
|
|
if first is None:
|
|
raise ValueError("LX/1Azi;->setSeekBarShowType does not start with the expected type check")
|
|
injected = " invoke-static {p1}, %s\n\n move-result p1\n\n" % HOOK
|
|
patched = method[:first.start()] + injected + method[first.start():]
|
|
return text[:match.start()] + patched + text[match.end():]
|