Initial commit

This commit is contained in:
Neo 2020-12-21 22:29:12 +00:00
parent 46f14d9a48
commit d14b5f4088
71 changed files with 28973 additions and 0 deletions

424
.gitignore vendored Normal file
View file

@ -0,0 +1,424 @@
build/
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
.idea/
apk/*.apk
apk/*.old
*.keystore
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Libs
#lib/cocos
#lib/Dobby
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
.vscode/
abiproxy/build/
lib/cocos_old/
lib/Dobby_old/
sign.bat

20
.gitmodules vendored Normal file
View file

@ -0,0 +1,20 @@
[submodule "lib/Dobby"]
path = lib/Dobby
url = https://github.com/jmpews/Dobby
branch = master
[submodule "lib/cocos"]
path = lib/cocos
url = https://github.com/neobenedict/cocos2d-src-only/
branch = master
[submodule "smali/okhttp-smali"]
path = smali/okhttp-smali
url = https://github.com/neobenedict/okhttp-smali
branch = master
[submodule "lib/untp"]
path = lib/untp
url = https://github.com/neobenedict/untp
branch = develop
[submodule "patches/images"]
path = patches/images
url = https://git.rayshift.io/kamihama/magia-client-image-patches
branch = master

89
CMakeLists.txt Normal file
View file

@ -0,0 +1,89 @@
# CMakeList.txt : CMake project for MagiaClient, include source and define
# project specific logic here.
#
#set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required (VERSION 3.8)
project ("MagiaClient")
set(TARGET_NAME uwasa)
#if (CMAKE_BUILD_TYPE STREQUAL "Debug")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++ -fsanitize=address -fno-omit-frame-pointer")
#else
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
#endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden -g0 -O3 -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden -g0 -O3 -ffunction-sections -fdata-sections")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
set(DobbyHome ${CMAKE_CURRENT_SOURCE_DIR}/lib/Dobby)
include_directories(
${DobbyHome}/include
${DobbyHome}/builtin-plugin
${DobbyHome}/builtin-plugin/SymbolResolver
${DobbyHome}/external/logging
${DobbyHome}/source
${CMAKE_CURRENT_SOURCE_DIR}/lib
${CMAKE_CURRENT_SOURCE_DIR}/lib/cocos
${CMAKE_CURRENT_SOURCE_DIR}/abiproxy/src
)
include(FetchContent)
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent
GIT_TAG v3.9.1)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
link_libraries("-Wl,--strip-all")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_library( # Sets the name of the library.
${TARGET_NAME}
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
"lib/cocos/math/CCGeometry.cpp"
"lib/cocos/math/Vec2.cpp"
"src/MagiaClient.cpp"
"src/Utils.cpp"
"src/rest/MagiaRest.cpp"
)
find_library(ANDROID_LOG_LIB log)
target_link_libraries(${TARGET_NAME} PRIVATE ${ANDROID_LOG_LIB})
target_link_libraries(${TARGET_NAME} PRIVATE dobby)
target_link_libraries(${TARGET_NAME} PRIVATE nlohmann_json::nlohmann_json)
if (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
target_link_libraries(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/abiproxy/build/armeabi-v7a/libabiproxy.so)
message(STATUS "Linking for armeabi-v7a")
endif (CMAKE_ANDROID_ARCH_ABI STREQUAL "armeabi-v7a")
if (CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a")
target_link_libraries(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/abiproxy/build/arm64-v8a/libabiproxy.so)
message(STATUS "Linking for arm64-v8a")
endif (CMAKE_ANDROID_ARCH_ABI STREQUAL "arm64-v8a")
macro(SET_OPTION option value)
set(${option} ${value} CACHE INTERNAL "" FORCE)
endmacro()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET_OPTION(DOBBY_DEBUG ON)
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
SET_OPTION(DOBBY_GENERATE_SHARED OFF)
SET_OPTION(DynamicBinaryInstrument ON)
SET_OPTION(NearBranch ON)
SET_OPTION(Plugin.SymbolResolver ON)
add_subdirectory(${DobbyHome} dobby)

2
README.md Normal file
View file

@ -0,0 +1,2 @@
# magiatranslate
Magia Translate Client Source

39
abiproxy/CMakeLists.txt Normal file
View file

@ -0,0 +1,39 @@
# CMakeList.txt : CMake project for AbiProxy, include source and define
# project specific logic here.
#
#set(CMAKE_CXX_STANDARD 11)
cmake_minimum_required (VERSION 3.8)
project ("AbiProxy")
set(TARGET_NAME abiproxy)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden -g0 -O3 -ffunction-sections -fdata-sections")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fvisibility=hidden -fvisibility-inlines-hidden -g0 -O3 -ffunction-sections -fdata-sections")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../lib
${CMAKE_CURRENT_SOURCE_DIR}/../lib/cocos
)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
link_libraries("-Wl,--strip-all")
endif(CMAKE_BUILD_TYPE STREQUAL "Release")
add_library( # Sets the name of the library.
${TARGET_NAME}
# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
"src/magia/StringsProxy.cc"
"src/magia/DialogueBox.cc")
find_library(ANDROID_LOG_LIB log)
target_link_libraries(${TARGET_NAME} ${ANDROID_LOG_LIB})
macro(SET_OPTION option value)
set(${option} ${value} CACHE INTERNAL "" FORCE)
endmacro()

40
abiproxy/build.bat Normal file
View file

@ -0,0 +1,40 @@
@echo off
:start
set ndk="C:/Android/android-ndk-r16b-windows-x86_64/android-ndk-r16b/"
set /p ndk="Enter ndk Location [C:/Android/android-ndk-r16b-windows-x86_64/android-ndk-r16b/]: "
if not exist %~dp0\build mkdir %~dp0\build
:build
echo Building libraries.
rmdir /S /Q %~dp0\build\armeabi-v7a\
rmdir /S /Q %~dp0\build\arm64-v8a\
mkdir %~dp0\build\armeabi-v7a
mkdir %~dp0\build\arm64-v8a
echo Running cmake armeabi-v7a...
cd %~dp0\build\armeabi-v7a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\armeabi-v7a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=android-19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DCMAKE_ANDROID_STL_TYPE=gnustl_static" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Running cmake arm64-v8a...
cd %~dp0\build\arm64-v8a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\arm64-v8a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=android-19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DCMAKE_ANDROID_STL_TYPE=gnustl_static" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Successful.
goto :exit
:errorexit
echo An error has occurred, exiting.
goto exit
:exit
pause

View file

@ -0,0 +1,40 @@
@echo off
:start
set ndk="C:/Android/android-ndk-r16b-windows-x86_64/android-ndk-r16b/"
set /p ndk="Enter ndk Location [C:/Android/android-ndk-r16b-windows-x86_64/android-ndk-r16b/]: "
if not exist %~dp0\build mkdir %~dp0\build
:build
echo Building libraries.
rmdir /S /Q %~dp0\build\armeabi-v7a\
rmdir /S /Q %~dp0\build\arm64-v8a\
mkdir %~dp0\build\armeabi-v7a
mkdir %~dp0\build\arm64-v8a
echo Running cmake armeabi-v7a...
cd %~dp0\build\armeabi-v7a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\armeabi-v7a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=android-19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DCMAKE_ANDROID_STL_TYPE=gnustl_static" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Running cmake arm64-v8a...
cd %~dp0\build\arm64-v8a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\arm64-v8a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=android-19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DCMAKE_ANDROID_STL_TYPE=gnustl_static" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Successful.
goto :exit
:errorexit
echo An error has occurred, exiting.
goto exit
:exit
pause

View file

@ -0,0 +1,39 @@
#include <cstdint>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <functional>
#include "cocos/base/CCRef.h"
#include "cocos2d.h"
#include <android/log.h>
#include "DialogueBox.h"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "MagiaHook", __VA_ARGS__)
typedef std::function<void(cocos2d::Ref*)> ccMenuCallback;
typedef int *(*openMessageBoxType)(char const* title, char const* body, char const* button, const ccMenuCallback& callback, bool xButton);
__attribute__((visibility("default")))
void DialogueBoxProxy::DialogueBox(void* dialogueBoxPointer) {
LOGI("Called extern dialogue box");
auto openMessageBoxFunc = reinterpret_cast<openMessageBoxType>(dialogueBoxPointer);
auto dontDisappear = std::bind(&DialogueBoxProxy::testCallback, this, std::placeholders::_1);
openMessageBoxFunc("Update required", "An update for Magia Translate is strongly recommended! 2", "OK",
dontDisappear, false);
//sleep(100);
}
//void DialogueBoxProxy::motdBox(void * dialogueboxPointer, void * loadContinuePointer);
void DialogueBoxProxy::testCallback(cocos2d::Ref* sender) {
LOGI("Recalled VALUE");
}
__attribute__((visibility("default")))
DialogueBoxProxy::DialogueBoxProxy() {
}
__attribute__((visibility("default")))
DialogueBoxProxy::~DialogueBoxProxy() {
}

View file

@ -0,0 +1,16 @@
#ifndef __DIALOGUEBOX_H__
#define __DIALOGUEBOX_H__
#include <cstdint>
#include "cocos/base/CCRef.h"
class DialogueBoxProxy {
public:
DialogueBoxProxy();
virtual ~DialogueBoxProxy();
virtual void DialogueBox(void* dialogueBoxPointer);
virtual void testCallback(cocos2d::Ref* sender);
private:
std::function<void(cocos2d::Ref*)> dialogueCallback;
};
#endif

View file

@ -0,0 +1,39 @@
#include "StringsProxy.h"
#include <iostream>
#include <string>
using namespace std;
/*extern "C" StringsProxy* create_object(uintptr_t str)
{
return new StringsProxy(str);
}
extern "C" StringsProxy* create_object(const char* str)
{
return new StringsProxy(str);
}
extern "C" void destroy_object( StringsProxy* object )
{
delete object;
}*/
__attribute__((visibility("default")))
extern "C" StringsProxy::StringsProxy(const char* contents)
{
set_string = std::string(contents);
}
__attribute__((visibility("default")))
extern "C" StringsProxy::StringsProxy(uintptr_t str) {
set_string = *reinterpret_cast<proxy_string*>(str);
}
__attribute__((visibility("default")))
extern "C" const char* StringsProxy::c_str() {
return set_string.c_str();
}
__attribute__((visibility("default")))
extern "C" const uintptr_t* StringsProxy::ptr() {
return reinterpret_cast<uintptr_t *>(&set_string);
}
__attribute__((visibility("default")))
extern "C" StringsProxy::~StringsProxy() {
}

