[Android Software/Hacking General [Developers Only]] Androguide.fr:
Guide for rom developers who want to implement pmr in their builds

Older Changelogs

Developer's Guide on Implementing PmR in your Roms​

1) Implementing PmR with a custom preset & playstore OTA updates working

Flash your Rom & apply the tweaks and options you want to be included in your preset

Create a /data folder at the root of your Rom's zip package, and in this folder create a /app folder (so you now have a /data/app path

Download this version of the PmR apk and place it in the freshly created /data/app folder in your Rom's zip

(this is the playstore-signed version, which will allow your users to receive OTA updates as if they installed it from the playstore)

Grab the following files from your device and place them at the corresponding locations in your Rom's zip package :

(If some of those files are missing on your device, don't worry, this simply means they are not needed in your preset)

- /system/etc/init.d/99Pimp_my_Rom
- /system/etc/init.d/98Entropy
- /system/etc/init.d/S90zipalign
- /system/etc/init.d/04dual_bootanim
- /system/etc/install-recovery.sh
- /system/etc/hosts
- /system/bin/entropy-gen
- /system/xbin/rngd
- /system/xbin/openvpn

Note : this does not include the Apps & Mods section, except for the Adblock & OpenVPN Support

Create the following path of folders in your Rom's zip : /data/data/com.androguide.pimp.my.rom/shared_prefs/

On your device, navigate to /data/data/com.androguide.pimp.my.rom/shared_prefs and copy all the content of this folder to your Rom's zip freshly created /data/data/com.androguide.pimp.my.rom/shared_prefs/ folder

Open your Rom zip's /system/build.prop in a text editor

Now open your device's /system/build.prop in a text editor, and copy everything from the first occurence of "### Pimp my Rom : xxx" to the end of the file, then paste it at the end of your Rom's build.prop (Do not forget to save the modifications)

Ok, now we have added all the required assets for Pimp my Rom and your custom preset, let's pass-on to the updater-script modifications in order to install those assets properly and set the right permissions to them.

In your Rom's zip package, navigate to /META-INF/com/google/android and open updater-script in a text editor

Copy the following lines near the end of the file, but before "unmount("/system");" :

ui_print("Installing Pimp my Rom with a custom preset...");
package_extract_dir("data", "/data");
set_perm_recursive(0, 0, 0755, 0755, "/system/etc/init.d");
set_perm_recursive(0, 0, 0771, 0660, "/data/data/com.androguide.pimp.my.rom/shared_prefs");
set_perm(0, 0, 0644, "/data/app/com.androguide.pimp.my.rom-1.apk");
set_perm(0, 0, 0644, "/system/etc/hosts");
set_perm(0, 0, 0755, "/system/etc/install-recovery.sh"); [COLOR="DarkRed"][B]<<< Do NOT include this line if you didn't activate init.d through PmR in your preset[/B][/COLOR]
set_perm(0, 0, 0755, "/system/bin/entropy-gen"); [COLOR="DarkRed"][B]<<< Do NOT include this line if you didn't use the Entropy Generator in your preset[/B][/COLOR]
set_perm(0, 0, 0755, "/system/xbin/rngd"); [COLOR="DarkRed"][B]<<< Do NOT include this line if you didn't use the Entropy Generator in your preset[/B][/COLOR]
set_perm(0, 0, 0755, "/system/xbin/openvpn"); [COLOR="DarkRed"][B]<<< Do NOT include this line if you didn't activate OpenVPN support in your preset[/B][/COLOR]
ui_print("Done installing Pimp my Rom - by Androguide.fr@xda");

2) Adding a Pimp my Rom entry to your Rom's Settings.apk - Coming Soon