fix(nodataperm): prevent crash when uninstalling on Android 13 #249

Merged
gerrybagaskoro merged 1 commits from fix-nodataperm-android13 into main 2025-11-11 13:37:38 -05:00
+14 -6
View File
@@ -10,19 +10,23 @@ from tools import container
class Nodataperm(General):
id = "nodataperm"
dl_links = {
"11":
{
"11": {
"x86_64": [
"https://github.com/ayasa520/hack_full_data_permission/archive/d4beab7780eb792059d33e77d865579c9ee41546.zip",
"b0e3908ffcf5df8ea62f4929aa680f1a"
],
},
"13": {
"x86_64": [
"https://github.com/ayasa520/hack_full_data_permission/archive/d4beab7780eb792059d33e77d865579c9ee41546.zip",
"b0e3908ffcf5df8ea62f4929aa680f1a"
],
},
"13": {}
}
dl_file_name = "nodataperm.zip"
extract_to = "/tmp/nodataperm"
aleasto commented 2025-11-11 13:28:46 -05:00 (Migrated from github.com)
Review

There's no way that the same prebuilt services.jar can work for both Android 11 and Android 13.

Actually this should have never been shipping a prebuilt services.jar in the first place...

There's no way that the same prebuilt services.jar can work for both Android 11 and Android 13. Actually this should have never been shipping a prebuilt services.jar in the first place...
gerrybagaskoro commented 2025-11-11 13:36:05 -05:00 (Migrated from github.com)
Review

I see, that makes sense.
This PR just makes sure that if someone accidentally runs the script on Android 13, they can safely uninstall it and recover from a bootloop instead of getting stuck...

I see, that makes sense. This PR just makes sure that if someone accidentally runs the script on Android 13, they can safely uninstall it and recover from a bootloop instead of getting stuck...
aleasto commented 2025-11-11 13:37:35 -05:00 (Migrated from github.com)
Review

Ehh alright.

Ehh alright.
dl_link = ...
act_md5 = ...
dl_link = None
act_md5 = None
partition = "system"
files = [
"etc/nodataperm.sh",
@@ -36,11 +40,15 @@ class Nodataperm(General):
super().__init__()
print("ok")
arch = self.arch[0]
if android_version not in self.dl_links:
raise KeyError(f"No download links for Android version '{android_version}'")
if arch not in self.dl_links[android_version]:
raise KeyError(f"No download links for architecture '{arch}' in Android version '{android_version}'")
self.dl_link = self.dl_links[android_version][arch][0]
self.act_md5 = self.dl_links[android_version][arch][1]
def copy(self):
name = re.findall("([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
name = re.findall(r"([a-zA-Z0-9]+)\.zip", self.dl_link)[0]
extract_path = os.path.join(
self.extract_to, f"hack_full_data_permission-{name}")
if not container.use_overlayfs():