View file

@ -0,0 +1,27 @@
#ifndef __STRINGSPROXY_H__
#define __STRINGSPROXY_H__
#include <string>
typedef std::basic_string<char> proxy_string;
class StringsProxy
{
public:
/* Initialize StringsProxy with a pointer to an existing string */
StringsProxy(uintptr_t str);
/* Initialize StringsProxy with a new string */
StringsProxy(const char* str);
/* Get C string */
virtual const char* c_str();
/* Get pointer to string for injection */
const virtual uintptr_t* ptr();
virtual ~StringsProxy();
private:
proxy_string set_string;
};
#endif

View file

106
build.bat Normal file
View file

@ -0,0 +1,106 @@
@echo off
for /r "%~dp0\apk" %%a in (*.apk) do set apk=%%~dpnxa
if "%apk%" neq "" (
echo Found apk %apk%.
goto :start
)
echo Did not find any MagiReco APK! Add it to the apk/ directory.
goto errorexit
pause
:start
set ndk="C:/Android/android-ndk-r21d/"
set /p ndk="Enter ndk Location [C:/Android/android-ndk-r21d/]: "
if not exist %~dp0\build mkdir %~dp0\build
if exist %~dp0\build\apktool_2.4.1.jar goto apktoolexists
echo Downloading apktool...
CALL curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64)" -o "%~dp0\build\apktool_2.4.1.jar" -L "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.4.1.jar"
:apktoolexists
if not exist %~dp0\build\app\ goto create
set deleteold=N
set /p deleteold="Remake existing APK work directory (Y/[N])? "
if %deleteold% NEQ Y goto build
:create
echo Removing existing build files...
rmdir /S /Q %~dp0\build\app\
echo Running apktool...
CALL java -jar %~dp0\build\apktool_2.4.1.jar d %apk% -o %~dp0\build\app\
mkdir %~dp0\build\app\smali\com\loadLib\
if not exist %~dp0\build\app\lib\armeabi-v7a mkdir %~dp0\build\app\lib\armeabi-v7a
if not exist %~dp0\build\app\lib\arm64-v8a mkdir %~dp0\build\app\lib\arm64-v8a
echo Applying smali patches...
cd %~dp0
call git apply --stat "%~dp0\patches\NativeBridge.patch"
call git apply --stat "%~dp0\patches\Hook.patch"
call git apply "%~dp0\patches\NativeBridge.patch"
call git apply "%~dp0\patches\Hook.patch"
echo Applying misc patches...
REM call copy /Y "%~dp0\patches\images\story_ui_sprites00_patch.plist" "%~dp0\build\app\assets\package\story\story_ui_sprites00.plist"
REM call copy /Y "%~dp0\patches\images\story_ui_sprites00_patch.png" "%~dp0\build\app\assets\package\story\story_ui_sprites00.png"
call copy /Y "%~dp0\patches\koruri-semibold.ttf" "%~dp0\build\app\assets\fonts\koruri-semibold.ttf"
echo Updating sprites and AndroidManifest.xml...
call python buildassets.py
:build
echo Copying new smali files...
call copy /Y "%~dp0\smali\loader\*.smali" "%~dp0\build\app\smali\com\loadLib\"
mkdir %~dp0\build\app\smali_classes2\io\kamihama\magianative\
echo Copying magianative...
call copy /Y "%~dp0\smali\MagiaNative\app\src\main\java\io\kamihama\magianative\*.smali" "%~dp0\build\app\smali_classes2\io\kamihama\magianative\"
echo Copying libraries...
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\smali\okhttp-smali\okhttp3\ %~dp0\build\app\smali_classes2\okhttp3\
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\smali\okhttp-smali\okio\ %~dp0\build\app\smali_classes2\okio\
echo Copying unknown...
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\patches\unknown\ %~dp0\build\app\unknown\
call copy /Y "%~dp0\patches\strings.xml" "%~dp0\build\app\res\values\strings.xml"
echo Building libraries.
rmdir /S /Q %~dp0\build\armeabi-v7a\
rmdir /S /Q %~dp0\build\arm64-v8a\
mkdir %~dp0\build\armeabi-v7a
mkdir %~dp0\build\arm64-v8a
echo Running cmake armeabi-v7a...
cd %~dp0\build\armeabi-v7a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\armeabi-v7a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DDOBBY_DEBUG=ON" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Running cmake arm64-v8a...
cd %~dp0\build\arm64-v8a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\arm64-v8a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=21" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DDOBBY_DEBUG=ON" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Copying libraries...
call copy /Y %~dp0\build\armeabi-v7a\libuwasa.so %~dp0\build\app\lib\armeabi-v7a\libuwasa.so
call copy /Y %~dp0\abiproxy\build\armeabi-v7a\libabiproxy.so %~dp0\build\app\lib\armeabi-v7a\libabiproxy.so
call copy /Y %~dp0\build\arm64-v8a\libuwasa.so %~dp0\build\app\lib\arm64-v8a\libuwasa.so
call copy /Y %~dp0\abiproxy\build\arm64-v8a\libabiproxy.so %~dp0\build\app\lib\arm64-v8a\libabiproxy.so
echo Rebuilding APK...
call java -jar %~dp0\build\apktool_2.4.1.jar b %~dp0\build\app\ -o %~dp0\build\magia_patched.apk
:signandupload
echo Signing apk...
call %~dp0\sign.bat
echo Finished!
goto exit
:errorexit
echo An error has occurred, exiting.
goto exit
:exit
pause

