Remove All Ads from XDA

[GUIDE][GB] Material Recent

541 posts
Thanks Meter: 203
By zhaozihanzzh, Senior Member on 30th July 2018, 03:23 AM
Post Reply Email Thread
Hello to everyone.
Material Recent for Gingerbread
Made by zhaozihanzzh(ME Failed Coder), Open source
Created 2018-07-24
Last updated 2018-08-10

Note: If your native language is Chinese, you can go to this thread.

Hello guys. I have been making this material recent for a while. The project is based on @tentenponce 's SwipeRecentApps and ZieIony's library MaterialRecents. And I used m0r0's code to fix some bugs. I am a noob, but after many days' work I finally managed to get the performance improved and be able to convert it into framework. I made a short video for this:!JJUVyYpL!cHySc82Vt...E6q4Do3AcXTXIo

- Show the latest 7 recent apps
- Click to launch the application, swipe the card to try ending a process and long press the card to open application settings
- Click the clear button to launch an activity which is used to end processes

To start with, you need:
- Decompile / Recompile experience
- A rooted Android 2.3 with a process management app (the same as SwipeRecentApps)
- To be able to run Apktool 1.5.2
Before doing this, make sure you have a backup and are able to unbrick your phone.


1. Decompile framework-res.apk and unzip the res folder to your decompiled files. (If your phone is not MDPI, you can manually resize the clear icon and put it under the proper drawable-??dpi folder.)

2. Open res/values/ids.xml and add the following lines before :
    <item type="id" name="materialrecents_recentContent">false</item>
    <item type="id" name="materialrecents_recentTitle">false</item>
    <item type="id" name="materialrecents_recentIcon">false</item>
    <item type="id" name="mainlayout">false</item>
    <item type="id" name="materialrecents_recentHeader">false</item>
    <item type="id" name="taskman">false</item>
    <item type="id" name="noapps">false</item>
    <item type="id" name="recent_frame">false</item>
Note: if you have done tenten's SwipeRecentApps you will find some ids already exist and you shouldn't add them.
Then, open res/values/strings.xml and add the following line before :
    <string name="kill_app">The process has already been tried to end.</string>
3.Recompile framework-res and decompile the generated apk file and open the decompiled res/values/public.xml.(You can sign the generated framework-res apk properly and then let the apk wait for a while) Search for the item name below and write down their names and values:
Left: type Right: name
"color" transparent (I think this ID is same in all android devices, so maybe we can ignore it)
"layout" recent_apps_dialog
"id" taskman
"id" noapps
"id" mainlayout
"string" no_recent_tasks
"id" recent_frame
"string" kill_app
"layout" material_recents_card
"id" materialrecents_recentTitle
"id" materialrecents_recentIcon
"id" materialrecents_recentHeader
"id" materialrecents_recentContent

4. You need to have NineOldAndroids in your framework jars. Maybe some other guides you have done already add these library smalis to your framework.jar or android.policy.jar, such as the "nineoldandroids" in Ripple Effects on Button or "tentwentyoldandroids" in SwipeRecentApps. Therefore, if you already have this library, then you don't need to add my smali/com/noas folder and you should use a uniform path and name.(For example, if your path is com/nineoldandroids, then you should replace all the "com/noas" in all the smali files in smali/com/android/ and smali/tk/ with "nineoldandroids". By the way, in order to prevent Apps from loading the system NineOldAndroids instead of loading it from their own dex, I suggest not using "com/nineoldandroids".) If your ROM doesn't have nineoldandroids, or you don't understand what I am saying, then decompile android.policy.jar and merge the smali/com/noas folder.

5.Decompile android.policy.jar (If you have decompiled this in the 4th step, you don't need to decompile it again) and backup all the smali files related to recentapps and delete them. Then merge smali/com/android folder and smali/tk folder to your smali. After that, open smali/com/android/internal/policy/impl/RecentApplicationsDialog.smali and replace all the id numbers (commented with "#") with your own numbers which you have written down before. Notice that you should remove the first "0" after "0x", for example, if your id is 0x01080388, you are supposed to add "0x1080388" to your smali file. Do the same operation to smali/tk/zielony/merecents/RecentsList.smali.

6. Open smali/com/android/internal/policy/impl/RecentApplicationsDialog$100000001.smal and replace "" with the package name of your task management app, and replace " gerActivity" with the task management activity of your application.

7. Recompile android.policy.jar and sign correctly. Push the modified android.policy.jar and framework-res.apk into system.

Source code:
If you want to compile it from source and decompile it into system by yourself, make sure the code
in onCreate method in uncommented. I commented this line only for directly build apk and testing. And the class path in source code is different from my smali.

Note: If you face problem when using horizontal screen, try to change the value of paddingLeft and paddingRight in the RelativeLayout in res/layout-land/recent_apps_dialog.xml according to your screen.

In fact, I don't have much time, so I am sorry that if you have some questions, probably I cannot help you.

- tenten
- ZieIony
- m0r0
And thanks to NineOldAndroids.

This project is born with the help of open source project, and hope this project can continue to help others.
The Following 2 Users Say Thank You to zhaozihanzzh For This Useful Post: [ View ] Gift zhaozihanzzh Ad-Free
30th July 2018, 03:25 AM |#2  
zhaozihanzzh's Avatar
OP Senior Member
Flag Zibo City,Shandong province in China
Thanks Meter: 203

Sent from my HUAWEI CHM-TL00H using XDA Labs
30th July 2018, 03:47 AM |#3  
zhaozihanzzh's Avatar
OP Senior Member
Flag Zibo City,Shandong province in China
Thanks Meter: 203
Hope this thread can help you.

Sent from my HUAWEI CHM-TL00H using XDA Labs
Attached Thumbnails
Click image for larger version

Name:	screencast_4.png
Views:	326
Size:	28.3 KB
ID:	4561017   Click image for larger version

Name:	screencast_5.png
Views:	300
Size:	22.6 KB
ID:	4561018   Click image for larger version

Name:	screenshot-1532432847329.jpg
Views:	296
Size:	86.8 KB
ID:	4561019  
30th July 2018, 06:30 AM |#4  
RaiZProduction's Avatar
Senior Member
Flag Tours
Thanks Meter: 554
Good job
10th August 2018, 11:44 PM |#5  
zhaozihanzzh's Avatar
OP Senior Member
Flag Zibo City,Shandong province in China
Thanks Meter: 203
Do you still want to swipe to kill process? I managed to get swipe work in this recent dialog(I wrote the code myself so maybe some bugs). Check the updated OP to get the new feature.

Sent from my HUAWEI CHM-TL00H using XDA Labs
Attached Thumbnails
Click image for larger version

Name:	screenshot-1533913277772.jpg
Views:	88
Size:	70.3 KB
ID:	4569036  
25th August 2018, 08:19 AM |#6  
Junior Member
Thanks Meter: 0
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes