├── .gitattributes ├── Android.mk ├── Application.mk ├── LICENSE ├── build.ps1 ├── main.cpp └── ndkpath.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | LOCAL_CPP_EXTENSION := .cpp .cc 5 | LOCAL_MODULE := glalphafunc 6 | LOCAL_SRC_FILES := main.cpp 7 | LOCAL_CFLAGS += -O2 -mfloat-abi=softfp -DNDEBUG -std=c++17 8 | LOCAL_C_INCLUDES += ./include 9 | LOCAL_LDLIBS += -llog $(LOCAL_PATH)/libGLESv2.so # Put your GLESv2 library here because NDK's built-in has no GLEXT functions :| 10 | include $(BUILD_SHARED_LIBRARY) -------------------------------------------------------------------------------- /Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := c++_static 2 | APP_ABI := armeabi-v7a 3 | APP_OPTIM := release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 RusJJ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /build.ps1: -------------------------------------------------------------------------------- 1 | $NDKPath = Get-Content $PSScriptRoot/NDKPath.txt 2 | Write-Output "NDK located at: $NDKPath" 3 | 4 | $buildScript = "$NDKPath/build/ndk-build" 5 | if (-not ($PSVersionTable.PSEdition -eq "Core")) { 6 | $buildScript += ".cmd" 7 | } 8 | 9 | Write-Output "[BUILD] Starting NDK..." 10 | & $buildScript NDK_PROJECT_PATH=$PSScriptRoot APP_BUILD_SCRIPT=$PSScriptRoot/Android.mk NDK_APPLICATION_MK=$PSScriptRoot/Application.mk NDK_DEBUG=0 11 | Write-Output "[BUILD] Done!" 12 | 13 | Exit $LASTEXITCODE -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define GL_GLEXT_PROTOTYPES 4 | #include 5 | #include 6 | 7 | MYMOD(net.rusjj.glalphafunc, GLAlphaFunc Crash Fix, 1.0, RusJJ) 8 | 9 | uintptr_t pGameLib = 0; 10 | extern "C" void OnModLoad() 11 | { 12 | pGameLib = aml->GetLib("libGTASA.so"); 13 | if(pGameLib) 14 | { 15 | aml->Unprot(pGameLib + 0x6BCBF8, sizeof(void*)); 16 | *(void**)(pGameLib + 0x6BCBF8) = (void*)glAlphaFuncQCOM; 17 | return; 18 | } 19 | 20 | pGameLib = aml->GetLib("libGTAVC.so"); 21 | if(pGameLib) 22 | { 23 | aml->Unprot(pGameLib + 0x7300E0, sizeof(void*)); 24 | *(void**)(pGameLib + 0x7300E0) = (void*)glAlphaFuncQCOM; 25 | return; 26 | } 27 | } -------------------------------------------------------------------------------- /ndkpath.txt: -------------------------------------------------------------------------------- 1 | D:\android-ndk --------------------------------------------------------------------------------