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

Mika Cybertron

PMT Elite Modder
Staff member
Modding-Team
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 registered and either click Like under this post or leave a comment before you can see the hidden links.
You may need to refresh the page after clicking Like. If you’re still having trouble revealing the hidden links, please read this.

Did you know? VIP Members can see all links instantly, no unlocking required.
Interested? Get VIP here.

# 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 registered and either click Like under this post or leave a comment before you can see the hidden links.
You may need to refresh the page after clicking Like. If you’re still having trouble revealing the hidden links, please read this.

Did you know? VIP Members can see all links instantly, no unlocking required.
Interested? Get VIP here.


Download Source Code:


! Hidden Content !
You must be registered and either click Like under this post or leave a comment before you can see the hidden links.
You may need to refresh the page after clicking Like. If you’re still having trouble revealing the hidden links, please read this.

Did you know? VIP Members can see all links instantly, no unlocking required.
Interested? Get VIP here.

 
Last edited:
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.
 
Back
Top Bottom