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
|
--- a/build/app/smali/jp/f4samurai/bridge/NativeBridge.smali
|
||||||
+++ b/build/app/smali/jp/f4samurai/bridge/NativeBridge.smali
|
+++ b/build/app/smali/jp/f4samurai/bridge/NativeBridge.smali
|
||||||
@@ -8,8 +8,6 @@
|
@@ -8,8 +8,6 @@
|
||||||
|
|
||||||
.field private static sAppActivity:Ljp/f4samurai/AppActivity;
|
.field private static sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
|
|
||||||
-.field private static sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
-.field private static sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
||||||
-
|
-
|
||||||
.field private static sClipboardManager:Landroid/content/ClipboardManager;
|
.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;
|
sput-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
|
|
||||||
.line 37
|
- .line 39
|
||||||
- new-instance v0, Ljp/f4samurai/bridge/CheatHandler;
|
- new-instance v0, Ljp/f4samurai/bridge/CheatHandler;
|
||||||
-
|
-
|
||||||
- sget-object v1, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
- sget-object v1, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
|
-
|
||||||
- invoke-direct {v0, v1}, Ljp/f4samurai/bridge/CheatHandler;-><init>(Landroid/content/Context;)V
|
- 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;
|
- 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;
|
invoke-static {}, Ljp/f4samurai/AppActivity;->getContext()Landroid/content/Context;
|
||||||
@@ -531,11 +523,8 @@
|
|
||||||
|
@@ -539,11 +528,7 @@
|
||||||
.locals 1
|
.locals 1
|
||||||
|
|
||||||
.line 181
|
.line 195
|
||||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sCheatHandler:Ljp/f4samurai/bridge/CheatHandler;
|
||||||
|
-
|
||||||
- invoke-virtual {v0}, Ljp/f4samurai/bridge/CheatHandler;->isUnauthorizedUser()Z
|
- invoke-virtual {v0}, Ljp/f4samurai/bridge/CheatHandler;->isUnauthorizedUser()Z
|
||||||
-
|
-
|
||||||
- move-result v0
|
- move-result v0
|
||||||
+ const v0, 0
|
+ const v0, 0
|
||||||
|
|
||||||
return v0
|
return v0
|
||||||
.end method
|
.end method
|
||||||
@@ -626,13 +615,6 @@
|
@@ -649,13 +634,6 @@
|
||||||
.locals 2
|
.locals 2
|
||||||
|
|
||||||
.line 121
|
.line 123
|
||||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
-
|
-
|
||||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$2;
|
- 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-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
|
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||||
|
|
||||||
return-void
|
return-void
|
||||||
.end method
|
.end method
|
||||||
@@ -641,13 +623,6 @@
|
@@ -664,13 +642,6 @@
|
||||||
.locals 2
|
.locals 2
|
||||||
|
|
||||||
.line 130
|
.line 132
|
||||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
-
|
-
|
||||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$3;
|
- 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-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
|
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||||
|
|
||||||
return-void
|
return-void
|
||||||
.end method
|
.end method
|
||||||
@@ -656,13 +631,6 @@
|
@@ -679,13 +650,6 @@
|
||||||
.locals 2
|
.locals 2
|
||||||
|
|
||||||
.line 112
|
.line 114
|
||||||
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
- sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
|
||||||
-
|
-
|
||||||
- new-instance v1, Ljp/f4samurai/bridge/NativeBridge$1;
|
- 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-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
|
- invoke-virtual {v0, v1}, Ljp/f4samurai/AppActivity;->runOnUiThread(Ljava/lang/Runnable;)V
|
||||||
|
|
||||||
return-void
|
return-void
|
||||||
.end method
|
.end method
|
||||||
|
|
|
@ -118,7 +118,7 @@ int *sceneLayerManagerCreateSceneLayer(uintptr_t *sceneLayerManager, BaseSceneLa
|
||||||
LOGW("Unknown scene triggered. %d", sceneType);
|
LOGW("Unknown scene triggered. %d", sceneType);
|
||||||
}
|
}
|
||||||
else {
|
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
|
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);
|
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) {
|
void initialization_error(const char* error) {
|
||||||
LOGE("%s", 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);
|
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
|
// For debugging
|
||||||
//DobbyHook(lookup_symbol(libLocation, "_ZN5http212Http2Session6setURIERKSs"), (void *)setUriDebug, (void **)&setUriDebugOld); - crashes arm32 now.
|
//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
|
// Hooks
|
||||||
void *cocos2dnodeSetPosition = lookup_symbol(libLocation, "_ZN7cocos2d4Node11setPositionERKNS_4Vec2E");
|
void *cocos2dnodeSetPosition = lookup_symbol(libLocation, "_ZN7cocos2d4Node11setPositionERKNS_4Vec2E");
|
||||||
|
|
|
@ -2,7 +2,9 @@ enum BaseSceneLayerType {
|
||||||
DebugMenuSceneLayer,
|
DebugMenuSceneLayer,
|
||||||
DebugSelectQuestSceneLayer,
|
DebugSelectQuestSceneLayer,
|
||||||
DebugSelectStorySceneLayer,
|
DebugSelectStorySceneLayer,
|
||||||
|
SoundViewerSceneLayer,
|
||||||
DebugSelectMysteriesSceneLayer,
|
DebugSelectMysteriesSceneLayer,
|
||||||
|
AnimeViewerSceneLayer,
|
||||||
CameraSceneLayer,
|
CameraSceneLayer,
|
||||||
WebSceneLayer,
|
WebSceneLayer,
|
||||||
StartupSceneLayer,
|
StartupSceneLayer,
|
||||||
|
@ -14,6 +16,7 @@ enum BaseSceneLayerType {
|
||||||
EventSingleRaidSceneLayer,
|
EventSingleRaidSceneLayer,
|
||||||
EventDungeonSceneLayer,
|
EventDungeonSceneLayer,
|
||||||
EventRaidSceneLayer,
|
EventRaidSceneLayer,
|
||||||
|
EventPuellaHistoriaSceneLayer,
|
||||||
QuestBattleSceneLayer,
|
QuestBattleSceneLayer,
|
||||||
QuestUnitTestSceneLayer,
|
QuestUnitTestSceneLayer,
|
||||||
EvolutionSceneLayer,
|
EvolutionSceneLayer,
|
||||||
|
@ -28,6 +31,7 @@ enum BaseSceneLayerType {
|
||||||
QuestStoredDataSceneLayer,
|
QuestStoredDataSceneLayer,
|
||||||
SendReplayDataSceneLayer,
|
SendReplayDataSceneLayer,
|
||||||
InputTextSceneLayer,
|
InputTextSceneLayer,
|
||||||
|
SpfxViewerSceneLayer,
|
||||||
LoadingSceneLayer,
|
LoadingSceneLayer,
|
||||||
ErrorSceneLayer,
|
ErrorSceneLayer,
|
||||||
NetworkErrorSceneLayer,
|
NetworkErrorSceneLayer,
|
||||||
|
@ -42,7 +46,9 @@ char const* BaseSceneLayerTypeStrings[] {
|
||||||
"DebugMenuSceneLayer",
|
"DebugMenuSceneLayer",
|
||||||
"DebugSelectQuestSceneLayer",
|
"DebugSelectQuestSceneLayer",
|
||||||
"DebugSelectStorySceneLayer",
|
"DebugSelectStorySceneLayer",
|
||||||
|
"SoundViewerSceneLayer",
|
||||||
"DebugSelectMysteriesSceneLayer",
|
"DebugSelectMysteriesSceneLayer",
|
||||||
|
"AnimeViewerSceneLayer",
|
||||||
"CameraSceneLayer",
|
"CameraSceneLayer",
|
||||||
"WebSceneLayer",
|
"WebSceneLayer",
|
||||||
"StartupSceneLayer",
|
"StartupSceneLayer",
|
||||||
|
@ -54,6 +60,7 @@ char const* BaseSceneLayerTypeStrings[] {
|
||||||
"EventSingleRaidSceneLayer",
|
"EventSingleRaidSceneLayer",
|
||||||
"EventDungeonSceneLayer",
|
"EventDungeonSceneLayer",
|
||||||
"EventRaidSceneLayer",
|
"EventRaidSceneLayer",
|
||||||
|
"EventPuellaHistoriaSceneLayer",
|
||||||
"QuestBattleSceneLayer",
|
"QuestBattleSceneLayer",
|
||||||
"QuestUnitTestSceneLayer",
|
"QuestUnitTestSceneLayer",
|
||||||
"EvolutionSceneLayer",
|
"EvolutionSceneLayer",
|
||||||
|
@ -68,6 +75,7 @@ char const* BaseSceneLayerTypeStrings[] {
|
||||||
"QuestStoredDataSceneLayer",
|
"QuestStoredDataSceneLayer",
|
||||||
"SendReplayDataSceneLayer",
|
"SendReplayDataSceneLayer",
|
||||||
"InputTextSceneLayer",
|
"InputTextSceneLayer",
|
||||||
|
"SpfxViewerSceneLayer",
|
||||||
"LoadingSceneLayer",
|
"LoadingSceneLayer",
|
||||||
"ErrorSceneLayer",
|
"ErrorSceneLayer",
|
||||||
"NetworkErrorSceneLayer",
|
"NetworkErrorSceneLayer",
|
||||||
|
|
Loading…
Reference in New Issue