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

sportik555

Senior Member
Nov 18, 2013
313
268
0
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

Last edited:

devilmaycry2020

Senior Member
Apr 27, 2013
1,373
244
0
thanks

please fix all
.parameter "xxx"
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
0
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
 

devilmaycry2020

Senior Member
Apr 27, 2013
1,373
244
0
smali for apktool 1.5.2 , old can decompile 4.4

no it is not necessary to do,tested 3 sony android 4.4 phones and work delete button
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.
 

sportik555

Senior Member
Nov 18, 2013
313
268
0
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

devilmaycry2020

Senior Member
Apr 27, 2013
1,373
244
0
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

joluke

Senior Member
Jan 29, 2014
1,684
715
133
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
 
  • Like
Reactions: sportik555

sportik555

Senior Member
Nov 18, 2013
313
268
0
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