106
build_release.bat Normal file
View file

@ -0,0 +1,106 @@
@echo off
for /r "%~dp0\apk" %%a in (*.apk) do set apk=%%~dpnxa
if "%apk%" neq "" (
echo Found apk %apk%.
goto :start
)
echo Did not find any MagiReco APK! Add it to the apk/ directory.
goto errorexit
pause
:start
set ndk="C:/Android/android-ndk-r21d/"
set /p ndk="Enter ndk Location [C:/Android/android-ndk-r21d/]: "
if not exist %~dp0\build mkdir %~dp0\build
if exist %~dp0\build\apktool_2.4.1.jar goto apktoolexists
echo Downloading apktool...
CALL curl -A "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64)" -o "%~dp0\build\apktool_2.4.1.jar" -L "https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.4.1.jar"
:apktoolexists
if not exist %~dp0\build\app\ goto create
set deleteold=N
set /p deleteold="Remake existing APK work directory (Y/[N])? "
if %deleteold% NEQ Y goto build
:create
echo Removing existing build files...
rmdir /S /Q %~dp0\build\app\
echo Running apktool...
CALL java -jar %~dp0\build\apktool_2.4.1.jar d %apk% -o %~dp0\build\app\
mkdir %~dp0\build\app\smali\com\loadLib\
if not exist %~dp0\build\app\lib\armeabi-v7a mkdir %~dp0\build\app\lib\armeabi-v7a
if not exist %~dp0\build\app\lib\arm64-v8a mkdir %~dp0\build\app\lib\arm64-v8a
echo Applying smali patches...
cd %~dp0
call git apply --stat "%~dp0\patches\NativeBridge.patch"
call git apply --stat "%~dp0\patches\Hook.patch"
call git apply "%~dp0\patches\NativeBridge.patch"
call git apply "%~dp0\patches\Hook.patch"
echo Applying misc patches...
REM call copy /Y "%~dp0\patches\images\story_ui_sprites00_patch.plist" "%~dp0\build\app\assets\package\story\story_ui_sprites00.plist"
REM call copy /Y "%~dp0\patches\images\story_ui_sprites00_patch.png" "%~dp0\build\app\assets\package\story\story_ui_sprites00.png"
call copy /Y "%~dp0\patches\koruri-semibold.ttf" "%~dp0\build\app\assets\fonts\koruri-semibold.ttf"
echo Updating sprites and AndroidManifest.xml...
call python buildassets.py
:build
echo Copying new smali files...
call copy /Y "%~dp0\smali\loader\*.smali" "%~dp0\build\app\smali\com\loadLib\"
mkdir %~dp0\build\app\smali_classes2\io\kamihama\magianative\
echo Copying magianative...
call copy /Y "%~dp0\smali\MagiaNative\app\src\main\java\io\kamihama\magianative\*.smali" "%~dp0\build\app\smali_classes2\io\kamihama\magianative\"
echo Copying libraries...
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\smali\okhttp-smali\okhttp3\ %~dp0\build\app\smali_classes2\okhttp3\
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\smali\okhttp-smali\okio\ %~dp0\build\app\smali_classes2\okio\
echo Copying unknown...
call robocopy /NFL /NDL /NJH /NJS /nc /ns /e %~dp0\patches\unknown\ %~dp0\build\app\unknown\
call copy /Y "%~dp0\patches\strings.xml" "%~dp0\build\app\res\values\strings.xml"
echo Building libraries.
rmdir /S /Q %~dp0\build\armeabi-v7a\
rmdir /S /Q %~dp0\build\arm64-v8a\
mkdir %~dp0\build\armeabi-v7a
mkdir %~dp0\build\arm64-v8a
echo Running cmake armeabi-v7a...
cd %~dp0\build\armeabi-v7a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="armeabi-v7a" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\armeabi-v7a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=19" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=armeabi-v7a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DDOBBY_DEBUG=OFF" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Running cmake arm64-v8a...
cd %~dp0\build\arm64-v8a
call "C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G Ninja -DANDROID_ABI="arm64-v8a" -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_INSTALL_PREFIX:PATH="%~dp0\build\arm64-v8a" -DCMAKE_TOOLCHAIN_FILE:FILEPATH="%ndk%/build/cmake/android.toolchain.cmake" -DCMAKE_MAKE_PROGRAM:FILEPATH="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe" "-DANDROID_PLATFORM=21" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_ANDROID_ARCH_ABI=arm64-v8a" "-DCMAKE_ANDROID_NDK=%ndk%" "-DCMAKE_SYSTEM_VERSION=16" "-DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang" "-DDOBBY_DEBUG=OFF" "%~dp0\"
if errorlevel 1 goto errorexit
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe"
if errorlevel 1 goto errorexit
echo Copying libraries...
call copy /Y %~dp0\build\armeabi-v7a\libuwasa.so %~dp0\build\app\lib\armeabi-v7a\libuwasa.so
call copy /Y %~dp0\abiproxy\build\armeabi-v7a\libabiproxy.so %~dp0\build\app\lib\armeabi-v7a\libabiproxy.so
call copy /Y %~dp0\build\arm64-v8a\libuwasa.so %~dp0\build\app\lib\arm64-v8a\libuwasa.so
call copy /Y %~dp0\abiproxy\build\arm64-v8a\libabiproxy.so %~dp0\build\app\lib\arm64-v8a\libabiproxy.so
echo Rebuilding APK...
call java -jar %~dp0\build\apktool_2.4.1.jar b %~dp0\build\app\ -o %~dp0\build\magia_patched.apk
:signandupload
echo Signing apk...
call %~dp0\sign.bat
echo Finished!
goto exit
:errorexit
echo An error has occurred, exiting.
goto exit
:exit
pause

