[Sony Cross-Device Development Themes and Apps] DeathZeroFx:
In The Name of Allah​

Hi, I'm DeathZeroFx!

I updated the guide, big thanks to [MENTION=2902434]Pandemic[/MENTION] and [MENTION=7144653]Dobsgw[/MENTION] for a lot of help about the services.jar, thank you very much! ;)

If your device is Xperia Z5 Family (Confirm works on Z5C & Z5, should work on Z5P too), then you can go to my other thread

This guide is to port only the SmartCleaner, guide how to port Xperia X Settings.apk is not included ;)

Update:

Confirm works on Z5 Series and Z3, should work on other devices ;)

Requirements

1. Experience about how to baksmaling/smaling jar & know how to modify your phone ;)

2. Baksmaling/smaling tool (I use Apktool 2.1.1 because it have built in smaling/baksmaling) ;)

3. This File (Dev-Host) / Mirror (MediaFire)

4. and this file for the services.jar port

4. framework.jar & services.jar from your device

5. SmartCleaner.apk

The Guide!

0. Always make backup! framework.jar, services.jar and Settings.apk

For port the framework.jar

1. Baksmaling the framework.jar

2. go to smali_classes2

3. Unzip the file (requirements no. 3), and merge the files

4. Check smali_classes2/com/sonymobile/serviceextend if this folder exists, You are good!

For screenshot, look at this:

If this folder (serviceextend) and 5 files contain in it exists at smali_classes2/com/sonymobile/ you are ready to go!

5. smaling the framework.jar

For port the services.jar

1. Baksmaling the services.jar

2. go to com/android/server/am and open ActivityManagerService.smali

In this smali, you have to save 3 different ids

3. Find this method: .method private loadResourcesOnSystemReady

and then find lines similar like this picture:

You can see the blue highlighted id, on your smali, save the id, lets make that id #1

4. Find this method: .method public systemReady

Scroll down until you find similar like this picture:

you can see 2 highlighted ids, the yellow one and the blue one, on your smali, save the yellow id as id #2, and the blue id as id #3

5. Open the files that you just downloaded (services.jar Files)

Open the ActivityManagerService.smali

6. Find this id: 0x1120087

Replace it with your id #1

7. Find this id: 0x10402d7

Replace it with your id #2

8. Find this id: 0x10402d8

Replace it with your id #3

Save it

9. Now go to your smali again, go to com/android/server/pm and open PackageManagerService.smali (your device)

We will collect the ids again for replace to your downloaded PackageManagerService.smali file

10. Find this method: .method private isInstallationBlockedByDevicePolicy

and then scroll down until you found similar codes like this picture:

You can see yellow and blue highlighted ids, on your smali, save it to id #1 and id #2

11. Find this method: .method private isUninstallationBlockedByDevicePolicy

and then scroll down until you found similar codes like this picture:

the yellow and blue highlighted ids, on your smali, save it to id #4 and id #5

12. Find this method: .method private movePackageInternal

scroll down until you found similar codes like this picture:

the yellow highlighted id, on your smali, save it to id #5

13. Find this method: .method private performBootDexOpt

scroll down until you found similar codes like this picture:

the highlighted id, on your smali, save it to id #6

14. Find this method: .method private populateBlacklist

scroll down until you found similar codes like this picture:

the highlighted id, on your smali, save it to id #7

15. Find this method: .method public performBootDexOpt

scroll down until you found similar codes like this picture:

the highlighted id, on your smali, save it to id #8

Okay, you have saved 8 ids from your smali, now go to your services.jar files that you downloaded, and open pm/PackageActivityManager.smali

16. Find this id: 0x1040602

Replace with your id #1

17. Find this id: 0x1040603

Replace with your id #2

18. Find this id: 0x1040604

Replace with your id #3

19. Find this id: 0x1040605

Replace with your id #4

20. Find this id: 0x11200d1

Replace with your id #5

21. Find this id: 0x104038c

Replace with your id #6

22. Find this id: 0x1070053

Replace with your id #7

23. Find this id: 0x104038b

Replace with your id #8

Save it.

After you edit 2 files (am/ActivityManagerService.smali and pm/PackageManagerService.smali)

Replace all the am and pm files from your downloaded services.jar Files to your services.jar

smaling the services.jar

Done!

This guide works for Xperia Z5 Compact, I don't know about other devices, it should work too. Make sure you do backups before doing this. and let me know ;)

Note: you have to use Xperia X Settings.apk to use SmartCleaner, I use jjwrongjj's Xperia X Settings port for Z2/Z3 (can also use on Z5C, and the port already have SmartCleaner.apk on it), or you can use another Xperia X Settings Port if you want ;)

Credits

[MENTION=4931701]Ben Ling[/MENTION] (for his Xperia X deodexed system dump)

[MENTION=2902434]Pandemic[/MENTION] & [MENTION=7144653]Dobsgw[/MENTION] ( a lot of help from them, specially on services.jar porting, thank you very much)

If you having trouble with my guide, just post ;)

Sorry for my bad english, and my bad guide

Feel free to correct me if there's something wrong ;) really looking forward for your testing, because this is the method I use, but still if there's any issue let me know ;)

If you find this guide useful, please press thanks button! and Don't forget to give thanks to everyone in the credits also ;)