Tutorial How to Mod PlayerPrefs of Unity Games (including IL2CPP)

Mika Cybertron

PMT Elite Modder
Original poster
Staff member
Modding-Team
Mar 24, 2017
908
65,042
1,213
24
Indonesia
How to Mod PlayerPrefs of Unity Games (including IL2CPP)

# Q & A
Q:
What is PlayerPrefs in Unity Games?
A: PlayerPrefs is a class that stores Player preferences between game sessions. It can store string, float and integer values into the user’s platform registry.

Q: Where is PlayerPrefs stored in?
A: On Android, PlayerPrefs are stored in `/data/data/pkg-name/shared_prefs/pkg-name.v2.playerprefs.xml` or `/data/data/pkg-name/shared_prefs/pkg-name.playerprefs.xml`

Q: How to make it works in your mods?
A: what you have to do is build the source code with Android Studio to get the smali files then call that smali file in `OnCreate` of Launch Activity Smali Games. but make sure the path of PlayerPrefs games is correct.


# Example
As an example you can use this game Defense Heroes - Apps on Google Play

Example Code:
Hidden content
** You must be signed up and reply to the thread or click 'Like' under this post before you can see the hidden links contained here. **
If you still facing issues revealing the hidden links, please read this.
# How to call the smali file into your mods
- Copy and Place the smali files that you get from Android Studio

- Then call the file with this smali code:
Hidden content
** You must be signed up and reply to the thread or click 'Like' under this post before you can see the hidden links contained here. **
If you still facing issues revealing the hidden links, please read this.

Download Source Code:
Hidden content
** You must be signed up and reply to the thread or click 'Like' under this post before you can see the hidden links contained here. **
If you still facing issues revealing the hidden links, please read this.
 
Last edited:

vaporsalesman

Rookie
Apr 17, 2023
2
1
3
24
United States
PlayerPrefs on Android are kept in either '/data/data/pkg-name/shared_prefs/pkg-name.v2.playerprefs.xml' or '/data/data/pkg-name/shared_prefs/pkg-name.playerprefs.xml'. To use the smali files, you must first generate them by compiling the source code in Android Studio, and then reference them in the 'OnCreate' method of the Launch Activity Smali Games. However, check the PlayerPrefs games' route to ensure it's right.
 
  • Like
Reactions: Mika Cybertron