[HOW TO] Add screenshot option in power menu for every rom

Search This thread

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
Here it is ....
As some people here asked for it I'll try to explain how I learned to add screenshot option in power menu.

First I'd like to thank some special members that helped me a lot for doing this :
Championswimmer, Barath_000, Achotjan

First you need to know it's not an easy thing to do and you may have bootloop, reboot etc ... that's why you need time and most of everything backup to restore the modded files.

You'll need tools to do this.
I used a "all in one tool": android utility (thanks to tommytomatoe)
http://xdaforums.com/showthread.php?t=1167623
It can be used on linux / mac laptop

If you don't want to use it or using windows laptop you'll need apktool and dex2jar


Before beginning :
Make a backup of these 2 files in system/framework :

framework-res.apk

android.poilicy.jar

Why ? you'll work on these files so if it doesn't work you'll have a "safe working base" ...

Ready ?

1.Framework-res.apk
Decompile this file (with android utility or apktool)

In the "drawable-hpdi" folder place the png attached, and named it "whateveryouwant".
I advice you to keep the name it got as all my how to will name it like that ;)

Then go in the values folder,

You'll find several xml files, with notepad ++ or other xml editor open*: strings.xml and public*.xml

In strings.xml:

Add this line at the end of the file just above </resources> add the line*:

<string name="global_action_screenshot_txt">Take screenshot</string>

It must look like that*:

<string name="add_region_in_locale_picker_dummy_string">+</string>
<string name="global_action_sleep">Sleep mode</string>
<string name="global_action_screenshot_txt">Take screenshot</string>
</resources>


Save and close strings.xml

Open public.xml

In the fitting section (drawable and strings) add these lines :

<public type="string" name="global_action_screenshot_txt" id="0x010403da" />

<public type="drawable" name="semc_ic_dialog_screenshot" id="0x0108057f" />

Little tip for "how to" choose the id's (0x010403da and 0x0108057f)

- Search for the last ID for the category (for drawable the last one was0x0108057e)
- write the next letter or number ... (last one was 0x0108057e so the next one is 0x0108057f)

Tip number 2 for the ID ... :)
the letter list begin to a and finish to f
the number list begins to 0 and finish to 9
Finding the fitting ID can take time so stay calm and relax :D

Once you've done that, save public.xml but don't close it you'll need it later ....

Now you can compile your framework-res.apk
If you did something wrong apktool will write it .. just read and repair what's wrong.

Now the framework is set, you need now to tell the device wich action you want to run when you tap the option on screen.

2. Andorid.policy.jar

Decompile this file.
Go to com/android/internal/policy/impl folder

Here you'll fond some smali files.
Find the smali named GlobalActions.smali and open it.

In the # annotations thread add this line
Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;,

in must look like this :
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;,
Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;,
Lcom/android/internal/policy/impl/GlobalActions$Action;,
Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
}
.end annotation

In the # instance fields thread add this line :
.field private mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

It must look like this :

# instance fields
.field private mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;

.field private mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

.field private mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;

.field private final mAudioManager:Landroid/media/AudioManager;

.field private mBroadcastReceiver:Landroid/content/BroadcastReceiver;

.field private mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

.field private final mContext:Landroid/content/Context;

.field private mDeviceProvisioned:Z

.field private mDialog:Landroid/app/AlertDialog;

.field private mHandler:Landroid/os/Handler;

.field private mIsWaitingForEcmExit:Z

.field private mItems:Ljava/util/ArrayList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayList",
"<",
"Lcom/android/internal/policy/impl/GlobalActions$Action;",
">;"
}
.end annotation
.end field

Is that all ??? No !!!!! :D:D:D

Search the line 195
It must be like this in stock rom :

.line 195
const/4 v0, 0x3

new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

const/4 v1, 0x0

iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

aput-object v2, v0, v1

If there's const/4 v0, 0x4 : this tell the system how many options you've got in the power menu (here 4)

Just under .line 195 add these lines :

new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$8;

const v1, 0x108057f

const v2, 0x10403da

invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

Now it must look like this

.line 195
new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$8;

const v1, 0x108057f

const v2, 0x10403da

invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

const/4 v0, 0x4

What that mean ???? :eek::eek::eek:

= the ID in public.xml for the Drawable ... ATTENTION : the ID must be written without the 0 (in public.xml = 0x0108057f ; in android policy 0x108057f )

= the ID in public.xml for the string
respect this order

invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8
In the IMPL folder of the decompiled android.policy.jar you'll see several files named GlobalActions$1.smali ; GlobalActions$2.smali; etc ....
You'll need to create a smali file, it's name will follow the already existing name ... if the last one is GlobalActions$7.smali then you'll create GlobalActions$8.smali ...

:eek::eek: What should I get in this file ????? :eek::eek:
Calm down and take the GlobalActions$8.smali attached, rename it if you need, but don't forget to rename inside it all GlobalActions$8 entries in GlobalActions$thenumberyouchoose


Once you've done that get back to GlobalActions.smali ....

Find this line
invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

just above add

const/4 v1, 0x3

iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

aput-object v2, v0, v1

const/4 v1, 0x4

Added Globalactions.txt file so you can compare with yours

Here it is, work in android.policy is over ... save and close the GlobalActions file, and recompile android.policy.jar

Ready to flash ? .. so must build a zip file with good permissions and all the files ... :D:D

Find a flashing zip and decompress it
Create these folder
system/framework
system/app
system/bin

Inside framework folder get framework-res.apk and android.policy.jar you compiled
inside bin get the screenshot file (see attachement)
inside app get CMscreenshot.apk (see attachement)

edit your update-script to get these line : (translation for edify script can be done easily)

copy_dir PACKAGE:system SYSTEM:
set_perm 0 0 04755 SYSTEM:bin/screenshot

permissions are needed or else you'll get error (saved to null ...) will taking screenshot

save, compresss make your zip ...

MAKE A BACKUP

And flash ....

reboot .... and enjoy the screenshot option :D

Hope it helps ..
Once again take your time ... if you're novice in modding it'll take time ... it took me nearly one month to do it ... ;)
 

Attachments

  • CMScreenshot.apk
    9.2 KB · Views: 1,998
  • semc_ic_dialog_screenshot.png
    semc_ic_dialog_screenshot.png
    1.2 KB · Views: 38,152
  • GlobalActions$8.zip
    2 KB · Views: 2,047
  • bin.zip
    2.8 KB · Views: 1,505
  • GlobalActions.txt
    23.9 KB · Views: 1,950
Last edited:

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
FAQ :

Q: Can't find GlobalActions$8.smali in attachment

A: Download GlobalActions$8.zip and rename it GlobalActions$8.smali ....

Q: Can't find the screenshot file to place in bin folder

A : download bin.zip .... it's in ;)

Q: Why can't I use the screencapture.apk from Arc, Neo, Xperia S etc ...

A: We still fighting to make it working ... :D
 
Last edited:

NuriJ

Senior Member
Nov 25, 2011
1,188
1,069
Thanks Tof, very useful :)
Just one question, in my decompiled framework-res, in "public.xml", drawable section are totally mixed order, is there an easier way to find the last id?
 
  • Like
Reactions: Tof37

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
Thanks Tof, very useful :)
Just one question, in my decompiled framework-res, in "public.xml", drawable section are totally mixed order, is there an easier way to find the last id?

To be honest I don't know easier way than writing the ID you want to get and search if it already exist ..
If someone have a useful xml editor that can sort ID by section ... :D:D
 
  • Like
Reactions: NuriJ

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
I thought..ID's are reading automatically if they miss...only if you add them in strings and xmls…
Finaly here thanks Tof )

Finally took time to write it ;)
Got me long long nights with my computer to get it working ... hope it wold help people to have more sleep time :D:D

For ID you're not wrong .. ID are getting automatically if you compile from sources (I may be wrong but it's what I understood :) )
 
  • Like
Reactions: FeraVolt

dettofatto

Senior Member
May 29, 2006
603
164
Roma
First: THANK YOU!!!

Then... :)

I've... some issues...
My globalaction now is:

Code:
 .line 232
    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$11;

    const v1, 0x1080452

    const v2, 0x10404f5

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    const/4 v0, 0x6

    const/4 v0, 0x5

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v1, v0, v10

It is wrong?


Now i'm trying with this, without success:

Code:
.line 232

    const/4 v0, 0x5

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v1, v0, v10

    iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v1, v0, v9

    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$3;

    const v2, 0x1080418

    const v3, 0x10403fc

    const v4, 0x10403fd

    invoke-direct {v1, p0, v2, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$3;-><init>(Lcom/android/internal/policy/impl/GlobalActions;III)V

    aput-object v1, v0, v11

    new-instance v1, Lcom/android/internal/policy/impl/GlobalActions$4;

    const v2, 0x1080030

    invoke-direct {v1, p0, v2, v13}, Lcom/android/internal/policy/impl/GlobalActions$4;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    aput-object v1, v0, v12

    const/4 v1, 0x4

    new-instance v2, Lcom/android/internal/policy/impl/GlobalActions$10;

    const v3, 0x108044e

    const v4, 0x1040508

    invoke-direct {v2, p0, v3, v4}, Lcom/android/internal/policy/impl/GlobalActions$10;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    aput-object v2, v0, v1

    invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;
    const/4 v1, 0x3

    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v2, v0, v1

    const/4 v1, 0x4

    move-result-object v0

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mItems:Ljava/util/ArrayList;

    const/4 v1, 0x5

    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$11;

    const v1, 0x1080452

    const v2, 0x10404f5

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

Yes, I know there are a lot of things... But I'm sure that there is something in this file...
 
Last edited:

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
@dettofatto
Yes there are some errors in your file but can't correctly quote your post since I'm on phone... Recheck with op first until I get back home to show your errors ;)

Sent from my X10s using XDA
 

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
First: THANK YOU!!!

Then... :)

I've... some issues...
My globalaction now is:

Code:
 .line 232
    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$11;

    const v1, 0x1080452

    const v2, 0x10404f5

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    const/4 v0, 0x6

    const/4 v0, 0x5 [COLOR="Red"]----not needed cause line just above is enough[/COLOR]

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    iget-object v1, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v1, v0, v10

It is wrong?

See above in red ;)
 
  • Like
Reactions: dettofatto

dettofatto

Senior Member
May 29, 2006
603
164
Roma
And so I'll have 0x4 and 0x6 without 0x5?

Or I must put all your new lines under 0x5?

Because my. 232 line starts with constant 0x5...
And so I thought that the new screenshot has 0x6...
Or new lines start before 0x5?
Tomorrow I'll try all these options and I'll see!

I'm wrong?

Thank you...

Sent from My Motosola....
 
Last edited:

dettofatto

Senior Member
May 29, 2006
603
164
Roma
No...
Rebooted.. I'll try again...
Ah! I'm on motorola device...

Code:
.line 232
    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$11;

    const v1, 0x1080452

    const v2, 0x10404f5

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    const/4 v0, 0x5

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;
 

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
No...
Rebooted.. I'll try again...
Ah! I'm on motorola device...

Code:
.line 232
    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$11;

    const v1, 0x1080452

    const v2, 0x10404f5

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$11;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    const/4 v0, 0x5

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

Would you upload and attach your globalaction.smali please?

Sent from my X10s using XDA
 

dettofatto

Senior Member
May 29, 2006
603
164
Roma
Yes!!! I'll do tomorrow! The original file? Yes... I think so...
Thank you!

Sent from My Motosola....
 

Tof37

Senior Member
Oct 6, 2009
624
2,468
Tours
Have a look at the file ;)

I attached mine as model in OP so you can compare ;)
 

Attachments

  • GlobalActions.txt
    31 KB · Views: 52
  • Like
Reactions: dettofatto