130
buildassets.py Normal file
View file

@ -0,0 +1,130 @@
import sys, os
from PIL import Image
import plistlib
import ast
from pathlib import Path
sys.path.append('lib/untp/src/untp')
import untp
from PyTexturePacker import Packer
from shutil import copyfile
import shutil
def rmdir(directory):
if os.path.exists(directory):
directory = Path(directory)
for item in directory.iterdir():
if item.is_dir():
rmdir(item)
else:
item.unlink()
directory.rmdir()
en_path = "L:/MagiaReco/com.aniplex.magireco.en_1.2.0_checkonly-debugSigned/assets/package/"
jp_path = os.path.dirname(os.path.realpath(__file__)) + "/build/app/assets/package/"
print("EN Path: " + en_path)
print("JP Path: " + jp_path)
en_assets = {}
jp_assets = {}
for path in Path(en_path).rglob('*.png'):
en_assets[path.name] = path
for path in Path(jp_path).rglob('*.png'):
jp_assets[path.name] = path
required_assets = [["quest_image0","quest_image1"],
["data_download0"],
["ef_battle000","ef_battle001"],
["qb_auto_settings0"],
["qb_continue"],
["qb_ef_sp_combo0"],
["qb_help"],
["story_ui_sprites00"],
["toppage_bg_020", "toppage_bg_021"],
["web_ef_magia_lvup0"],
["web_ef_memoria0", "web_ef_memoria1"],
["web_ef_reality_up0"],
["web_ef_strengthening0"],
["qb_menu_top0"]]
ignored_images = ["dl_loading_bar01.png", "qb_menu_top_14.png"]
copyfile(en_path + "/top/toppage_bg_02.ExportJson", jp_path + "/top/toppage_bg_02.ExportJson")
copyfile(en_path + "/memoria/web_ef_memoria.ExportJson", jp_path + "/memoria/web_ef_memoria.ExportJson")
print("Updating AndroidManifest.xml")
path = Path("build/app/AndroidManifest.xml")
text = path.read_text()
text = text.replace("com.aniplex.magireco", "io.kamihama.magiatranslate")
path.write_text(text)
basePath = os.path.dirname(os.path.realpath(__file__))
rmdir("build/assets")
Path("build/assets").mkdir(parents=True, exist_ok=True)
for assets in required_assets:
rmdir("build/assets/work_jp")
Path("build/assets/work_jp").mkdir(parents=True, exist_ok=True)
rmdir("build/assets/work_jp_old")
Path("build/assets/work_jp_old").mkdir(parents=True, exist_ok=True)
rmdir("build/assets/work_en")
Path("build/assets/work_en").mkdir(parents=True, exist_ok=True)
rmdir("build/assets/work_out")
Path("build/assets/work_out").mkdir(parents=True, exist_ok=True)
for asset in assets:
asset_png = asset + ".png"
jp_asset_plist = str(jp_assets[asset_png])[:-4] + ".plist"
jp_asset_png = jp_assets[asset_png]
#print("Working on JP " + jp_asset_plist)
untp.unpacker(str(jp_asset_plist), image_file = str(jp_asset_png), output_dir = "build/assets/work_jp")
untp.unpacker(str(jp_asset_plist), image_file = str(jp_asset_png), output_dir = "build/assets/work_jp_old")
for asset in assets:
asset_png = asset + ".png"
if asset_png in en_assets:
na_asset_plist = str(en_assets[asset_png])[:-4] + ".plist"
na_asset_png = en_assets[asset_png]
#print("Working on NA " + na_asset_plist)
untp.unpacker(str(na_asset_plist), image_file = str(na_asset_png), output_dir = "build/assets/work_en")
#print("Skipping NA %s" % asset_png)
for toCopy in Path("build/assets/work_en").rglob("*.*"):
filename = os.path.basename(str(toCopy))
#print("Copying %s" % str(toCopy)[8:])
if (filename not in ignored_images):
copyfile("build/assets/work_en/" + filename, "build/assets/work_jp/" + filename)
manualPath = basePath + "patches/images/" + assets[0] + "/"
if os.path.exists(manualPath):
print("Adding manual replacements for " + assets[0] + ".")
for toCopy in Path(manualPath).rglob("*.*"):
filename = os.path.basename(str(toCopy))
print("Copying " + filename + "...")
copyfile(toCopy, "build/assets/work_jp/" + filename)
if assets[0] == "toppage_bg_020":
print("Manual override for toppage")
packer = Packer.create(max_width=2048, max_height=1920, bg_color=0x00ffffff, enable_rotated=False)
else:
packer = Packer.create(max_width=2048, max_height=2048, bg_color=0x00ffffff, enable_rotated=False)
if str(assets[0][-1]) == '0':
packer.pack("build/assets/work_jp/", str(assets[0][:-1]) + "%d", output_path="build/assets/work_out/")
else:
packer.pack("build/assets/work_jp/", str(assets[0]), output_path="build/assets/work_out/")
for asset in assets:
asset_png = asset + ".png"
jp_asset_plist = str(jp_assets[asset_png])[:-4] + ".plist"
jp_asset_png = jp_assets[asset_png]
os.remove(jp_asset_png)
os.remove(jp_asset_plist)
savedir = os.path.dirname(jp_asset_png)
print("Saving to %s" % savedir)
file_names = os.listdir("build/assets/work_out/")
for file_name in file_names:
shutil.move(os.path.join("build/assets/work_out/", file_name), savedir)

