Skip to content

Commit 2cb1fef

Browse files
committed
AndroidMenu-v3.0-Upload
1 parent 2ffb968 commit 2cb1fef

17 files changed

Lines changed: 1616 additions & 16 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
| Contains | Awsers
1010
|------------- |:-------------:
1111
| _Simple Menu_ | ✔
12-
| _Memory Tools_ |
12+
| _Memory Tools_ |
1313
| _Invoke in applications_ | ✔
1414
| _Organizad code_ | ✔
1515
| _Easy understanding_ | ✔

app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ plugins {
44

55
android {
66
namespace 'com.androidmenu'
7-
compileSdk 33
7+
compileSdk 34
88

99
defaultConfig {
1010
applicationId "com.androidmenu"
1111
minSdk 25
12-
targetSdk 33
12+
targetSdk 34
1313
versionCode 1
1414
versionName "1.0"
1515

@@ -39,5 +39,5 @@ android {
3939
}
4040

4141
dependencies {
42-
implementation 'com.google.android.material:material:1.5.0'
42+
4343
}

app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
<application
66
android:allowBackup="true"
7-
android:dataExtractionRules="@xml/data_extraction_rules"
87
android:fullBackupContent="@xml/backup_rules"
98
android:icon="@mipmap/ic_launcher"
109
android:label="@string/app_name"

app/src/main/cpp/Hack/Draw.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include "../Tools/DrawTool/Draw.h"
2+
3+
extern "C"
4+
JNIEXPORT void JNICALL
5+
Java_com_androidmenu_Menu_OnDrawLoad(JNIEnv *env, jclass clazz, jobject drawView, jobject canvas) {
6+
DrawView draw = DrawView(env, drawView, canvas);
7+
if (draw.isValid()) {
8+
draw.DrawText(Color::Blue(), "Android Menu", Vector2(draw.getWidth() / 2, draw.getHeight() / 8), Vars::textSize);
9+
}
10+
}

app/src/main/cpp/Hack/Import.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#include "Hook.h"
22
#include "SDK.h"
33
#include "Offsets.h"
4-
#include "Utils.h"
4+
#include "Utils.h"
5+
#include "Draw.h"
6+
#include "../Tools/Vectors/Vector2.h"
7+
#include "../Tools/Vectors/Vector3.h"
8+
#include "../Tools/Vectors/Rect.h"
9+
#include "../Tools/DrawTool/Draw.h"

app/src/main/cpp/Hack/SDK.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
namespace Vars {
55

6-
int playerSpeed = 0;
6+
int playerSpeed;
7+
int textSize = 20;
78

89
};
910

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#ifndef ANDROID_MENU_COLOR_H
2+
#define ANDROID_MENU_COLOR_H
3+
4+
class Color
5+
{
6+
public:
7+
float r;
8+
float g;
9+
float b;
10+
float a;
11+
12+
Color() : r(0), g(0), b(0), a(0) {}
13+
14+
Color(float r, float g, float b, float a) : r(r), g(g), b(b), a(a) {}
15+
16+
Color(float r, float g, float b) : r(r), g(g), b(b), a(255) {}
17+
18+
static Color Red()
19+
{
20+
return Color(255, 0, 0);
21+
}
22+
23+
static Color Green()
24+
{
25+
return Color(0, 255, 0);
26+
}
27+
28+
static Color White()
29+
{
30+
return Color(255, 255, 255);
31+
}
32+
33+
static Color Black()
34+
{
35+
return Color(0, 0, 0);
36+
}
37+
38+
static Color Yellow()
39+
{
40+
return Color(255, 255, 0);
41+
}
42+
43+
static Color Blue()
44+
{
45+
return Color(1, 130, 255);
46+
}
47+
48+
};
49+
50+
#endif
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
#include "Color.h"
2+
#include "../Vectors/Vector2.h"
3+
#include "../Vectors/Rect.h"
4+
5+
#ifndef ANDROID_MENU_DRAW_H
6+
#define ANDROID_MENU_DRAW_H
7+
8+
class DrawView
9+
{
10+
private:
11+
JNIEnv *_env;
12+
jobject _cvsView;
13+
jobject _cvs;
14+
15+
public:
16+
DrawView()
17+
{
18+
_env = nullptr;
19+
_cvsView = nullptr;
20+
_cvs = nullptr;
21+
}
22+
23+
DrawView(JNIEnv *env, jobject cvsView, jobject cvs)
24+
{
25+
this->_env = env;
26+
this->_cvsView = cvsView;
27+
this->_cvs = cvs;
28+
}
29+
30+
bool isValid() const
31+
{
32+
return (this->_env != nullptr && this->_cvsView != nullptr && this->_cvs != nullptr);
33+
}
34+
35+
int getWidth() const
36+
{
37+
if (isValid())
38+
{
39+
return _env->CallIntMethod(_cvs, _env->GetMethodID(_env->GetObjectClass(_cvs), "getWidth", "()I"));
40+
}
41+
return 0;
42+
}
43+
44+
int getHeight() const
45+
{
46+
if (isValid())
47+
{
48+
return _env->CallIntMethod(_cvs, _env->GetMethodID(_env->GetObjectClass(_cvs), "getHeight", "()I"));
49+
}
50+
return 0;
51+
}
52+
53+
void DrawLine(Color color, float thickness, Vector2 start, Vector2 end)
54+
{
55+
if (isValid())
56+
{
57+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawLine", "(Landroid/graphics/Canvas;IIIIFFFFF)V"), _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, thickness, start.X, start.Y, end.X, end.Y);
58+
}
59+
return;
60+
}
61+
62+
void DrawText(Color color, const char * str, Vector2 pos, float size)
63+
{
64+
if (isValid())
65+
{
66+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawText", "(Landroid/graphics/Canvas;IIIIFLjava/lang/String;FFF)V"), _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, 0.6f, _env->NewStringUTF(str), pos.X, pos.Y, size);
67+
}
68+
return;
69+
}
70+
71+
void DrawCircle(Color color, float stroke, Vector2 pos, float radius)
72+
{
73+
if (isValid())
74+
{
75+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawCircle", "(Landroid/graphics/Canvas;IIIIFFFF)V"), _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, stroke, pos.X, pos.Y, radius);
76+
}
77+
return;
78+
}
79+
80+
void DrawRoundRect(Color color, float stroke, int cx, int cy, Rect rect)
81+
{
82+
if (isValid())
83+
{
84+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawRoundRect", "(Landroid/graphics/Canvas;IIIIFIIFFFF)V"), _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, stroke, cx,cy, rect.x, rect.y, rect.w, rect.h);
85+
}
86+
return;
87+
}
88+
89+
void DrawTextRect(Color color, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, Vector2 pos)
90+
{
91+
if (isValid())
92+
{
93+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawTextRect", "(Landroid/graphics/Canvas;IIIIIIIIIIIIFF)V"), _cvs, (int) color.a, (int) color.r,(int) color.g, (int) color.b, a1, a2, a3, a4, a5, a6, a7, a8, pos.X, pos.Y);
94+
}
95+
return;
96+
}
97+
98+
void DrawFilledBox(Color color, Rect rect)
99+
{
100+
if (isValid())
101+
{
102+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawFilledRect", "(Landroid/graphics/Canvas;IIIIFFFF)V"), _cvs, (int) atoi("157"), (int) color.r, (int) color.g, (int) color.b, rect.x, rect.y, rect.w, rect.h);
103+
}
104+
return;
105+
}
106+
107+
void DrawFilledRect(Color color, Rect rect)
108+
{
109+
if (isValid())
110+
{
111+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawFilledRect", "(Landroid/graphics/Canvas;IIIIFFFF)V"), _cvs, (int) color.a, (int) color.r,(int) color.g, (int) color.b, rect.x, rect.y, rect.w, rect.h);
112+
}
113+
return;
114+
}
115+
116+
void DrawFilledCircle(Color color, Vector2 pos, float radius)
117+
{
118+
if (isValid())
119+
{
120+
_env->CallVoidMethod(_cvsView, _env->GetMethodID(_env->GetObjectClass(_cvsView), "DrawFilledCircle", "(Landroid/graphics/Canvas;IIIIFFF)V"), _cvs, (int) color.a, (int) color.r, (int) color.g, (int) color.b, pos.X, pos.Y, radius);
121+
}
122+
return;
123+
}
124+
125+
void DrawBox(Color color, float stroke, Rect rect)
126+
{
127+
Vector2 v1 = Vector2(rect.x, rect.y);
128+
Vector2 v2 = Vector2(rect.x + rect.w, rect.y);
129+
Vector2 v3 = Vector2(rect.x + rect.w, rect.y + rect.h);
130+
Vector2 v4 = Vector2(rect.x, rect.y + rect.h);
131+
132+
DrawLine(color, stroke, v1, v2); // LINE UP
133+
DrawLine(color, stroke, v2, v3); // LINE RIGHT
134+
DrawLine(color, stroke, v3, v4); // LINE DOWN
135+
DrawLine(color, stroke, v4, v1); // LINE LEFT
136+
}
137+
138+
void DrawCornerBox(Color color, float stroke, Rect rect, int cx, int cy)
139+
{
140+
DrawLine(color, stroke, Vector2(rect.x, rect.y), Vector2(rect.x + (rect.w / cx), rect.y));
141+
DrawLine(color, stroke, Vector2(rect.x, rect.y), Vector2(rect.x, rect.y + (rect.h / cy)));
142+
143+
DrawLine(color, stroke, Vector2(rect.x + rect.w, rect.y), Vector2(rect.x + rect.w - (rect.w / cx), rect.y));
144+
DrawLine(color, stroke, Vector2(rect.x + rect.w, rect.y), Vector2(rect.x + rect.w, rect.y + (rect.h / cy)));
145+
146+
DrawLine(color, stroke, Vector2(rect.x, rect.y + rect.h), Vector2(rect.x + (rect.w / cx), rect.y + rect.h));
147+
DrawLine(color, stroke, Vector2(rect.x, rect.y + rect.h), Vector2(rect.x, rect.y + rect.h - (rect.h / cy)));
148+
149+
DrawLine(color, stroke, Vector2(rect.x + rect.w, rect.y + rect.h), Vector2(rect.x + rect.w - (rect.w / cx), rect.y + rect.h));
150+
DrawLine(color, stroke, Vector2(rect.x + rect.w, rect.y + rect.h), Vector2(rect.x + rect.w, rect.y + rect.h - (rect.h / cy)));
151+
}
152+
};
153+
154+
#endif
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef ANDROID_MENU_RECT_H
2+
#define ANDROID_MENU_RECT_H
3+
4+
class Rect {
5+
public:
6+
float x;
7+
float y;
8+
float w;
9+
float h;
10+
11+
Rect() {
12+
this->x = 0;
13+
this->y = 0;
14+
this->w = 0;
15+
this->h = 0;
16+
}
17+
18+
Rect(float x, float y, float w, float h) {
19+
this->x = x;
20+
this->y = y;
21+
this->w = w;
22+
this->h = h;
23+
}
24+
25+
bool operator==(const Rect &src) const {
26+
return (src.x == this->x && src.y == this->y && src.h == this->h &&
27+
src.w == this->w);
28+
}
29+
30+
bool operator!=(const Rect &src) const {
31+
return (src.x != this->x && src.y != this->y && src.h != this->h &&
32+
src.w != this->w);
33+
}
34+
};
35+
36+
#endif

0 commit comments

Comments
 (0)