Skip to content

Commit

Permalink
Batch rename chinosk6#2
Browse files Browse the repository at this point in the history
  • Loading branch information
CyleAR committed Jul 20, 2024
1 parent 79310ff commit 481520c
Show file tree
Hide file tree
Showing 60 changed files with 143 additions and 144 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:
- name: Update Assets
run: |
git submodule foreach --recursive git pull origin main
git clone https://${{ secrets.ACCESS_TOKEN_GITHUB }}@github.com/imas-tools/gakumas-raw-txts.git app/src/main/assets/gakumas-local/gakumas-raw-txts
mv app/src/main/assets/gakumas-local/gakumas-raw-txts/Resource app/src/main/assets/gakumas-local/raw
rm -rf app/src/main/assets/gakumas-local/gakumas-raw-txts
git clone https://${{ secrets.ACCESS_TOKEN_GITHUB }}@github.com/imas-tools/idolypride-raw-txts.git app/src/main/assets/idolypride-local/idolypride-raw-txts
mv app/src/main/assets/idolypride-local/idolypride-raw-txts/Resource app/src/main/assets/idolypride-local/raw
rm -rf app/src/main/assets/idolypride-local/idolypride-raw-txts
- name: Build Assets
run: |
mv app/src/main/assets/gakumas-local/GakumasPreTranslation/.env.sample app/src/main/assets/gakumas-local/GakumasPreTranslation/.env
cd app/src/main/assets/gakumas-local && make build-resource
mv app/src/main/assets/idolypride-local/IdolypridePreTranslation/.env.sample app/src/main/assets/idolypride-local/IdolypridePreTranslation/.env
cd app/src/main/assets/idolypride-local && make build-resource
- name: Write branch and commit info
run: |
branch=$(git rev-parse --abbrev-ref HEAD)
hash=$(git rev-parse --short=8 HEAD)
echo "$branch.$hash" > app/src/main/assets/gakumas-local/version.txt
echo "$branch.$hash" > app/src/main/assets/idolypride-local/version.txt
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "app/src/main/assets/gakumas-local"]
path = app/src/main/assets/gakumas-local
url = https://github.com/chinosk6/GakumasTranslationData.git
[submodule "app/src/main/assets/idolypride-local"]
path = app/src/main/assets/idolypride-local
url = https://github.com/chinosk6/IdolyprideTranslationData.git
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ android {
applicationVariants.configureEach { variant ->
variant.mergeAssetsProvider.configure { mergeAssetsTask ->
mergeAssetsTask.doLast {
delete(fileTree(dir: mergeAssetsTask.outputDir, includes: ['gakumas-local/gakuen-adapted-translation-data/**',
'gakumas-local/GakumasPreTranslation/**',
'gakumas-local/raw/**']))
delete(fileTree(dir: mergeAssetsTask.outputDir, includes: ['idolypride-local/gakuen-adapted-translation-data/**',
'idolypride-local/IdolypridePreTranslation/**',
'idolypride-local/raw/**']))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# hide the original source file name.
#-renamesourcefileattribute SourceFile

-keep class io.github.cylear.idolypride.addon.GakumasHookMain {
-keep class io.github.cylear.idolypride.addon.idolyprideHookMain {
<init>();
native <methods>;
}
4 changes: 2 additions & 2 deletions app/src/main/assets/about_contributors_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
{
"name": "And all other translators",
"links": [
{"name": "Github", "link": "https://github.com/chinosk6/GakumasTranslationData/graphs/contributors"}
{"name": "Github", "link": "https://github.com/chinosk6/IdolyprideTranslationData/graphs/contributors"}
]
}
],
"contrib_img": {
"plugin": "https://contrib.rocks/image?repo=chinosk6/gakuen-imas-localify",
"translation": "https://contrib.rocks/image?repo=chinosk6/GakumasTranslationData"
"translation": "https://contrib.rocks/image?repo=chinosk6/IdolyprideTranslationData"
}
}
1 change: 0 additions & 1 deletion app/src/main/assets/gakumas-local
Submodule gakumas-local deleted from a60a17
2 changes: 1 addition & 1 deletion app/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -1 +1 @@
io.github.cylear.idolypride.addon.GakumasHookMain
io.github.cylear.idolypride.addon.idolyprideHookMain
12 changes: 6 additions & 6 deletions app/src/main/cpp/IdolyprideAddon/Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ std::unordered_set<void*> hookedStubs{};
} \
else { \
hookedStubs.emplace(stub); \
GakumasLocal::Log::InfoFmt("ADD_HOOK: %s at %p", #name, addr); \
IdolyprideLocal::Log::InfoFmt("ADD_HOOK: %s at %p", #name, addr); \
} \
} \
else GakumasLocal::Log::ErrorFmt("Hook failed: %s is NULL", #name, addr)
else IdolyprideLocal::Log::ErrorFmt("Hook failed: %s is NULL", #name, addr)

void UnHookAll() {
for (const auto i: hookedStubs) {
Expand All @@ -48,12 +48,12 @@ void UnHookAll() {
{
int error_num = shadowhook_get_errno();
const char *error_msg = shadowhook_to_errmsg(error_num);
GakumasLocal::Log::ErrorFmt("unhook failed: %d - %s", error_num, error_msg);
IdolyprideLocal::Log::ErrorFmt("unhook failed: %d - %s", error_num, error_msg);
}
}
}

namespace GakumasLocal::HookMain {
namespace IdolyprideLocal::HookMain {
using Il2cppString = UnityResolve::UnityType::String;

UnityResolve::UnityType::String* environment_get_stacktrace() {
Expand Down Expand Up @@ -164,7 +164,7 @@ namespace GakumasLocal::HookMain {
*value = cacheRotation;
}
else {
static GakumasLocal::Misc::FixedSizeQueue<float> recordsY(60);
static IdolyprideLocal::Misc::FixedSizeQueue<float> recordsY(60);
const auto newY = GKCamera::CheckNewY(cacheLookAt, true, recordsY);
UnityResolve::UnityType::Vector3 newCacheLookAt{cacheLookAt.x, newY, cacheLookAt.z};
lookat_injected(self, &newCacheLookAt, &worldUp);
Expand Down Expand Up @@ -969,7 +969,7 @@ namespace GakumasLocal::HookMain {
}


namespace GakumasLocal::Hook {
namespace IdolyprideLocal::Hook {
void Install() {
const auto hookInstaller = Plugin::GetInstance().GetHookInstaller();

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/IdolyprideAddon/Hook.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef GAKUMAS_LOCALIFY_HOOK_H
#define GAKUMAS_LOCALIFY_HOOK_H
#ifndef IDOLYPRIDE_LOCALIFY_HOOK_H
#define IDOLYPRIDE_LOCALIFY_HOOK_H

#include <string>

namespace GakumasLocal::Hook
namespace IdolyprideLocal::Hook
{
void Install();
}

#endif //GAKUMAS_LOCALIFY_HOOK_H
#endif //IDOLYPRIDE_LOCALIFY_HOOK_H
2 changes: 1 addition & 1 deletion app/src/main/cpp/IdolyprideAddon/Il2cppUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <memory>

namespace Il2cppUtils {
using namespace GakumasLocal;
using namespace IdolyprideLocal;

struct Il2CppClassHead {
// The following fields are always valid for a Il2CppClass structure
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/IdolyprideAddon/Local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "BaseDefine.h"


namespace GakumasLocal::Local {
namespace IdolyprideLocal::Local {
std::unordered_map<std::string, std::string> i18nData{};
std::unordered_map<std::string, std::string> i18nDumpData{};
std::unordered_map<std::string, std::string> genericText{};
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/IdolyprideAddon/Local.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef GAKUMAS_LOCALIFY_LOCAL_H
#define GAKUMAS_LOCALIFY_LOCAL_H
#ifndef IDOLYPRIDE_LOCALIFY_LOCAL_H
#define IDOLYPRIDE_LOCALIFY_LOCAL_H

#include <string>
#include <filesystem>

namespace GakumasLocal::Local {
namespace IdolyprideLocal::Local {
std::filesystem::path GetBasePath();
void LoadData();
bool GetI18n(const std::string& key, std::string* ret);
Expand All @@ -16,4 +16,4 @@ namespace GakumasLocal::Local {
std::string OnKeyDown(int message, int key);
}

#endif //GAKUMAS_LOCALIFY_LOCAL_H
#endif //IDOLYPRIDE_LOCALIFY_LOCAL_H
10 changes: 5 additions & 5 deletions app/src/main/cpp/IdolyprideAddon/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <queue>

extern JavaVM* g_javaVM;
extern jclass g_gakumasHookMainClass;
extern jclass g_idolyprideHookMainClass;
extern jmethodID showToastMethodId;

#define GetParamStringResult(name)\
Expand All @@ -24,7 +24,7 @@ extern jmethodID showToastMethodId;
delete[] buffer


namespace GakumasLocal::Log {
namespace IdolyprideLocal::Log {
namespace {
std::queue<std::string> showingToasts{};
}
Expand All @@ -35,7 +35,7 @@ namespace GakumasLocal::Log {
}

void Log(int prio, const char* msg) {
__android_log_write(prio, "GakumasLocal-Native", msg);
__android_log_write(prio, "IdolyprideLocal-Native", msg);
}

void LogFmt(int prio, const char* fmt, ...) {
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace GakumasLocal::Log {

void LogUnityLog(int prio, const char* fmt, ...) {
GetParamStringResult(result);
__android_log_write(prio, "GakumasLog", result.c_str());
__android_log_write(prio, "IdolyprideLog", result.c_str());
}

void ShowToastJNI(const char* text) {
Expand All @@ -84,7 +84,7 @@ namespace GakumasLocal::Log {
return;
}

jclass& kotlinClass = g_gakumasHookMainClass;
jclass& kotlinClass = g_idolyprideHookMainClass;
if (!kotlinClass) {
g_javaVM->DetachCurrentThread();
return;
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/IdolyprideAddon/Log.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef GAKUMAS_LOCALIFY_LOG_H
#define GAKUMAS_LOCALIFY_LOG_H
#ifndef IDOLYPRIDE_LOCALIFY_LOG_H
#define IDOLYPRIDE_LOCALIFY_LOG_H

#include <string>
#include <jni.h>

namespace GakumasLocal::Log {
namespace IdolyprideLocal::Log {
std::string StringFormat(const char* fmt, ...);
void LogUnityLog(int prio, const char* fmt, ...);
void LogFmt(int prio, const char* fmt, ...);
Expand All @@ -21,4 +21,4 @@ namespace GakumasLocal::Log {
void ToastLoop(JNIEnv *env, jclass clazz);
}

#endif //GAKUMAS_LOCALIFY_LOG_H
#endif //IDOLYPRIDE_LOCALIFY_LOG_H
2 changes: 1 addition & 1 deletion app/src/main/cpp/IdolyprideAddon/Misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
extern JavaVM* g_javaVM;


namespace GakumasLocal::Misc {
namespace IdolyprideLocal::Misc {
std::u16string ToUTF16(const std::string_view& str) {
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> utf16conv;
return utf16conv.from_bytes(str.data(), str.data() + str.size());
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/IdolyprideAddon/Misc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <vector>


namespace GakumasLocal {
namespace IdolyprideLocal {
using OpaqueFunctionPointer = void (*)();

namespace Misc {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/cpp/IdolyprideAddon/Plugin.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "Plugin.h"
#include "Hook.h"

namespace GakumasLocal {
namespace IdolyprideLocal {
HookInstaller::~HookInstaller() {
}

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/cpp/IdolyprideAddon/Plugin.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef GAKUMAS_LOCALIFY_PLUGIN_H
#define GAKUMAS_LOCALIFY_PLUGIN_H
#ifndef IDOLYPRIDE_LOCALIFY_PLUGIN_H
#define IDOLYPRIDE_LOCALIFY_PLUGIN_H

#include "Misc.hpp"
#include <string>
#include <memory>
#include <jni.h>

namespace GakumasLocal {
namespace IdolyprideLocal {
struct HookInstaller
{
virtual ~HookInstaller();
Expand Down Expand Up @@ -37,4 +37,4 @@ namespace GakumasLocal {

}

#endif //GAKUMAS_LOCALIFY_PLUGIN_H
#endif //IDOLYPRIDE_LOCALIFY_PLUGIN_H
Loading

0 comments on commit 481520c

Please sign in to comment.