Skip to content

Commit

Permalink
Enhance
Browse files Browse the repository at this point in the history
  • Loading branch information
Keeperorowner committed Dec 23, 2024
1 parent 3b43d9c commit ebe8cfb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
20 changes: 10 additions & 10 deletions app/src/main/java/cc/ioctl/tmoe/hook/func/BoostSpeed.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ object BoostSpeed : CommonDynamicHook() {
findMethod(loadClass("org.telegram.messenger.FileLoadOperation")) {
name == "updateParams"
}.hookAfter { param ->
if (!isEnabled) return@hookAfter
XposedHelpers.setIntField(param.thisObject, "downloadChunkSizeBig", 1048576)
XposedHelpers.setObjectField(param.thisObject, "maxDownloadRequests", 12)
XposedHelpers.setObjectField(param.thisObject, "maxDownloadRequestsBig", 12)
XposedHelpers.setObjectField(param.thisObject, "maxCdnParts", 2097152000 / 1048576)
}
if (!isEnabled) return@hookAfter
XposedHelpers.setIntField(param.thisObject, "downloadChunkSizeBig", 1048576)
XposedHelpers.setObjectField(param.thisObject, "maxDownloadRequests", 12)
XposedHelpers.setObjectField(param.thisObject, "maxDownloadRequestsBig", 12)
XposedHelpers.setObjectField(param.thisObject, "maxCdnParts", 2097152000 / 1048576)
}

findMethod(loadClass("org.telegram.messenger.FileUploadOperation")) {
name == "startUploadRequest"
}.hookAfter { param ->
if (!isEnabled) return@hookAfter
XposedHelpers.setIntField(param.thisObject, "uploadChunkSize", 1048576)
XposedHelpers.setObjectField(param.thisObject, "maxRequestsCount", 8)
}
if (!isEnabled) return@hookAfter
XposedHelpers.setIntField(param.thisObject, "uploadChunkSize", 1048576)
XposedHelpers.setObjectField(param.thisObject, "maxRequestsCount", 8)
}
}
}
14 changes: 6 additions & 8 deletions app/src/main/java/cc/ioctl/tmoe/hook/func/GhostMode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ object GhostMode : CommonDynamicHook() {
it.result = null
}


findMethod(loadClass("org.telegram.ui.ChatActivity\$ChatActivityEnterViewDelegate")) {
name == "needSendTyping"
}.hookBefore {
if (!isEnabled) return@hookBefore
it.result = null
}


findMethod(loadClass("org.telegram.ui.Stories.StoriesController")) {
name == "markStoryAsRead"
}.hookBefore {
Expand All @@ -45,13 +43,13 @@ object GhostMode : CommonDynamicHook() {
parameterTypes[8] == java.lang.Boolean.TYPE &&
parameterTypes[9] == Integer.TYPE
}.hookBefore { param ->
if (!isEnabled) return@hookBefore
val updateStatusClass = loadClass("org.telegram.tgnet.TLRPC\$TL_account_updateStatus")
val requestObject = param.args[0]
if (!isEnabled) return@hookBefore
val updateStatusClass = loadClass("org.telegram.tgnet.TLRPC\$TL_account_updateStatus")
val requestObject = param.args[0]

if (updateStatusClass.isInstance(requestObject)) {
XposedHelpers.setBooleanField(requestObject, "offline", true)
}
if (updateStatusClass.isInstance(requestObject)) {
XposedHelpers.setBooleanField(requestObject, "offline", true)
}
}
}
}

0 comments on commit ebe8cfb

Please sign in to comment.