forked from chinosk/gkms-local
parent
8c850ad7db
commit
bd9bcae01d
|
@ -16,7 +16,7 @@ android {
|
||||||
minSdk 29
|
minSdk 29
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 4
|
versionCode 4
|
||||||
versionName "v1.6.3"
|
versionName "v1.6.4"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
|
|
@ -763,6 +763,32 @@ namespace GakumasLocal::HookMain {
|
||||||
CampusActorController_LateUpdate_Orig(self, mtd);
|
CampusActorController_LateUpdate_Orig(self, mtd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_HOOK(bool, PlatformInformation_get_IsAndroid, ()) {
|
||||||
|
if (Config::loginAsIOS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Log::DebugFmt("PlatformInformation_get_IsAndroid: 0x%x", ret);
|
||||||
|
return PlatformInformation_get_IsAndroid_Orig();
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_HOOK(bool, PlatformInformation_get_IsIOS, ()) {
|
||||||
|
if (Config::loginAsIOS) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Log::DebugFmt("PlatformInformation_get_IsIOS: 0x%x", ret);
|
||||||
|
return PlatformInformation_get_IsIOS_Orig();
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_HOOK(Il2cppString*, ApiBase_GetPlatformString, (void* self, void* mtd)) {
|
||||||
|
if (Config::loginAsIOS) {
|
||||||
|
return Il2cppString::New("iOS");
|
||||||
|
}
|
||||||
|
// auto ret = ApiBase_GetPlatformString_Orig(self, mtd);
|
||||||
|
// Log::DebugFmt("ApiBase_GetPlatformString: %s", ret->ToString().c_str());
|
||||||
|
return ApiBase_GetPlatformString_Orig(self, mtd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void UpdateSwingBreastBonesData(void* initializeData) {
|
void UpdateSwingBreastBonesData(void* initializeData) {
|
||||||
if (!Config::enableBreastParam) return;
|
if (!Config::enableBreastParam) return;
|
||||||
static auto CampusActorAnimationInitializeData_klass = Il2cppUtils::GetClass("campus-submodule.Runtime.dll", "ActorAnimation",
|
static auto CampusActorAnimationInitializeData_klass = Il2cppUtils::GetClass("campus-submodule.Runtime.dll", "ActorAnimation",
|
||||||
|
@ -954,6 +980,22 @@ namespace GakumasLocal::HookMain {
|
||||||
ADD_HOOK(CampusActorController_LateUpdate,
|
ADD_HOOK(CampusActorController_LateUpdate,
|
||||||
Il2cppUtils::GetMethodPointer("campus-submodule.Runtime.dll", "Campus.Common",
|
Il2cppUtils::GetMethodPointer("campus-submodule.Runtime.dll", "Campus.Common",
|
||||||
"CampusActorController", "LateUpdate"));
|
"CampusActorController", "LateUpdate"));
|
||||||
|
|
||||||
|
ADD_HOOK(PlatformInformation_get_IsAndroid, Il2cppUtils::GetMethodPointer("Firebase.Platform.dll", "Firebase.Platform",
|
||||||
|
"PlatformInformation", "get_IsAndroid"));
|
||||||
|
ADD_HOOK(PlatformInformation_get_IsIOS, Il2cppUtils::GetMethodPointer("Firebase.Platform.dll", "Firebase.Platform",
|
||||||
|
"PlatformInformation", "get_IsIOS"));
|
||||||
|
|
||||||
|
auto api_klass = Il2cppUtils::GetClass("Assembly-CSharp.dll", "Campus.Common.Network", "Api");
|
||||||
|
if (api_klass) {
|
||||||
|
// Qua.Network.ApiBase
|
||||||
|
auto api_parent = UnityResolve::Invoke<Il2cppUtils::Il2CppClassHead*>("il2cpp_class_get_parent", api_klass->address);
|
||||||
|
if (api_parent) {
|
||||||
|
// Log::DebugFmt("api_parent at %p, name: %s::%s", api_parent, api_parent->namespaze, api_parent->name);
|
||||||
|
ADD_HOOK(ApiBase_GetPlatformString, Il2cppUtils::il2cpp_class_get_method_from_name(api_parent, "GetPlatformString", 0)->methodPointer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static auto CampusActorController_klass = Il2cppUtils::GetClass("campus-submodule.Runtime.dll",
|
static auto CampusActorController_klass = Il2cppUtils::GetClass("campus-submodule.Runtime.dll",
|
||||||
"Campus.Common", "CampusActorController");
|
"Campus.Common", "CampusActorController");
|
||||||
|
|
|
@ -21,6 +21,8 @@ namespace GakumasLocal::Config {
|
||||||
std::string liveCustomeHeadId = "";
|
std::string liveCustomeHeadId = "";
|
||||||
std::string liveCustomeCostumeId = "";
|
std::string liveCustomeCostumeId = "";
|
||||||
|
|
||||||
|
bool loginAsIOS = false;
|
||||||
|
|
||||||
bool useCustomeGraphicSettings = false;
|
bool useCustomeGraphicSettings = false;
|
||||||
float renderScale = 0.77f;
|
float renderScale = 0.77f;
|
||||||
int qualitySettingsLevel = 3;
|
int qualitySettingsLevel = 3;
|
||||||
|
@ -68,6 +70,7 @@ namespace GakumasLocal::Config {
|
||||||
GetConfigItem(enableLiveCustomeDress);
|
GetConfigItem(enableLiveCustomeDress);
|
||||||
GetConfigItem(liveCustomeHeadId);
|
GetConfigItem(liveCustomeHeadId);
|
||||||
GetConfigItem(liveCustomeCostumeId);
|
GetConfigItem(liveCustomeCostumeId);
|
||||||
|
GetConfigItem(loginAsIOS);
|
||||||
GetConfigItem(useCustomeGraphicSettings);
|
GetConfigItem(useCustomeGraphicSettings);
|
||||||
GetConfigItem(renderScale);
|
GetConfigItem(renderScale);
|
||||||
GetConfigItem(qualitySettingsLevel);
|
GetConfigItem(qualitySettingsLevel);
|
||||||
|
|
|
@ -19,6 +19,8 @@ namespace GakumasLocal::Config {
|
||||||
extern std::string liveCustomeHeadId;
|
extern std::string liveCustomeHeadId;
|
||||||
extern std::string liveCustomeCostumeId;
|
extern std::string liveCustomeCostumeId;
|
||||||
|
|
||||||
|
extern bool loginAsIOS;
|
||||||
|
|
||||||
extern bool useCustomeGraphicSettings;
|
extern bool useCustomeGraphicSettings;
|
||||||
extern float renderScale;
|
extern float renderScale;
|
||||||
extern int qualitySettingsLevel;
|
extern int qualitySettingsLevel;
|
||||||
|
|
|
@ -17,6 +17,7 @@ import kotlinx.coroutines.runBlocking
|
||||||
interface ConfigListener {
|
interface ConfigListener {
|
||||||
fun onEnabledChanged(value: Boolean)
|
fun onEnabledChanged(value: Boolean)
|
||||||
fun onForceExportResourceChanged(value: Boolean)
|
fun onForceExportResourceChanged(value: Boolean)
|
||||||
|
fun onLoginAsIOSChanged(value: Boolean)
|
||||||
fun onTextTestChanged(value: Boolean)
|
fun onTextTestChanged(value: Boolean)
|
||||||
fun onReplaceFontChanged(value: Boolean)
|
fun onReplaceFontChanged(value: Boolean)
|
||||||
fun onLazyInitChanged(value: Boolean)
|
fun onLazyInitChanged(value: Boolean)
|
||||||
|
@ -115,6 +116,11 @@ interface ConfigUpdateListener: ConfigListener, IHasConfigItems {
|
||||||
pushKeyEvent(KeyEvent(1145, 30))
|
pushKeyEvent(KeyEvent(1145, 30))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onLoginAsIOSChanged(value: Boolean) {
|
||||||
|
config.loginAsIOS = value
|
||||||
|
saveConfig()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onReplaceFontChanged(value: Boolean) {
|
override fun onReplaceFontChanged(value: Boolean) {
|
||||||
config.replaceFont = value
|
config.replaceFont = value
|
||||||
saveConfig()
|
saveConfig()
|
||||||
|
|
|
@ -84,7 +84,7 @@ object FilesChecker {
|
||||||
for (i in assets.list(localizationFilesDir)!!) {
|
for (i in assets.list(localizationFilesDir)!!) {
|
||||||
if (i.toString() == "version.txt") {
|
if (i.toString() == "version.txt") {
|
||||||
val stream = assets.open("$localizationFilesDir/$i")
|
val stream = assets.open("$localizationFilesDir/$i")
|
||||||
return convertToString(stream)
|
return convertToString(stream).trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "0.0"
|
return "0.0"
|
||||||
|
@ -96,7 +96,7 @@ object FilesChecker {
|
||||||
|
|
||||||
val versionFile = File(pluginFilesDir, "version.txt")
|
val versionFile = File(pluginFilesDir, "version.txt")
|
||||||
if (!versionFile.exists()) return "0.0"
|
if (!versionFile.exists()) return "0.0"
|
||||||
return versionFile.readText()
|
return versionFile.readText().trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun convertToString(inputStream: InputStream?): String {
|
fun convertToString(inputStream: InputStream?): String {
|
||||||
|
|
|
@ -19,6 +19,8 @@ data class GakumasConfig (
|
||||||
var liveCustomeHeadId: String = "",
|
var liveCustomeHeadId: String = "",
|
||||||
var liveCustomeCostumeId: String = "",
|
var liveCustomeCostumeId: String = "",
|
||||||
|
|
||||||
|
var loginAsIOS: Boolean = false,
|
||||||
|
|
||||||
var useCustomeGraphicSettings: Boolean = false,
|
var useCustomeGraphicSettings: Boolean = false,
|
||||||
var renderScale: Float = 0.77f,
|
var renderScale: Float = 0.77f,
|
||||||
var qualitySettingsLevel: Int = 3,
|
var qualitySettingsLevel: Int = 3,
|
||||||
|
|
|
@ -86,6 +86,10 @@ fun AdvanceSettingsPage(modifier: Modifier = Modifier,
|
||||||
GakuSwitch(modifier, stringResource(R.string.force_export_resource), checked = config.value.forceExportResource) {
|
GakuSwitch(modifier, stringResource(R.string.force_export_resource), checked = config.value.forceExportResource) {
|
||||||
v -> context?.onForceExportResourceChanged(v)
|
v -> context?.onForceExportResourceChanged(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GakuSwitch(modifier, stringResource(R.string.login_as_ios), checked = config.value.loginAsIOS) {
|
||||||
|
v -> context?.onLoginAsIOSChanged(v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
<string name="export_text">テキストをエクスポート</string>
|
<string name="export_text">テキストをエクスポート</string>
|
||||||
<string name="exposed_dropdown_menu_content_description">ドロップダウンメニューを表示</string>
|
<string name="exposed_dropdown_menu_content_description">ドロップダウンメニューを表示</string>
|
||||||
<string name="force_export_resource">リソースのアップデートを強制する</string>
|
<string name="force_export_resource">リソースのアップデートを強制する</string>
|
||||||
|
<string name="login_as_ios">iOSとしてログイン</string>
|
||||||
<string name="gakumas_localify">Gakumas Localify</string>
|
<string name="gakumas_localify">Gakumas Localify</string>
|
||||||
<string name="game_patch">ゲームパッチ</string>
|
<string name="game_patch">ゲームパッチ</string>
|
||||||
<string name="graphic_settings">グラフィック設定</string>
|
<string name="graphic_settings">グラフィック設定</string>
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<string name="text_hook_test_mode">文本 hook 测试模式</string>
|
<string name="text_hook_test_mode">文本 hook 测试模式</string>
|
||||||
<string name="export_text">导出文本</string>
|
<string name="export_text">导出文本</string>
|
||||||
<string name="force_export_resource">启动后强制导出资源</string>
|
<string name="force_export_resource">启动后强制导出资源</string>
|
||||||
|
<string name="login_as_ios">以 iOS 登陆</string>
|
||||||
<string name="max_high">极高</string>
|
<string name="max_high">极高</string>
|
||||||
<string name="very_high">超高</string>
|
<string name="very_high">超高</string>
|
||||||
<string name="hign">高</string>
|
<string name="hign">高</string>
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
<string name="text_hook_test_mode">Text Hook Test Mode</string>
|
<string name="text_hook_test_mode">Text Hook Test Mode</string>
|
||||||
<string name="export_text">Export Text</string>
|
<string name="export_text">Export Text</string>
|
||||||
<string name="force_export_resource">Force Update Resource</string>
|
<string name="force_export_resource">Force Update Resource</string>
|
||||||
|
<string name="login_as_ios">Login as iOS</string>
|
||||||
<string name="max_high">Ultra</string>
|
<string name="max_high">Ultra</string>
|
||||||
<string name="very_high">Very High</string>
|
<string name="very_high">Very High</string>
|
||||||
<string name="hign">High</string>
|
<string name="hign">High</string>
|
||||||
|
|
Loading…
Reference in New Issue