Tuesday, August 23, 2016

[Guide][tut] Create Own Settings Activity to recall from external 3rd party apps

Hello guys

i just want to share a simple part of Setting

What is this guide ?

If you had created your Own rom settings in settings app
you could open it only in Settings app and cannot not be recalled from another app

(ex: open Superuser app from settings ( like wise your settings from other app) )

Hope you understand what this guide meant too

To make this working These files take process

http://ift.tt/2bd0a6P
http://ift.tt/2beQAdU
http://ift.tt/1jgIjbV

and you need to create an activity smali to make it activity to recall mod settings smali

i will explain in simple about creating activity smali

1. First Download this Attachment 3852151
in that you will find Settings$kryptonActivity.smali
you can change it to Settings$yourwishnameActivity.smali
when you change that yourwishname you should also change in smali using this you can create many Activities :p

2. First create your OWN settings ( look here )

3. lets think i create a krypton settings and my actual smali was located at
http://ift.tt/2beRE1v

the krypton.smali was not a activity.. so you need to make is activity ( thats the reason point 1 i said )

create a activity smali ( look point 1. )
i had created as Settings$kryptonActivity.smali
in http://ift.tt/2bcZSge

4. Now time to define the paths of activity (http://ift.tt/2beRRlm) and settings path (http://ift.tt/2beRE1v)

open http://ift.tt/2bd0a6P

Look for this
Code:

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {

after that add your created activity name as like this
Code:

Lcom/android/settings/Settings$kryptonActivity;,
and will look like
Code:

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/settings/Settings$kryptonActivity;,

save and close settings.smali

5. Open http://ift.tt/2beQAdU

look for this method
Code:

.method static constructor <clinit>()V
in that method look for this red value ( this value may vary )
Code:

.method static constructor <clinit>()V
    .locals 5

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 220
    sput-boolean v3, Lcom/android/settings/SettingsActivity;->sShowNoHomeNotice:Z

    .line 259
    const/16 v0, 0x51

so in my code its 0x51

then you need to search for 0x50 ( should be 1 less than the present value )

here is mine which had 0x50

Code:

    const/16 v1, 0x50

    const-class v2, Lcom/android/settings/rz/omni/OmniSwitch;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

So we need to add an settings path of yours

Adding as 0x51 and you need to replace the above 0x51 to 0x52

( here how the code like 1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,10,................4 9,4f,50,51,52)

Code:

    const/16 v1, 0x51

    const-class v2, Lcom/android/settings/kryp/krypton.smali;  ##your settings path

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

so it looks like

Code:

    const/16 v1, 0x50

    const-class v2, Lcom/android/settings/rz/omni/OmniSwitch;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

    const/16 v1, 0x51

    const-class v2, Lcom/android/settings/kryp/krypton.smali;  ##your settings path

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v0, v1

after adding and replace save it and close

Final part next post

Attached Files
File Type: zip Settings.zip - [Click for QR Code] (1.3 KB)


from xda-developers http://ift.tt/2beREP3
via IFTTT

No comments:

Post a Comment