Skip to content
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.

Commit

Permalink
v0.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ZTzTopia committed Jan 19, 2022
1 parent ab4c00b commit 5434013
Show file tree
Hide file tree
Showing 29 changed files with 81 additions and 3,336 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

67 changes: 56 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,68 @@ GTLauncherAndroid is a growtopia launcher LiKE nO oThER. Without having to updat
![](https://cdn.discordapp.com/attachments/488978346072604682/916262099997581342/unknown.png)
![](https://cdn.discordapp.com/attachments/488978346072604682/916261969798004736/unknown.png)

## Features
## 📜 Features
- Launch growtopia without having to update the launcher if the game is updated.
- Floating Windows.

## Coming Soon
## 😋 Coming Soon
- None

## Requirements
## 💻 Requirements
The following dependencies are required to build the library from source.
- [Android Studio](https://developer.android.com/studio).
- Windows
- [Android Studio](https://developer.android.com/studio).

For AIDE users: I've tried to fix all the errors in AIDE, but I can't get a satisfactory result. Because AIDE does not support AndroidX and lacks many features. Yes, even though I fixed AndroidX but still can't install the apk.
Android is very slow when deleting and moving files it's very frustrating for me.
- Android
- [Termux](https://github.com/termux/termux-app/releases)
- [Android SDK](https://github.com/Lzhiyong/termux-ndk/releases/tag/android-sdk)
- [Android NDK](https://github.com/Lzhiyong/termux-ndk/releases/tag/android-ndk)

## Building
1. Build the source code.
2. Install the application.
3. Profit.
## 🔨 Building
- Android

**If you can't make it you can download the finished application on the release page.**
Download the [Android SDK](https://github.com/Lzhiyong/termux-ndk/releases/tag/android-sdk) and [Android NDK](https://github.com/Lzhiyong/termux-ndk/releases/tag/android-ndk).

```bash
# install openjdk-17
pkg install openjdk-17

# install gradle
pkg install gradle
```

Add a `local.properties` file to the root of the project as below
```local.properties
# modify the local.properties file
# although ndk.dir has been deprecated, but it still works
sdk.dir=/path/to/android-sdk
ndk.dir=/path/to/android-ndk
# for example:
sdk.dir=/data/data/com.termux/files/home/android-sdk
ndk.dir=/data/data/com.termux/files/home/android-ndk-r23b
```

Execute the `gradle build` command to start building the android app, when building for the first time, the below error will occur.
this is because the gradle plugin will download a corresponding version of `aapt2-7.0.3-7396180-linux.jar`, we need to replace it.

![](https://github.com/Lzhiyong/termux-ndk/blob/master/build-app/screenshot/build_aapt2_error1.jpg)

Replace the aapt2 in `aapt2-7.0.3-7396180-linux.jar` with [aapt2-7.0.3-7396180-linux.jar](https://www.mediafire.com/file/7lclq4xaij3jiwg/aapt2-7.0.3-7396180-linux.jar/file) or [Making AGP jar file](https://github.com/Lzhiyong/termux-ndk/tree/master/build-app#making-agp-jar-file) you need [sdk-tools/build-tools/aapt2](https://github.com/Lzhiyong/sdk-tools/releases)

```bash
# aapt2 is inside the jar file(aapt2-7.0.3-7396180-linux.jar)
# because the aapt2 is x86_64 architecture not aarch64, so we need to replace it
# execute the find command to search aapt2-xxx-linux.jar, then replace it
cd ~/.gradle
find . -type f -name aapt2-*-linux.jar
cp /path/to/aapt2-7.0.3-7396180-linux.jar /the/output/from/find/command
```

![](https://github.com/Lzhiyong/termux-ndk/blob/master/build-app/screenshot/build_aapt2_error2.jpg)

If an error occurs during the build app, this may be a network problem, please execute the `gradle build` again or execute the `gradle build --info` for more information.

**Tutorial by: https://github.com/Lzhiyong/termux-ndk/tree/master/build-app**


**If you can't make it, you can download the finished application on the release page.**
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ plugins {

android {
compileSdk 31
buildToolsVersion "31.0.0"

defaultConfig {
applicationId "com.gt.launcher"
minSdk 16
targetSdk 31
versionCode 2
versionName "0.2"
versionCode 3
versionName "0.0.3"
multiDexEnabled true

ndk {
Expand Down
3 changes: 0 additions & 3 deletions app/src/main/java/com/gt/launcher/Launch.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.gt.launcher;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.net.Uri;
Expand All @@ -10,7 +9,6 @@
import android.os.Handler;
import android.provider.Settings;
import android.util.Log;
import android.widget.Toast;

import androidx.annotation.Nullable;

Expand All @@ -24,7 +22,6 @@
public class Launch extends SharedActivity {
private static final String TAG = "GTLauncherAndroid";

@SuppressLint("UnsafeDynamicallyLoadedCode")
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
Log.d("GTLauncherAndroid", "Launching growtopia..");
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
LOCAL_PATH := $(call my-dir)

# ============================================================================
# Dobby static libraries.

include $(CLEAR_VARS)
LOCAL_MODULE := libdobby
LOCAL_SRC_FILES := $(LOCAL_PATH)/src/libraries/$(TARGET_ARCH_ABI)/libdobby.a
include $(PREBUILT_STATIC_LIBRARY)

# ============================================================================
# Build the GrowtopiaFix library.

include $(CLEAR_VARS)
LOCAL_MODULE := GrowtopiaFix
LOCAL_ARM_MODE := arm

LOCAL_STATIC_LIBRARIES := libdobby

LOCAL_CFLAGS := -fvisibility=hidden
LOCAL_CPPFLAGS := -w -s -fvisibility=hidden -pthread -Wall -O3 -std=c++11
LOCAL_CPPFLAGS := -w -s -fvisibility=hidden -pthread -Wall -O3 -std=c++17

FILE_LIST := $(wildcard $(LOCAL_PATH)/src/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/src/game/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/src/include/KittyMemory/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/src/include/Substrate/*.c*)
FILE_LIST += $(wildcard $(LOCAL_PATH)/src/include/And64InlineHook/*.c*)

LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv2
LOCAL_LDLIBS := -llog -landroid

include $(BUILD_SHARED_LIBRARY)
2 changes: 1 addition & 1 deletion app/src/main/jni/src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void *main_thread(void *) {
sleep(1);
} while (g_growtopia_handle == nullptr);

Game::Hook::init();
game::hook::init();

// Now we can exit the thread.
pthread_exit(nullptr);
Expand Down
7 changes: 2 additions & 5 deletions app/src/main/jni/src/game/Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#define GTS(x) dlsym(g_growtopia_handle, x)

static float g_width{ 0.0f };
static float g_height{ 0.0f };

// Fix for printing blank message in the console.
void (*LogMsg)(const char *, ...);
void LogMsg_hook(const char *msg, ...) {
Expand All @@ -32,8 +29,8 @@ void LogMsg_hook(const char *msg, ...) {
KittyMemory::callFunction<const char *>(GTS("_Z10GetAppNamev")), buffer);
}

namespace Game {
namespace Hook {
namespace game {
namespace hook {
void init() {
// set Dobby logging level.
log_set_level(0);
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/jni/src/game/Hook.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

namespace Game {
namespace Hook {
namespace game {
namespace hook {
void init();
} // namespace hook
} // namespace game
Loading

0 comments on commit 5434013

Please sign in to comment.