Top Liked Posts

  • There are no posts matching your filters.
  • 62
    Here it is ....
    As some people here asked for it I'll try to explain how I learned to add screenshot option in power menu.

    First I'd like to thank some special members that helped me a lot for doing this :
    Championswimmer, Barath_000, Achotjan

    First you need to know it's not an easy thing to do and you may have bootloop, reboot etc ... that's why you need time and most of everything backup to restore the modded files.

    You'll need tools to do this.
    I used a "all in one tool": android utility (thanks to tommytomatoe)
    http://xdaforums.com/showthread.php?t=1167623
    It can be used on linux / mac laptop

    If you don't want to use it or using windows laptop you'll need apktool and dex2jar


    Before beginning :
    Make a backup of these 2 files in system/framework :

    framework-res.apk

    android.poilicy.jar

    Why ? you'll work on these files so if it doesn't work you'll have a "safe working base" ...

    Ready ?

    1.Framework-res.apk
    Decompile this file (with android utility or apktool)

    In the "drawable-hpdi" folder place the png attached, and named it "whateveryouwant".
    I advice you to keep the name it got as all my how to will name it like that ;)

    Then go in the values folder,

    You'll find several xml files, with notepad ++ or other xml editor open*: strings.xml and public*.xml

    In strings.xml:

    Add this line at the end of the file just above </resources> add the line*:

    <string name="global_action_screenshot_txt">Take screenshot</string>

    It must look like that*:

    <string name="add_region_in_locale_picker_dummy_string">+</string>
    <string name="global_action_sleep">Sleep mode</string>
    <string name="global_action_screenshot_txt">Take screenshot</string>
    </resources>


    Save and close strings.xml

    Open public.xml

    In the fitting section (drawable and strings) add these lines :

    <public type="string" name="global_action_screenshot_txt" id="0x010403da" />

    <public type="drawable" name="semc_ic_dialog_screenshot" id="0x0108057f" />

    Little tip for "how to" choose the id's (0x010403da and 0x0108057f)

    - Search for the last ID for the category (for drawable the last one was0x0108057e)
    - write the next letter or number ... (last one was 0x0108057e so the next one is 0x0108057f)

    Tip number 2 for the ID ... :)
    the letter list begin to a and finish to f
    the number list begins to 0 and finish to 9
    Finding the fitting ID can take time so stay calm and relax :D

    Once you've done that, save public.xml but don't close it you'll need it later ....

    Now you can compile your framework-res.apk
    If you did something wrong apktool will write it .. just read and repair what's wrong.

    Now the framework is set, you need now to tell the device wich action you want to run when you tap the option on screen.

    2. Andorid.policy.jar

    Decompile this file.
    Go to com/android/internal/policy/impl folder

    Here you'll fond some smali files.
    Find the smali named GlobalActions.smali and open it.

    In the # annotations thread add this line
    Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;,

    in must look like this :
    # annotations
    .annotation system Ldalvik/annotation/MemberClasses;
    value = {
    Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;,
    Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;,
    Lcom/android/internal/policy/impl/GlobalActions$Action;,
    Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;
    }
    .end annotation

    In the # instance fields thread add this line :
    .field private mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    It must look like this :

    # instance fields
    .field private mAdapter:Lcom/android/internal/policy/impl/GlobalActions$MyAdapter;

    .field private mAirplaneModeOn:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    .field private mAirplaneState:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction$State;

    .field private final mAudioManager:Landroid/media/AudioManager;

    .field private mBroadcastReceiver:Landroid/content/BroadcastReceiver;

    .field private mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    .field private final mContext:Landroid/content/Context;

    .field private mDeviceProvisioned:Z

    .field private mDialog:Landroid/app/AlertDialog;

    .field private mHandler:Landroid/os/Handler;

    .field private mIsWaitingForEcmExit:Z

    .field private mItems:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
    value = {
    "Ljava/util/ArrayList",
    "<",
    "Lcom/android/internal/policy/impl/GlobalActions$Action;",
    ">;"
    }
    .end annotation
    .end field

    Is that all ??? No !!!!! :D:D:D

    Search the line 195
    It must be like this in stock rom :

    .line 195
    const/4 v0, 0x3

    new-array v0, v0, [Lcom/android/internal/policy/impl/GlobalActions$Action;

    const/4 v1, 0x0

    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mSilentModeToggle:Lcom/android/internal/policy/impl/GlobalActions$ToggleAction;

    aput-object v2, v0, v1

    If there's const/4 v0, 0x4 : this tell the system how many options you've got in the power menu (here 4)

    Just under .line 195 add these lines :

    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$8;

    const v1, 0x108057f

    const v2, 0x10403da

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    Now it must look like this

    .line 195
    new-instance v0, Lcom/android/internal/policy/impl/GlobalActions$8;

    const v1, 0x108057f

    const v2, 0x10403da

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8;-><init>(Lcom/android/internal/policy/impl/GlobalActions;II)V

    iput-object v0, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    const/4 v0, 0x4

    What that mean ???? :eek::eek::eek:

    = the ID in public.xml for the Drawable ... ATTENTION : the ID must be written without the 0 (in public.xml = 0x0108057f ; in android policy 0x108057f )

    = the ID in public.xml for the string
    respect this order

    invoke-direct {v0, p0, v1, v2}, Lcom/android/internal/policy/impl/GlobalActions$8
    In the IMPL folder of the decompiled android.policy.jar you'll see several files named GlobalActions$1.smali ; GlobalActions$2.smali; etc ....
    You'll need to create a smali file, it's name will follow the already existing name ... if the last one is GlobalActions$7.smali then you'll create GlobalActions$8.smali ...

    :eek::eek: What should I get in this file ????? :eek::eek:
    Calm down and take the GlobalActions$8.smali attached, rename it if you need, but don't forget to rename inside it all GlobalActions$8 entries in GlobalActions$thenumberyouchoose


    Once you've done that get back to GlobalActions.smali ....

    Find this line
    invoke-static {v0}, Lcom/google/android/collect/Lists;->newArrayList([Ljava/lang/Object;)Ljava/util/ArrayList;

    just above add

    const/4 v1, 0x3

    iget-object v2, p0, Lcom/android/internal/policy/impl/GlobalActions;->mCaptureScreenshot:Lcom/android/internal/policy/impl/GlobalActions$SinglePressAction;

    aput-object v2, v0, v1

    const/4 v1, 0x4

    Added Globalactions.txt file so you can compare with yours

    Here it is, work in android.policy is over ... save and close the GlobalActions file, and recompile android.policy.jar

    Ready to flash ? .. so must build a zip file with good permissions and all the files ... :D:D

    Find a flashing zip and decompress it
    Create these folder
    system/framework
    system/app
    system/bin

    Inside framework folder get framework-res.apk and android.policy.jar you compiled
    inside bin get the screenshot file (see attachement)
    inside app get CMscreenshot.apk (see attachement)

    edit your update-script to get these line : (translation for edify script can be done easily)

    copy_dir PACKAGE:system SYSTEM:
    set_perm 0 0 04755 SYSTEM:bin/screenshot

    permissions are needed or else you'll get error (saved to null ...) will taking screenshot

    save, compresss make your zip ...

    MAKE A BACKUP

    And flash ....

    reboot .... and enjoy the screenshot option :D

    Hope it helps ..
    Once again take your time ... if you're novice in modding it'll take time ... it took me nearly one month to do it ... ;)
    5
    FAQ :

    Q: Can't find GlobalActions$8.smali in attachment

    A: Download GlobalActions$8.zip and rename it GlobalActions$8.smali ....

    Q: Can't find the screenshot file to place in bin folder

    A : download bin.zip .... it's in ;)

    Q: Why can't I use the screencapture.apk from Arc, Neo, Xperia S etc ...

    A: We still fighting to make it working ... :D
    2
    I thought..ID's are reading automatically if they miss...only if you add them in strings and xmls…
    Finaly here thanks Tof )
    2
    really nice of you to make such a easy tutorial ...

    i love it when people share there development knowledge so that others can also learn :)
    1
    sir i got it phones open after reboot...screenshots icon showing in power menu But when i take a screenshoots this errors come...

    error unable to save screenshoots:Mbitmap=null........

    sir pls reply if you have tym... tnx:angel::angel:

    Check the permission of the name screensnhot in /bin
    The permission have to be like I wrote in op

    Sent from my XT890 using XDA Free mobile app