3.0.4 fixes & audio bug fix
This commit is contained in:
parent
eb5eab277f
commit
31c73fef26
|
@ -3,45 +3,47 @@ index 6012fad..681a112 100644
|
|||
--- a/build/app/smali/jp/f4samurai/bridge/NativeBridge.smali
|
||||
+++ b/build/app/smali/jp/f4samurai/bridge/NativeBridge.smali
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
|
||||
.field private static sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
|
||||
|
||||
-.field private static sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
||||
-
|
||||
.field private static sClipboardManager:Landroid/content/ClipboardManager;
|
||||
|
||||
|
||||
@@ -36,13 +34,7 @@
|
||||
|
||||
|
||||
@@ -43,15 +41,6 @@
|
||||
|
||||
sput-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
|
||||
.line 37
|
||||
|
||||
- .line 39
|
||||
- new-instance v0, Ljp/f4samurai/bridge/CheatHandler;
|
||||
-
|
||||
- sget-object v1, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
|
||||
-
|
||||
- invoke-direct {v0, v1}, Ljp/f4samurai/bridge/CheatHandler;-><init>(Landroid/content/Context;)V
|
||||
-
|
||||
- sput-object v0, Ljp/f4samurai/bridge/NativeBridge;->sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
||||
|
||||
.line 38
|
||||
-
|
||||
.line 40
|
||||
invoke-static {}, Ljp/f4samurai/AppActivity;->getContext()Landroid/content/Context;
|
||||
@@ -531,11 +523,8 @@
|
||||
|
||||
@@ -539,11 +528,7 @@
|
||||
.locals 1
|
||||
|
||||
.line 181
|
||||
|
||||
.line 195
|
||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
||||
|
||||
-
|
||||
- invoke-virtual {v0}, Ljp/f4samurai/bridge/CheatHandler;->isUnauthorizedUser()Z
|
||||
-
|
||||
- move-result v0
|
||||
+ const v0, 0
|
||||
|
||||
|
||||
return v0
|
||||
.end method
|
||||
@@ -626,13 +615,6 @@
|
||||
@@ -649,13 +634,6 @@
|
||||
.locals 2
|
||||
|
||||
.line 121
|
||||
|
||||
.line 123
|
||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
-
|
||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$2;
|
||||
|
@ -49,13 +51,13 @@ index 6012fad..681a112 100644
|
|||
- invoke-direct {v1, p0}, Ljp/f4samurai/bridge/NativeBridge$2;-><init>(Ljava/lang/String;)V
|
||||
-
|
||||
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -641,13 +623,6 @@
|
||||
@@ -664,13 +642,6 @@
|
||||
.locals 2
|
||||
|
||||
.line 130
|
||||
|
||||
.line 132
|
||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
-
|
||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$3;
|
||||
|
@ -63,13 +65,13 @@ index 6012fad..681a112 100644
|
|||
- invoke-direct {v1, p0, p1}, Ljp/f4samurai/bridge/NativeBridge$3;-><init>(Ljava/lang/String;Ljava/lang/String;)V
|
||||
-
|
||||
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||
|
||||
|
||||
return-void
|
||||
.end method
|
||||
@@ -656,13 +631,6 @@
|
||||
@@ -679,13 +650,6 @@
|
||||
.locals 2
|
||||
|
||||
.line 112
|
||||
|
||||
.line 114
|
||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||
-
|
||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$1;
|
||||
|
@ -77,6 +79,6 @@ index 6012fad..681a112 100644
|
|||
- invoke-direct {v1, p0}, Ljp/f4samurai/bridge/NativeBridge$1;-><init>(Ljava/lang/String;)V
|
||||
-
|
||||
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
|
|
@ -118,7 +118,7 @@ int *sceneLayerManagerCreateSceneLayer(uintptr_t *sceneLayerManager, BaseSceneLa
|
|||
LOGW("Unknown scene triggered. %d", sceneType);
|
||||
}
|
||||
else {
|
||||
LOGD("Scene layer changed to: %s", BaseSceneLayerTypeStrings[sceneType]);
|
||||
LOGI("Scene layer changed to: %s", BaseSceneLayerTypeStrings[sceneType]);
|
||||
}
|
||||
|
||||
if (!initialized && sceneType == BaseSceneLayerType::WebSceneLayer) { // Set up everything here
|
||||
|
@ -453,6 +453,16 @@ pthread_mutex_t *http2SessionSetMaxConnectionNum(uintptr_t *session, int max) {
|
|||
return http2SessionSetMaxConnectionNumOld(session, max);
|
||||
}
|
||||
|
||||
uint32_t (*criNcv_GetHardwareSamplingRate_ANDROID_Hooked)();
|
||||
|
||||
uint32_t criNcv_GetHardwareSamplingRate_ANDROID() {
|
||||
auto value = criNcv_GetHardwareSamplingRate_ANDROID_Hooked();
|
||||
if (value == 44100) {
|
||||
return 48000;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
void initialization_error(const char* error) {
|
||||
LOGE("%s", error);
|
||||
auto errorMsg = string_format("A critical error has occurred, MagiaTranslate will not work properly and may crash. Please report this error on GitHub or Discord.\n%s", error);
|
||||
|
@ -508,6 +518,24 @@ void *hook_loop(void *arguments) {
|
|||
// For debugging
|
||||
//DobbyHook(lookup_symbol(libLocation, "_ZN5http212Http2Session6setURIERKSs"), (void *)setUriDebug, (void **)&setUriDebugOld); - crashes arm32 now.
|
||||
|
||||
// speed fix
|
||||
void *audioSampleRateFix = lookup_symbol(libLocation, "criNcv_GetHardwareSamplingRate_ANDROID");
|
||||
|
||||
if (audioSampleRateFix != nullptr) {
|
||||
LOGD("Found criNcv_GetHardwareSamplingRate_ANDROID at %p.", (void *)cocos2dnodeSetPosition);
|
||||
if (DobbyHook(audioSampleRateFix, (void *)criNcv_GetHardwareSamplingRate_ANDROID, (void **)&criNcv_GetHardwareSamplingRate_ANDROID_Hooked) == RS_SUCCESS) {
|
||||
LOGI("Successfully hooked criNcv_GetHardwareSamplingRate_ANDROID.");
|
||||
}
|
||||
else {
|
||||
initialization_error("Unable to hook criNcv_GetHardwareSamplingRate_ANDROID.");
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
}
|
||||
else {
|
||||
initialization_error("Unable to hook criNcv_GetHardwareSamplingRate_ANDROID.");
|
||||
pthread_exit(NULL);
|
||||
}
|
||||
|
||||
|
||||
// Hooks
|
||||
void *cocos2dnodeSetPosition = lookup_symbol(libLocation, "_ZN7cocos2d4Node11setPositionERKNS_4Vec2E");
|
||||
|
|
|
@ -2,7 +2,9 @@ enum BaseSceneLayerType {
|
|||
DebugMenuSceneLayer,
|
||||
DebugSelectQuestSceneLayer,
|
||||
DebugSelectStorySceneLayer,
|
||||
SoundViewerSceneLayer,
|
||||
DebugSelectMysteriesSceneLayer,
|
||||
AnimeViewerSceneLayer,
|
||||
CameraSceneLayer,
|
||||
WebSceneLayer,
|
||||
StartupSceneLayer,
|
||||
|
@ -14,6 +16,7 @@ enum BaseSceneLayerType {
|
|||
EventSingleRaidSceneLayer,
|
||||
EventDungeonSceneLayer,
|
||||
EventRaidSceneLayer,
|
||||
EventPuellaHistoriaSceneLayer,
|
||||
QuestBattleSceneLayer,
|
||||
QuestUnitTestSceneLayer,
|
||||
EvolutionSceneLayer,
|
||||
|
@ -28,6 +31,7 @@ enum BaseSceneLayerType {
|
|||
QuestStoredDataSceneLayer,
|
||||
SendReplayDataSceneLayer,
|
||||
InputTextSceneLayer,
|
||||
SpfxViewerSceneLayer,
|
||||
LoadingSceneLayer,
|
||||
ErrorSceneLayer,
|
||||
NetworkErrorSceneLayer,
|
||||
|
@ -42,7 +46,9 @@ char const* BaseSceneLayerTypeStrings[] {
|
|||
"DebugMenuSceneLayer",
|
||||
"DebugSelectQuestSceneLayer",
|
||||
"DebugSelectStorySceneLayer",
|
||||
"SoundViewerSceneLayer",
|
||||
"DebugSelectMysteriesSceneLayer",
|
||||
"AnimeViewerSceneLayer",
|
||||
"CameraSceneLayer",
|
||||
"WebSceneLayer",
|
||||
"StartupSceneLayer",
|
||||
|
@ -54,6 +60,7 @@ char const* BaseSceneLayerTypeStrings[] {
|
|||
"EventSingleRaidSceneLayer",
|
||||
"EventDungeonSceneLayer",
|
||||
"EventRaidSceneLayer",
|
||||
"EventPuellaHistoriaSceneLayer",
|
||||
"QuestBattleSceneLayer",
|
||||
"QuestUnitTestSceneLayer",
|
||||
"EvolutionSceneLayer",
|
||||
|
@ -68,6 +75,7 @@ char const* BaseSceneLayerTypeStrings[] {
|
|||
"QuestStoredDataSceneLayer",
|
||||
"SendReplayDataSceneLayer",
|
||||
"InputTextSceneLayer",
|
||||
"SpfxViewerSceneLayer",
|
||||
"LoadingSceneLayer",
|
||||
"ErrorSceneLayer",
|
||||
"NetworkErrorSceneLayer",
|
||||
|
|
Loading…
Reference in New Issue