MIUI - Modification and decorations | Modification and decorations of MIUI firmware, instructions, discussion.



Rep: (3520)
MIUI - Modification and decorations

Important information. Read a must!

  • Before writing a topic, read:

  • When publishing instructions or using them in your mods, pleaseDo not forget the authors of these instructions.
  • It is also worth pointingmanual dependency on third-party components , Including Independent from or autonomous settings, etc.
  • Rules of conduct in the subject (in case of non-compliance, posts can be deleted without warning):

    • This topic is nottable orders. All messages with requests for editing will be deleted.
    • Messages with instructions issued not bypattern may not get into the catalog of instructions.
    • Before you ask a question or write instructions, use the search on the topic, perhaps your question has already been considered.
    • Fullest describes the problem: if the error log is needed; if the problem is with a specific mod, then provide a link to it; specify the MIUI version androjda and firmware; what has been done, what has not been done. No need to make to help pull out the information you "tick".
    • All images are hidden under the spoiler tag
    • In the subject we discuss only MIUI modifications. There are separate branches for discussing and searching topics.
    • Authors of instructions, like no one else but younot responsible for the performance of your devices!
    • It is customary to express gratitude by changing the reputation, no need to litter the topic.
    • You should not breed holivar about MiuiPro in this topic. For this there is a section of the meat grinder.

Patterns of modifications and instructions
Copy the content into your message and fill. If possible, try to use the code tag when inserting pieces of code in your instructions.
[CENTER] [COLOR = blue] [SIZE = 3] [B] Here we write the name of the lesson, as well as the version of MIUI [/ B] [/ SIZE] [/ COLOR] [/ CENTER]
Additional information if necessary (apktool version, android version, thanks, etc.)
[SPOILER = Description] Description, detailed instruction [/ SPOILER]
[SPOILER = Screenshots] Attach screenshots if necessary [/ SPOILER]

Catalog of instructions
Settings
Status bar, curtain notifications
Multimedia and sounds
Launcher / Desktop
Lock Screen / AoD
Caller / Contact
Reboot Menu / Recent Menu
Other
Useful links and tools
Profile and useful topics
The authors of modifications and the Administration of the forum are not responsible for the performance of your devices!
Remember: everything you do - you do at your own peril and risk!

For questions about filling Caps contact the Curator -OutsatQMS
Attached Image


Post has been editedOuts - 30.12.20, 23:11
Reason for editing: Editing Caps



Rep: (2130)
Televox @ 14.12.16, 19:48*
No, perhaps I will not remove

remove a matter of minutes, I just painted you in great detail
It can ride just to change the way
<string-array name = "editing_mode_entries">
<item>Widgets</ item>
<item>Wallpaper</ item>
<item>Effects</ item>
<item>Screen cells</ item>
</ string-array>

<string-array name = "editing_mode_values">
<item>1</ item>
<item>2</ item>
<item>3</ item>
</ string-array>

+ Edit the method initIconDrawableIds what I described above


Post has been editedS0bes - 14.12.16, 16:51



Rep: (1891)
* S0bes,
Well, maybe a ride so, but it is possible and a full table setting for this button to hang up.
Attached Image

Hmm, but then again, in the Preferences is ... Why produce?

Posted on 14/12/2016, 16:59:

* S0bes,
By the way ... that is the question. two..
Is it possible to make infinite scrolling?
And the ability to hide icons?



Rep: (2455)
* Televox,
double lock tapom on the desktop through the theme can be done? table size grid got to do ...



Rep: (2142)
S0bes @ 16.10.16, 17:01*
1. Selection of mtp by default instead of charging only when connected to PC (without third-party software).

It happened if you make that choice? It is very inconvenient for 6 android each time to switch to the mode "only charging".



Rep: (677)
* cherva70,
If help: scratch_one-s_head:



Rep: (2142)
* .dar,
Thanks. I studied, but there's 5 for android. Too much of a difference to my knowledge: sveta:



Rep: (2130)
Televox @ 14.12.16, 19:55*
Is it possible to make infinite scrolling?
And the ability to hide icons?

if this is provided initially, but hidden in the launcher say, yes
otherwise most likely - no. add new features as possible, but it's hard for me
cherva70 @ 14.12.16, 20:19*
It happened if you make that choice?

no, not yet published. if there were at least some xposed work module could spy on decision



Rep: (1891)
* S0bes,
Another question, how to change a button, prisobachit QuickPic?
I know that in GlobalScreenshotDisplay.smali, but how?
Attached Image

And just wondering what kind of commands, files, etc. caused by this action:
Attached Image


Post has been editedTelevox - 15.12.16, 09:17



Rep: (2130)
Televox @ 14.12.16, 23:52*
I know that in GlobalScreenshotDisplay.smali, but how?

.method private startEditActivity () V
.locals 5

const / 4 v4, 0x1

invoke-direct {p0}, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->dismissKeyguardIfNeed () V

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mContext: Landroid / content / Context;

iget-object v3, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mNotifyMediaStoreData: Lcom / android / systemui / screenshot / NotifyMediaStoreData;

invoke-static {v2, v3}, Lcom / android / systemui / screenshot / GlobalScreenshot; ->notifyMediaAndFinish (Landroid / content / Context; Lcom / android / systemui / screenshot / NotifyMediaStoreData;) V

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mScreenshotView: Lcom / android / systemui / screenshot / ScreenshotScrollView;

invoke-virtual {v2, v4}, Lcom / android / systemui / screenshot / ScreenshotScrollView; ->resetToShortMode (Z) V

new-instance v0, Landroid / content / Intent;

const-string v2, "android.intent.action.EDIT "# Intent is shorter and I xs it

invoke-direct {v0, v2}, Landroid / content / Intent; -><init>(Ljava / lang / String;) V

const-string v2, "com.miui.gallery " #Application Name

invoke-virtual {v0, v2}, Landroid / content / Intent; ->setPackage (Ljava / lang / String;) Landroid / content / Intent;

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mNotifyMediaStoreData: Lcom / android / systemui / screenshot / NotifyMediaStoreData;

iget-object v2, v2, Lcom / android / systemui / screenshot / NotifyMediaStoreData; ->outUri: Landroid / net / Uri;

invoke-virtual {v0, v2}, Landroid / content / Intent; ->setData (Landroid / net / Uri;) Landroid / content / Intent;

const-string v2, "IsScreenshot"

invoke-virtual {v0, v2, v4}, Landroid / content / Intent; ->putExtra (Ljava / lang / String; Z) Landroid / content / Intent;

const-string v2, "IsLongScreenshot"

iget-boolean v3, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mIsShowingLongScreenshot: Z

invoke-virtual {v0, v2, v3}, Landroid / content / Intent; ->putExtra (Ljava / lang / String; Z) Landroid / content / Intent;

new-instance v1, Landroid / content / Intent;

invoke-direct {v1}, Landroid / content / Intent; -><init>() V

const v2, 0x10008000

invoke-virtual {v1, v2}, Landroid / content / Intent; ->addFlags (I) Landroid / content / Intent;

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mContext: Landroid / content / Context;

const-class v3, Lcom / android / systemui / screenshot / IntermediateActivity;

invoke-virtual {v1, v2, v3}, Landroid / content / Intent; ->setClass (Landroid / content / Context; Ljava / lang / Class;) Landroid / content / Intent;

const-string v2, "Intent"

invoke-virtual {v1, v2, v0}, Landroid / content / Intent; ->putExtra (Ljava / lang / String; Landroid / os / Parcelable;) Landroid / content / Intent;

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mContext: Landroid / content / Context;

invoke-direct {p0}, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->createQuitAnimationBundle () Landroid / os / Bundle;

move-result-object v3

invoke-virtual {v2, v1, v3}, Landroid / content / Context; ->startActivity (Landroid / content / Intent; Landroid / os / Bundle;) V

return-void
.end method

I watched as the intent to call other applications and probably should be something like this:
.method private startEditActivity () V
.locals 5

const / 4 v4, 0x1

invoke-direct {p0}, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->dismissKeyguardIfNeed () V

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mContext: Landroid / content / Context;

iget-object v3, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mNotifyMediaStoreData: Lcom / android / systemui / screenshot / NotifyMediaStoreData;

invoke-static {v2, v3}, Lcom / android / systemui / screenshot / GlobalScreenshot; ->notifyMediaAndFinish (Landroid / content / Context; Lcom / android / systemui / screenshot / NotifyMediaStoreData;) V

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mScreenshotView: Lcom / android / systemui / screenshot / ScreenshotScrollView;

invoke-virtual {v2, v4}, Lcom / android / systemui / screenshot / ScreenshotScrollView; ->resetToShortMode (Z) V

new-instance v0, Landroid / content / Intent;

## changes from that line

invoke-direct {v0}, Landroid / content / Intent; -><init>(Ljava / lang / String;) V

const-string v2, "android.intent.action.MAIN"

invoke-virtual {v0, v2}, Landroid / content / Intent; ->setAction (Ljava / lang / String;) Landroid / content / Intent;

const / high16 v2, 0x10000000 # Google says it is the flag of the new activity, and believe him

###
###https: //developer.andr...FLAG_ACTIVITY_NEW_TASK
###

invoke-virtual {v0, v2}, Landroid / content / Intent; ->addFlags (I) Landroid / content / Intent;

const-string v2, "com.miui.securitycenter" # application name

const-string v3, "com.miui.networkassistant.ui.NetworkAssistantActivity" # class

invoke-virtual {v0, v2, v3}, Landroid / content / Intent; ->setClassName (Ljava / lang / String; Ljava / lang / String;) Landroid / content / Intent;

iget-object v2, p0, Lcom / android / systemui / screenshot / GlobalScreenshotDisplay; ->mContext: Landroid / content / Context;

sget-object v3, Landroid / os / UserHandle; ->CURRENT: Landroid / os / UserHandle;

invoke-virtual {v2, v0, v3}, Landroid / content / Context; ->startActivityAsUser (Landroid / content / Intent; Landroid / os / UserHandle;) V

return-void
.end method



Rep: (574)
slightly adaptedthismanual miui
a tap on the battery status bar to lock the screen and to display the dolgotap povermenyu
MiuiSystemUI \ res \ layout \ status_bar_simple.xml
check the presence of the string
xmlns: systemui = "http://schemas.android.com/apk/res/com.android.systemui">

if not, add for
xmlns: android = "http://schemas.android.com/apk/res/android"

will look like this
xmlns: android = "http://schemas.android.com/apk/res/android"
xmlns: systemui = "http://schemas.android.com/apk/res/com.android.systemui">

we find the block
<com.android.systemui.statusbar.phone.BatteryStatusIconView android: id = "@ id / battery" android: layout_width = "wrap_content" android: layout_height = "wrap_content" />

and replace it with
<FrameLayout android: layout_width = "wrap_content" android: layout_height = "@ dimen / status_bar_height">
<com.android.systemui.statusbar.phone.BatteryStatusIconView android: id = "@ id / battery" android: layout_width = "wrap_content" android: layout_height = "wrap_content" />
<com.android.systemui.statusbar.policy.KeyButtonView android: id = "@ id / back" android: layout_width = "30.0dip" android: layout_height = "25.0dip" android: layout_toRightOf = "@ id / recent_apps" android: contentDescription = "@ string / accessibility_back" systemui: keyCode = "26" systemui: glowBackground = "@ drawable / ic_sysbar_highlight" />
</ Framelifeout>



Blur in the curtain
works on miui, rights in status_bar_expanded_single_page.xml and status_bar_expanded.xml

Post has been editedsnatch.iva - 18.12.16, 00:55



Rep: (998)
Good afternoon. Or maybe someone knows how to make a list of recent applications in a few lines? And three-quarters empty screen, but it is necessary to scroll through the list.



Rep: (1891)
Televox @ 16.12.16, 10:38*
Campaign have the addiction, or as they call it, I do not know. It did - opens QuickPic editor, but then when you click on a button to save it in the program QuickPic, there is a crash with an error "error notification"

Thank you, retreat!
Everything worked out )))
* snatch.iva,
Thanks for the tip, but it is difficult to call, and then blur))
Attached Image
Attached Image


Post has been editedTelevox - 16.12.16, 17:57



Rep: (574)
* Televox,
I like this
Attached Image



Rep: (2130)
https://multirom.me/in...jump&tid=601&pid=55299
if anyone would like to investigate, but could not find the necessary files for instructions. probably it for 5ki, I have to say not at all 6ke android.police.jar, all services.jar moved, had a lot to rename. Just did everything without selecting any timeout settings, I was too lazy to add them, all encoded in the code.
give as is, it could be useful to someone. original and modified files
mETHOD: The authorsploik , Uvazhuha him specific
Attached fileskip_tracks_vol_keys.zip(243.53 KB)


p.s
in my file IAudioService $ Stub.smali just added the new code should be changed goto / 16: goto_7 on goto / 16: goto_0

Post has been editedS0bes - 30.12.16, 15:13



Rep: (1891)
Guys, let's think about how you can tie to import in any conductor?
MT refers to the search for the conductor ... logically, it could be any conductor - on, click on the conductor sends mtz file in the MT and I think no matter what the conductor mtz format it opens the manager ..

Post has been editedTelevox - 17.12.16, 13:50



Rep: (63)
Televox @ 17.12.16, 10:35*
Guys, let's think about how you can tie to import in any conductor?

And what is there to think. At weekly multirom in the manager when you click on the Import button opens a file manager window is displayed. Dig in this direction.
window screenshot
Attached Image


Post has been editedrandom31 - 18.12.16, 00:01



Rep: (334)
But such a question. Fastened to the firmware some new function. switchedone external program shuts down other external program. That's how it works of course, but then the menu item 2. Enable - separately, turn off - separately.
<PreferenceCategory ...>
<PreferenceScreen ...>
<intent android: targetPackage = ... ON ... />
</ PreferenceScreen>
<PreferenceScreen ...>
<intent android: targetPackage = ... OFF ... />
</ PreferenceScreen>
</ PreferenceCategory>

Is it possible to make a call 2 external programs via the CheckBox? Something does not catch as it can be in the xml, without smali, and which I do not really.



Rep: (2130)
MIUI 8 [MM] Starting previous application over the long retention button

Instruction
1. Just fire disabled signature verification and integrity (thx @ploik)
core-libart.jar

Ljava / security / Signature
we find methods
.method public final verify ([B) Z and .method public final verify ([BII) Z
them to return v0 insert const / 4 v0, 0x1

Ljava / security / MessageDigest
find method .method public static isEqual ([B [B) Z
change at the beginning of the method const / 4 v2, 0x0 on const / 4 v2, 0x1

Not required

2. Edit the settings.apk
Settings \ res \ values ​​\ arrays
Add to the end of one or the other of the array a new action
<string-array name = "screen_key_long_press_action">
<item>None</ item>
<item>Show recent apps</ item>
<item>Launch Assistant</ item>
<item>Launch Google Now</ item>
<item>Close current app</ item>
<item>Launch quick search</ item>
<item>Show menu</ item>
<item>Previous application</ item>
</ string-array>
<string-array name = "screen_key_long_press_action_value">
<item>none</ item>
<item>recent_panel</ item>
<item>voice_assistant</ item>
<item>google_now</ item>
<item>close_app</ item>
<item>quick_search</ item>
<item>show_menu</ item>
<item>prev_app</ item>
</ string-array>


Respectively, but Russification in values-ru folder need to add something like
<item>Start previous application</ item>
an array screen_key_long_press_action

3. Edit the services.jar
com / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable.smali
looking .method private launchRecentPanel () Z
before it is inserted
.method private launchPA (Landroid / content / Context;) Z
.locals 3
.param p1, "mContext" # Landroid / content / Context;

.prologue
.line 1

iget-object v0, p0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->the this $ 0: Lcom / android / server / policy / BaseMiuiPhoneWindowManager;

iget-object v0, v0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->mHandler: Landroid / os / Handler;

if-nez v0,: cond_0

: goto_0

const / 4 v2, 0x1

return v2

: cond_0

new-instance v1, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1;

invoke-direct {v1, p1}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1; -><init>(Landroid / content / Context;) V

invoke-virtual {v0, v1}, Landroid / os / Handler; ->post (Ljava / lang / Runnable;) Z

goto: goto_0

.end method


We are looking for a similar piece of code containing "recent_panel"
: cond_9
const-string v7, "recent_panel"

invoke-virtual {v7, v0}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v7

if-eqz v7,: cond_a

invoke-direct {p0}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->launchRecentPanel () Z

move-result v4

const-string v1, "screen_button_recent_task"

goto: goto_2

: cond_a



change it so

: cond_9
const-string v7, "recent_panel"

invoke-virtual {v7, v0}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v7

if-eqz v7,: cond_new#change

invoke-direct {p0}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->launchRecentPanel () Z

move-result v4

const-string v1, "screen_button_recent_task"

goto: goto_2

### new lines
: cond_new
const-string v7, "prev_app"

invoke-virtual {v7, v0}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v7

if-eqz v7,: cond_a

iget-object v7, p0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->the this $ 0: Lcom / android / server / policy / BaseMiuiPhoneWindowManager;

iget-object v7, v7, Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->mContext: Landroid / content / Context;

invoke-direct {p0, v7}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->launchPA (Landroid / content / Context;) Z

move-result v4

goto: goto_2

###

: cond_a

the new code has the added label cond_a and, as you can see, it should be named the same as the label in the old code, in front of which we insert the new code (marked in red)

Create the path com / android / server / policy / file BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1.smali with the following contents
.class Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1;
.super ljava / lang / Object;
.source "BaseMiuiPhoneWindowManager.java"

# interfaces
.implements Ljava / lang / Runnable;


# annotations
.annotation system Ldalvik / annotation / EnclosingMethod;
value = Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable; ->launchPA (Landroid / content / Context;) Z
.end annotation

.annotation system Ldalvik / annotation / InnerClass;
accessFlags = 0x0
name = null
.end annotation

# instance fields
.field private final synthetic val $ mContext: Landroid / content / Context;

# direct methods
.method constructor<init>(Landroid / content / Context;) V
.locals 0

.prologue
.line 1

iput-object p1, p0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1 ->val $ mContext: Landroid / content / Context;

.line 21
invoke-direct {p0}, Ljava / lang / Object; -><init>() V

return-void
.end method

# virtual methods
.method public run () V
.locals 9

const / 4 v5, 0x0

const / 4 v3, 0x1

new-instance v2, Landroid / content / Intent;

const-string v0, "android.intent.action.MAIN"

invoke-direct {v2, v0}, Landroid / content / Intent; -><init>(Ljava / lang / String;) V

iget-object v8, p0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1 ->val $ mContext: Landroid / content / Context;

const-string v1, "activity"

invoke-virtual {v8, v1}, Landroid / content / Context; ->getSystemService (Ljava / lang / String;) Ljava / lang / Object;

move-result-object v0

check-cast v0, Landroid / app / ActivityManager;

const-string v1, "com.android.launcher"

const-string v4, "android.intent.category.HOME"

invoke-virtual {v2, v4}, Landroid / content / Intent; ->addCategory (Ljava / lang / String;) Landroid / content / Intent;

invoke-virtual {v8}, Landroid / content / Context; ->getPackageManager () Landroid / content / pm / PackageManager;

move-result-object v4

invoke-virtual {v4, v2, v5}, Landroid / content / pm / PackageManager; ->resolveActivity (Landroid / content / Intent; I) Landroid / content / pm / ResolveInfo;

move-result-object v2

iget-object v4, v2, Landroid / content / pm / ResolveInfo; ->activityInfo: Landroid / content / pm / ActivityInfo;

if-eqz v4,: cond_3

iget-object v4, v2, Landroid / content / pm / ResolveInfo; ->activityInfo: Landroid / content / pm / ActivityInfo;

iget-object v4, v4, Landroid / content / pm / ActivityInfo; ->packageName: Ljava / lang / String;

const-string v6, "android"

invoke-virtual {v4, v6}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v4

if-nez v4,: cond_3

iget-object v1, v2, Landroid / content / pm / ResolveInfo; ->activityInfo: Landroid / content / pm / ActivityInfo;

iget-object v1, v1, Landroid / content / pm / ActivityInfo; ->packageName: Ljava / lang / String;

move-object v2, v1

: goto_0
const / 4 v1,0x5

invoke-virtual {v0, v1}, Landroid / app / ActivityManager; ->getRunningTasks (I) Ljava / util / List;

move-result-object v6

move v4, v3

move v3, v5

: goto_1
if-nez v3,: cond_0

invoke-interface {v6}, Ljava / util / List; ->size () I

move-result v1

if-ge v4, v1,: cond_0

invoke-interface {v6, v4}, Ljava / util / List; ->get (I) Ljava / lang / Object;

move-result-object v1

check-cast v1, Landroid / app / ActivityManager $ RunningTaskInfo;

iget-object v1, v1, Landroid / app / ActivityManager $ RunningTaskInfo; ->topActivity: Landroid / content / ComponentName;

invoke-virtual {v1}, Landroid / content / ComponentName; ->getPackageName () Ljava / lang / String;

move-result-object v1

invoke-virtual {v1, v2}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v7

if-nez v7,: cond_2

const-string v7, "com.android.systemui"

invoke-virtual {v1, v7}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v1

if-nez v1,: cond_2

invoke-interface {v6, v4}, Ljava / util / List; ->get (I) Ljava / lang / Object;

move-result-object v1

check-cast v1, Landroid / app / ActivityManager $ RunningTaskInfo;

iget v1, v1, Landroid / app / ActivityManager $ RunningTaskInfo; ->id: I

: goto_2
add-int / lit8 v3, v4, 0x1

move v4, v3

move v3, v1

goto: goto_1

: cond_0
if-eqz v3,: cond_1

const / 4 v1,0x2

invoke-virtual {v0, v3, v1}, Landroid / app / ActivityManager; ->moveTaskToFront (II) V

: goto_3
return-void

: cond_1

const-string v0, "There's no previous application"

invoke-static {v8, v0, v5}, Landroid / widget / Toast; ->makeText (Landroid / content / Context; Ljava / lang / CharSequence; I) Landroid / widget / Toast;

move-result-object v0

invoke-virtual {v0}, Landroid / widget / Toast; ->show () V

goto: goto_3

: cond_2
move v1, v3

goto: goto_2

: cond_3
move-object v2, v1

goto: goto_0
.end method


The original and modified files for comparison here:Attached filefiles.zip(12.67 KB)


P.s in the absence of recent application to run, the English system will write a line of There's no previous application. For the Russification of this, you can open the file BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable $ 1.smali
and replace the const-string v0, "There's no previous application"
on const-string v0, "\ u041D \ u0435 \ u0447 \ u0435 \ u0433 \ u043E \ u0437 \ u0430 \ u043F \ u0443 \ u0441 \ u043A \ u0430 \ u0442 \ u044C"
and it will be written, "There is nothing to run." For his phrases yuzayte Converterhttps://r12a.github.io/apps/conversion/

Screen
Attached Image


Starting method borrowed from xmiui module, so thanks @SolarWarez.

Supplement - Opening curtains over the long tapu
.upd
theoretical instruction must prokanaet and 5th android, but there will be a file BaseMiuiPhoneWindowManager $ ScreenKeyLongPressRunnable.smali is not services.jar, and android.policy.jar. Accordingly, in all the new code being added will have to be changed EVERYWHERE Lcom / android / server / policy / on a new path to the edited file

upd2. Miui 9
I was too lazy, so I just replace the current shortcut menu to launch the previous application
MIUI - Modification and decorations (Post S0bes # 65316403)
But in general, which would add a new action, you must also add an action to a pair of arrays of the Settings, and add a new method to
BaseMiuiPhoneWindowManager.smali
Just you need to add access to this method, by analogy, to say showmenu
.method static synthetic access $ 1500 (Lcom / android / server / policy / BaseMiuiPhoneWindowManager;) Z
.locals 1

invoke-direct {p0}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->showMenu () Z

move-result v0

return v0
.end method

That it could be accessed from BaseMiuiPhoneWindowManager $ H.smali
Because it is from there it is caused, again, by analogy with the menu:
: cond_c
const-string v6, "show_menu"

invoke-virtual {v6, v0}, Ljava / lang / String; ->equals (Ljava / lang / Object;) Z

move-result v6

if-eqz v6,: cond_d

iget-object v6, p0, Lcom / android / server / policy / BaseMiuiPhoneWindowManager $ H; ->the this $ 0: Lcom / android / server / policy / BaseMiuiPhoneWindowManager;

# Invokes: Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->showMenu () Z
invoke-static {v6}, Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->access $ 1500 (Lcom / android / server / policy / BaseMiuiPhoneWindowManager;) Z

move-result v4

goto / 16: goto_1

And according to BaseMiuiPhoneWindowManager $ 99.smali
Change
.annotation system Ldalvik / annotation / EnclosingMethod;
value = Lcom / android / server / policy / BaseMiuiPhoneWindowManager; ->showMenu () Z # link to a new method now link to ShowMenu
.end annotation


Post has been editedS0bes - 23.09.17, 18:42



Rep: (2130)
* gdb417, maybe you can, but I'm not sure exactly how



Rep: (2130)
* gdb417, throw off, I will look


Full version    

Help     rules

Now: 28.01.21, 07:41