This commit is contained in:
@@ -6,33 +6,30 @@
|
||||
}
|
||||
"""
|
||||
|
||||
priority = 0
|
||||
__author__ = "wowlikon <wowlikon@gmail.com>"
|
||||
__version__ = "1.0.0"
|
||||
from typing import Any, Dict, List
|
||||
|
||||
# imports
|
||||
from tqdm import tqdm
|
||||
from typing import Dict, List, Any
|
||||
from pydantic import Field
|
||||
|
||||
from utils.config import PatchConfig
|
||||
from utils.config import PatchTemplate
|
||||
from utils.public import insert_after_id, insert_after_public
|
||||
from utils.smali_parser import float_to_hex
|
||||
from utils.public import (
|
||||
insert_after_public,
|
||||
insert_after_id,
|
||||
)
|
||||
|
||||
#Config
|
||||
class Config(PatchConfig):
|
||||
speeds: List[float] = Field([9.0], description="Список пользовательских скоростей воспроизведения")
|
||||
|
||||
|
||||
# Patch
|
||||
def apply(config: Config, base: Dict[str, Any]) -> bool:
|
||||
assert float_to_hex(1.5) == "0x3fc00000"
|
||||
class Patch(PatchTemplate):
|
||||
priority: int = Field(frozen=True, exclude=True, default=0)
|
||||
speeds: List[float] = Field(
|
||||
[9.0], description="Список пользовательских скоростей воспроизведения"
|
||||
)
|
||||
|
||||
last = "speed75"
|
||||
for speed in config.speeds:
|
||||
insert_after_public(last, f"speed{int(float(speed)*10)}")
|
||||
insert_after_id(last, f"speed{int(float(speed)*10)}")
|
||||
last = f"speed{int(float(speed)*10)}"
|
||||
def apply(self, base: Dict[str, Any]) -> bool:
|
||||
assert float_to_hex(1.5) == "0x3fc00000"
|
||||
|
||||
return False
|
||||
last = "speed75"
|
||||
for speed in self.speeds:
|
||||
insert_after_public(last, f"speed{int(float(speed)*10)}")
|
||||
insert_after_id(last, f"speed{int(float(speed)*10)}")
|
||||
last = f"speed{int(float(speed)*10)}"
|
||||
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user