[TUTORIAL]Add the "Delete" button on the screenshot preview

Search This thread

sportik555

Senior Member
Nov 18, 2013
313
268
Almaty
Requirement:
1. apktool 1.5.2
2. Notepad++
3. Deodex System
---------------------------------------------------
1. Decompile SystemUI.apk
2. Download delete_button.rar from attachment and merge to your SystemUI.apk
3.Open /res/value/stings with Notepad++ add the following lines:
<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>
4.Now compile your SystemUI.apk
5.Now decompile the SystemUI.apk you just compiled
6.Navigate to com/android/systemui/screenshot/DeleteScreenshot.smali
7. find 0x7f090049 delete id
And replace your id
<public type="string" name="screenshot_delete_confirmation" id
8.Navigate to SystemUI\smali\com\android\systemui\screenshot\SaveImageInBackgroundTask.smali
find id and delete id and replace your id
0x10405b7 (-Framework-res- public.xml) = <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"
9. AndroidManifest.xml
find
Code:
<service android:exported="false" android:name=".screenshot.TakeScreenshotService" android:process=":screenshot"/>
and change to
Code:
 <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" />
        <service android:name=".LoadAverageService" android:exported="true" />
find
<uses-permission android:name="android.permission.CRYPT_KEEPER" />
change to
Code:
<uses-permission android:name="android.permission.CRYPT_KEEPER" />
    <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" />
10. Save the file and close it.
11. Now recompile your SystemUI.apk and sign it.
12. Enjoy!
Thanks - grisha84
 

Attachments

  • delete_button.rar
    7.1 KB · Views: 717
Last edited:

sportik555

Senior Member
Nov 18, 2013
313
268
Almaty
Screenshotes
 

Attachments

  • Screenshot_2014-12-15-04-15-41.png
    Screenshot_2014-12-15-04-15-41.png
    240.1 KB · Views: 2,474
  • Like
Reactions: Dzepar

devilmaycry2020

Senior Member
Apr 27, 2013
1,399
248
thanks

please fix all
because i use apktool_2.0.0rc3 to decompile my systemUI and its dont have .parameter only have .param p1, "xxx"

p/s : i've fixed it already but why dont have delete confirm message ?
 
Last edited:

sportik555

Senior Member
Nov 18, 2013
313
268
Almaty
why dont use newest apktool ? old apktool can't decompile android 4.4
and maybe you missed add a call parameter to DeleteScreenshot.smali in GlobalScreenshot.smali .i'm using android 4.3

smali for apktool 1.5.2 , old can decompile 4.4
maybe you missed add a call parameter to DeleteScreenshot.smali in GlobalScreenshot.smali
no it is not necessary to do,tested 3 sony android 4.4 phones and work delete button
 

sportik555

Senior Member
Nov 18, 2013
313
268
Almaty
i said it worked but what string "screenshot_delete_confirmation" use for ? i mean when i press delete icon it dont show any confirm message want to delete or not.

screenshot_delete_confiramation use for DeleteScreenshot.smali
6.Navigate to com/android/systemui/screenshot/DeleteScreenshot.smali
7. find 0x7f090049 delete id
And replace your id
Quote:
<public type="string" name="screenshot_delete_confirmation" id
i mean when i press delete icon it dont show any confirm message want to delete or not
you are wrong edited AndroidManifest.xml .
 

Attachments

  • AndroidManifestexample.zip
    2.4 KB · Views: 28

devilmaycry2020

Senior Member
Apr 27, 2013
1,399
248
screenshot_delete_confiramation use for DeleteScreenshot.smali


you are wrong edited AndroidManifest.xml .

So string "screenshot_delete_confirmation" is useless it didn't show anywhere. how do you know i were wrong edited AndroidManifest.xml? i've not upload any my file to you.
anyway here is my file.
 

Attachments

  • myfile.zip
    23.6 KB · Views: 16

sportik555

Senior Member
Nov 18, 2013
313
268
Almaty
Can OP please disable emoticons in the first post? It's annoying to copy code and there are some emoticons in the middle..

And yes there is an option to disable emoticons on the post... Just edit it properly or put
Code:
 [/ code] in the code sections...  Not QUOTE.. 

Enviado do meu SM-N9005 através de Tapatalk[/QUOTE]

I find 1 emotions post and post edit
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    Requirement:
    1. apktool 1.5.2
    2. Notepad++
    3. Deodex System
    ---------------------------------------------------
    1. Decompile SystemUI.apk
    2. Download delete_button.rar from attachment and merge to your SystemUI.apk
    3.Open /res/value/stings with Notepad++ add the following lines:
    <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>
    4.Now compile your SystemUI.apk
    5.Now decompile the SystemUI.apk you just compiled
    6.Navigate to com/android/systemui/screenshot/DeleteScreenshot.smali
    7. find 0x7f090049 delete id
    And replace your id
    <public type="string" name="screenshot_delete_confirmation" id
    8.Navigate to SystemUI\smali\com\android\systemui\screenshot\SaveImageInBackgroundTask.smali
    find id and delete id and replace your id
    0x10405b7 (-Framework-res- public.xml) = <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"
    9. AndroidManifest.xml
    find
    Code:
    <service android:exported="false" android:name=".screenshot.TakeScreenshotService" android:process=":screenshot"/>
    and change to
    Code:
     <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" />
            <service android:name=".LoadAverageService" android:exported="true" />
    find
    <uses-permission android:name="android.permission.CRYPT_KEEPER" />
    change to
    Code:
    <uses-permission android:name="android.permission.CRYPT_KEEPER" />
        <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" />
    10. Save the file and close it.
    11. Now recompile your SystemUI.apk and sign it.
    12. Enjoy!
    Thanks - grisha84
    3
    @sportik555 can you provide smali for apktools 2.0 rc3?
    because my systemui doesnt decompile with 1.5.2

    Here you go. Sorry it took so long! :(
    1
    1
    [MENTION=5555617]
    Do you know how to add clear all button in recent apps? Or know some tutorial?
    All you needed was a little research. :) http://xdaforums.com/showthread.php?t=2614356 (I prefer the Z3 style)
    1
    Can OP please disable emoticons in the first post? It's annoying to copy code and there are some emoticons in the middle..

    And yes there is an option to disable emoticons on the post... Just edit it properly or put
    Code:
     [/ code] in the code sections...  Not QUOTE.. 
    
    Enviado do meu SM-N9005 através de Tapatalk