[Android Themes] ocoot:
​

oke, a little desc. this guide will allow you to add delete button on screenshot image preview on statusbar expanded. see on the image above :p

this guide maybe will work on any ROM based on AOSP (JB-KK). Tested on KK 4.4.2, so i need your feedback it works or not ;)

so, lets begin.

REQUIREMENT:

-Brain

-More patient

-Requirement file (attach)

HOW-TO:

1. Decompile your SystemUI.apk

2. Then, goto res/values/strings.xml

3. Add the code below on the end

<string name="screenshot_delete_action">Delete</string>
<string name="screenshot_delete_confirmation">Screenshot deleted.</string>
<string name="permdesc_screenshot">Capture screenshot</string>
<string name="permlab_screenshot">Allows the app to cature a screenshot. This is protected by SystemUI.</string>
<string name="screenshot_toast">Screenshot in %1$d seconds</string>
</resources>

4. Download the additional file on the attached file, extract it to the decompiled folder. if confirmation dialog appears, choose overwrite all

5. Save, compile then recompile again

6. Now, this is tricky part and read carefully

7. Open DeleteScreenshot.smali on com/android/systemui/screenshot/

8. Find this code

0x7f0a0109

, replace that code with your new public ids

0x7f0a0109 = <public type="string" name="screenshot_delete_confirmation" id="0x7fxxxxxx"

9. Open GlobalScreenshot.smali, do a same thing like previous step

0x7f040003 = <public type="layout" name="global_screenshot"
0x7f080008 = <public type="id" name="global_screenshot_background"
0x7f080009 = <public type="id" name="global_screenshot"
0x7f08000a = <public type="id" name="global_screenshot_flash"
0x7f0b0035 = <public type="dimen" name="global_screenshot_bg_padding"
0x7f090081 = <public type="string" name="screenshot_failed_text"
0x7f090080 = <public type="string" name="screenshot_failed_title"
0x7f0200f3 = <public type="drawable" name="stat_notify_image_error"
0x1050006 (framework-res.apk) = <public type="dimen" name="notification_large_icon_height"
0x1080500 (framework-res.apk) = <public type="drawable" name="rate_star_big_on"

10. Open SaveImageInBackgroundTask.smali, do a same thing like previous step above

0x10405b7 (framework-res.apk) = <public type="string" name="share"
0x7f09007b = <public type="string" name="screenshot_saving_ticker"
0x7f09007c = <public type="string" name="screenshot_saving_title"
0x7f09007d = <public type="string" name="screenshot_saving_text"
0x7f0200f2 = <public type="drawable" name="stat_notify_image"
0x7f020022 = <public type="drawable" name="ic_menu_share"
0x7f020021 = <public type="drawable" name="ic_menu_delete"
0x7f090048 = <public type="string" name="screenshot_delete_action"
0x7f09007e = <public type="string" name="screenshot_saved_title"
0x7f09007f = <public type="string" name="screenshot_saved_text"

11. Open AndroidManifest.xml, add this code below

<protected-broadcast android:name="android.permission.SCREENSHOT" />
<protected-broadcast android:name="android.intent.action.SCREENSHOT" />
<permission android:label="@string/permlab_screenshot" android:name="android.permission.SCREENSHOT" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_screenshot" />

before this line

<application android:label="@string/app_label"

so, it will look like this

<protected-broadcast android:name="android.permission.SCREENSHOT" />
<protected-broadcast android:name="android.intent.action.SCREENSHOT" />
<permission android:label="@string/permlab_screenshot" android:name="android.permission.SCREENSHOT" android:protectionLevel="signatureOrSystem" android:description="@string/permdesc_screenshot" />
<application android:label="@string/app_label"

12. Now, find this code

<service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot" />

then, rename to

<service android:name=".screenshot.TakeScreenshotService" android:permission="android.permission.SCREENSHOT" android:exported="false" android:process=":screenshot">
<intent-filter>
<android name="android.intent.action.SCREENSHOT" />
</intent-filter>
</service>
<receiver android:name=".screenshot.DeleteScreenshot" android:exported="true" />

13. Save all files, recompile then signin your SystemUI.apk

14. You may need to disable your signature on services.jar (

google it how to disable signature on service.jar

) ;)

15. Now, you done. flash your SystemUI.apk or push it

Credit:

Cyanogenmod

NB:

if you want implement this guide to your rom/mod, please give me credit. don't plagiat/claimed my work because i'll know it bro