0
lib/.gitkeep Normal file
View file

1
lib/Dobby Submodule

@ -0,0 +1 @@
Subproject commit 0aec6c146a3140b917d42850f3c48d19e6c64746

1
lib/cocos Submodule

@ -0,0 +1 @@
Subproject commit b06eab6779fa27b6b4518a877ded7131cf9b90c6

1
lib/untp Submodule

@ -0,0 +1 @@
Subproject commit 9d305b40ba0d1bd3f845e0102fa6815b7f2b718c

26
patches/Hook.patch Normal file
View file

@ -0,0 +1,26 @@
diff --git a/build/app/smali/jp/f4samurai/MyApplication.smali b/build/app/smali/jp/f4samurai/MyApplication.smali
index 2a83c1d..c18fa78 100644
--- "a/build/app/smali/jp/f4samurai/MyApplication.smali"
+++ "b/build/app/smali/jp/f4samurai/MyApplication.smali"
@@ -6,6 +6,7 @@
# direct methods
.method public constructor <init>()V
.locals 0
+ invoke-static {}, Lcom/loadLib/libLoader;->loadLib()V
.line 12
invoke-direct {p0}, Landroid/app/Application;-><init>()V
@@ -36,12 +37,7 @@
.end method
.method public onCreate()V
- .locals 1
-
- const-string v0, "19418f5e-aacd-437e-af3e-2c9967abcb2f"
-
- .line 16
- invoke-static {p0, v0}, Lcom/smrtbeat/SmartBeat;->initAndStartSession(Landroid/app/Application;Ljava/lang/String;)V
+ .locals 0
.line 17
invoke-super {p0}, Landroid/app/Application;->onCreate()V

View file

@ -0,0 +1,40 @@
diff --git a/build/app/smali_classes2/jp/f4samurai/bridge/NativeBridge.smali b/build/app/smali_classes2/jp/f4samurai/bridge/NativeBridge.smali
index 0c7b0b1..c283cbc 100644
--- a/build/app/smali_classes2/jp/f4samurai/bridge/NativeBridge.smali
+++ b/build/app/smali_classes2/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,6 @@
sput-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
.line 34
- 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 35
sget-object v0, Ljp/f4samurai/bridge/NativeBridge;->sAppActivity:Ljp/f4samurai/AppActivity;
@@ -354,11 +345,7 @@
.locals 1
.line 180
- 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

1
patches/images Submodule

@ -0,0 +1 @@
Subproject commit 8ea15ac03dec652206844acf950f7b124d08e166

BIN
patches/koruri-semibold.ttf Normal file

Binary file not shown.

142
patches/strings.xml Normal file
View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="abc_action_bar_home_description">Navigate home</string>
<string name="abc_action_bar_up_description">Navigate up</string>
<string name="abc_action_menu_overflow_description">More options</string>
<string name="abc_action_mode_done">Done</string>
<string name="abc_activity_chooser_view_see_all">See all</string>
<string name="abc_activitychooserview_choose_application">Choose an app</string>
<string name="abc_capital_off">OFF</string>
<string name="abc_capital_on">ON</string>
<string name="abc_font_family_body_1_material">sans-serif</string>
<string name="abc_font_family_body_2_material">sans-serif-medium</string>
<string name="abc_font_family_button_material">sans-serif-medium</string>
<string name="abc_font_family_caption_material">sans-serif</string>
<string name="abc_font_family_display_1_material">sans-serif</string>
<string name="abc_font_family_display_2_material">sans-serif</string>
<string name="abc_font_family_display_3_material">sans-serif</string>
<string name="abc_font_family_display_4_material">sans-serif-light</string>
<string name="abc_font_family_headline_material">sans-serif</string>
<string name="abc_font_family_menu_material">sans-serif</string>
<string name="abc_font_family_subhead_material">sans-serif</string>
<string name="abc_font_family_title_material">sans-serif-medium</string>
<string name="abc_search_hint">Search…</string>
<string name="abc_searchview_description_clear">Clear query</string>
<string name="abc_searchview_description_query">Search query</string>
<string name="abc_searchview_description_search">Search</string>
<string name="abc_searchview_description_submit">Submit query</string>
<string name="abc_searchview_description_voice">Voice search</string>
<string name="abc_shareactionprovider_share_with">Share with</string>
<string name="abc_shareactionprovider_share_with_application">Share with %s</string>
<string name="abc_toolbar_collapse_description">Collapse</string>
<string name="app_name">Magia Record JP</string>
<string name="app_type">APP</string>
<string name="build_type">RELEASE</string>
<string name="cast_ad_label">Ad</string>
<string name="cast_casting_to_device">Casting to %1$s</string>
<string name="cast_closed_captions">Closed captions</string>
<string name="cast_closed_captions_unavailable">Closed captions unavailable</string>
<string name="cast_connecting_to_device">Connecting to %1$s</string>
<string name="cast_disconnect">Disconnect</string>
<string name="cast_expanded_controller_ad_image_description">Image displayed while the cast receiver is playing an ad</string>
<string name="cast_expanded_controller_ad_in_progress">Ad in progress…</string>
<string name="cast_expanded_controller_background_image">Album art</string>
<string name="cast_expanded_controller_live_stream_indicator">Live stream</string>
<string name="cast_expanded_controller_loading">Loading…</string>
<string name="cast_expanded_controller_skip_ad_label">Skip</string>
<string name="cast_forward">Forward</string>
<string name="cast_forward_10">Forward ten seconds</string>
<string name="cast_forward_30">Forward thirty seconds</string>
<string name="cast_intro_overlay_button_text">@android:string/ok</string>
<string name="cast_invalid_stream_duration_text">--:--</string>
<string name="cast_invalid_stream_position_text">--:--</string>
<string name="cast_mute">Mute</string>
<string name="cast_notification_connected_message">Connected to %1$s</string>
<string name="cast_notification_connecting_message">Connecting to %1$s</string>
<string name="cast_notification_default_channel_name">Cast</string>
<string name="cast_notification_disconnect">Disconnect</string>
<string name="cast_pause">Pause</string>
<string name="cast_play">Play</string>
<string name="cast_rewind">Rewind</string>
<string name="cast_rewind_10">Rewind ten seconds</string>
<string name="cast_rewind_30">Rewind thirty seconds</string>
<string name="cast_seek_bar">Playback seek control</string>
<string name="cast_skip_next">Skip to next item</string>
<string name="cast_skip_prev">Skip to previous item</string>
<string name="cast_stop">Stop</string>
<string name="cast_stop_live_stream">Stop live stream</string>
<string name="cast_tracks_chooser_dialog_audio">Audio</string>
<string name="cast_tracks_chooser_dialog_cancel">Cancel</string>
<string name="cast_tracks_chooser_dialog_closed_captions">Closed Captions</string>
<string name="cast_tracks_chooser_dialog_default_track_name">Track %1$d</string>
<string name="cast_tracks_chooser_dialog_none">None</string>
<string name="cast_tracks_chooser_dialog_ok">OK</string>
<string name="cast_tracks_chooser_dialog_subtitles">Subtitles</string>
<string name="cast_unmute">Unmute</string>
<string name="common_google_play_services_enable_button">Enable</string>
<string name="common_google_play_services_enable_text">"%1$s won't work unless you enable Google Play services."</string>
<string name="common_google_play_services_enable_title">Enable Google Play services</string>
<string name="common_google_play_services_install_button">Install</string>
<string name="common_google_play_services_install_text">"%1$s won't run without Google Play services, which are missing from your device."</string>
<string name="common_google_play_services_install_title">Get Google Play services</string>
<string name="common_google_play_services_notification_channel_name">Google Play services availability</string>
<string name="common_google_play_services_notification_ticker">Google Play services error</string>
<string name="common_google_play_services_unknown_issue">%1$s is having trouble with Google Play services. Please try again.</string>
<string name="common_google_play_services_unsupported_text">"%1$s won't run without Google Play services, which are not supported by your device."</string>
<string name="common_google_play_services_update_button">Update</string>
<string name="common_google_play_services_update_text">"%1$s won't run unless you update Google Play services."</string>
<string name="common_google_play_services_update_title">Update Google Play services</string>
<string name="common_google_play_services_updating_text">"%1$s won't run without Google Play services, which are currently updating."</string>
<string name="common_google_play_services_wear_update_text">New version of Google Play services needed. It will update itself shortly.</string>
<string name="common_open_on_phone">Open on phone</string>
<string name="common_signin_button_text">Sign in</string>
<string name="common_signin_button_text_long">Sign in with Google</string>
<string name="default_web_client_id">48695978581-l3g2vae3su7td5tilbunf8fpb1875np4.apps.googleusercontent.com</string>
<string name="fcm_channel_id">android_channel_id</string>
<string name="fcm_fallback_notification_channel_label">Miscellaneous</string>
<string name="firebase_database_url">https://kamihama-io.firebaseio.com</string>
<string name="gcm_defaultSenderId">48695978581</string>
<string name="gcm_fallback_notification_channel_label">Miscellaneous</string>
<string name="google_api_key">AIzaSyBlHoCTAsEa1zsIhKfE8nvMVewd0ULYmkw</string>
<string name="google_app_id">1:48695978581:android:bc7cc007c2de2d0e79c2dc</string>
<string name="google_crash_reporting_api_key">AIzaSyBlHoCTAsEa1zsIhKfE8nvMVewd0ULYmkw</string>
<string name="google_storage_bucket">kamihama-io.appspot.com</string>
<string name="mr_button_content_description">Cast button</string>
<string name="mr_cast_button_connected">Cast button. Connected</string>
<string name="mr_cast_button_connecting">Cast button. Connecting</string>
<string name="mr_cast_button_disconnected">Cast button. Disconnected</string>
<string name="mr_chooser_searching">Finding devices</string>
<string name="mr_chooser_title">Cast to</string>
<string name="mr_controller_album_art">Album art</string>
<string name="mr_controller_casting_screen">Casting screen</string>
<string name="mr_controller_close_description">Close</string>
<string name="mr_controller_collapse_group">Collapse</string>
<string name="mr_controller_disconnect">Disconnect</string>
<string name="mr_controller_expand_group">Expand</string>
<string name="mr_controller_no_info_available">No info available</string>
<string name="mr_controller_no_media_selected">No media selected</string>
<string name="mr_controller_pause">Pause</string>
<string name="mr_controller_play">Play</string>
<string name="mr_controller_stop">Stop</string>
<string name="mr_controller_stop_casting">Stop casting</string>
<string name="mr_controller_volume_slider">Volume slider</string>
<string name="mr_system_route_name">System</string>
<string name="mr_user_route_category_name">Devices</string>
<string name="place_autocomplete_clear_button">Clear search</string>
<string name="place_autocomplete_search_hint">Search</string>
<string name="project_id">magireco-754ac</string>
<string name="s1">Save image</string>
<string name="s2">Allow Ad to store image in Picture gallery?</string>
<string name="s3">Accept</string>
<string name="s4">Decline</string>
<string name="s5">Create calendar event</string>
<string name="s6">Allow Ad to create a calendar event?</string>
<string name="s7">Test Ad</string>
<string name="search_menu_title">Search</string>
<string name="server_type">PRODUCT</string>
<string name="status_bar_notification_info_overflow">999+</string>
<string name="tagmanager_preview_dialog_button">Continue</string>
<string name="tagmanager_preview_dialog_message">Preview mode updated.</string>
<string name="tagmanager_preview_dialog_title">Preview</string>
<string name="wallet_buy_button_place_holder">Buy with Google</string>
</resources>

View file

@ -0,0 +1,40 @@
{
"project_info": {
"project_number": "48695978581",
"firebase_url": "https://kamihama-io.firebaseio.com",
"project_id": "kamihama-io",
"storage_bucket": "kamihama-io.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:48695978581:android:bc7cc007c2de2d0e79c2dc",
"android_client_info": {
"package_name": "io.kamihama.magiatranslate"
}
},
"oauth_client": [
{
"client_id": "48695978581-l3g2vae3su7td5tilbunf8fpb1875np4.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBlHoCTAsEa1zsIhKfE8nvMVewd0ULYmkw"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "48695978581-l3g2vae3su7td5tilbunf8fpb1875np4.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}

4
requirements.txt Normal file
View file

@ -0,0 +1,4 @@
parse==1.18.0
Pillow==8.0.1
pkg-resources==0.0.0
PyTexturePacker==1.1.0

101
smali/MagiaNative/.gitignore vendored Normal file
View file

@ -0,0 +1,101 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
# Built application files
*.apk
*.aar
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml