Skip to content

mcbegamerxx954/mcbe_shader_redirector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCBER

This crate is made to redirect MCBE shaders to ones from resource packs externally so that it can work with any mcbe version and even multiple platforms. for now it only supports Android and also ChromeOS.

Note

This repo is a dependency of draco-injector.

Warning

The redirector is still unstable and might have some bugs or crashes, please report those in this repo.

Confirmed working with

  • 1.20.73
  • 1.20.81
  • 1.21.0.03

Tip

This can automatically update renderdragon shaders to work using code ported to rust of MaterialBinTool made by ddf8196.
formatVersion V1 to V2 to be specific

Usage

  1. Go to Releases and download the .so file for your arch and rename it to libmcbe_r.so

  2. Open up your minecraft.apk. Place libmcbe_r.so in /lib/arch

  3. Make the library start with mc by any of these methods:

Method 1 (Draco Injector) (Easy)

This method automatically creates patched APK with MCBER.


Method 2 (Dex, Recommended if you want compatibility)

  • Open/Extract classes.dex in minecraft APK
  • Search the com.mojang.minecraftpe.MainActivity class
  • Inside of it, search the function OnCreate and paste this inside of it:
const-string v0, "mcbe_r"
invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V
invoke-virtual {p0}, Lcom/mojang/minecraftpe/MainActivity;->dracoSetupStorage()V
  • Then just before the function add this:
.method public native dracoSetupStorage()V
.end method

image
image
Done using MT Manager


Method 3 (Patchelf)

  • Download patchelf binary
  • Extract the libminecraftpe.so library from lib/(arch)
  • Run patchelf on it to make libmcbe_r a needed library: (replace path/to/ with the path to the library)
patchelf path/to/libminecraftpe.so --add-needed libmcbe_r.so
  1. Now if you did everything correctly you should have a patched mcbe that redirects shaders.

How to build (PC)

  • Install rust using rustup if you dont have it
  • Download the ndk
  • Add android target using "rustup target add"
  • Setup rust to use the ndk depending on your platform
  • cd to this repo and do "cargo build --release --target your-android-target"
  • Search for your .so in target folder
  • Now you have it

How to build (Android)

  • Install Termux if you dont have it
  • Update packages using "pkg upg"
  • Install essential stuff for building using "apt install build-essential"
  • Install rust using "pkg install rust"
  • git clone this repo
  • do "cargo build --release" on where the repo is
  • Now you should have your lib in target folder in repo dir

About

a (very) experimental shader redirector for android written in rust

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages