Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,809,814 Members 43,880 Now Online
XDA Developers Android and Mobile Development Forum

[UPDATED][GUIDE][2.3 - 4.2]Owner Profile In About Phone[30-03-14]

Tip us?
 
nightwalker
Old
(Last edited by nightwalker; 19th April 2014 at 11:19 AM.)
#1  
nightwalker's Avatar
Senior Member - OP
Thanks Meter 306
Posts: 664
Join Date: Mar 2013
Location: Uttar Pradesh>Meerut
Tutorial [UPDATED][GUIDE][2.3 - 4.2]Owner Profile In About Phone[30-03-14]

This is my first guide which I implemented with the help of b16h22 and carldeancatabay

Modding Settings.apk
Step 1
Get these files from the extracted zip

Code:
res/layout/profile_info.xml
res/drawable/done.xml
res/drawable/pick_profile_picture.xml
res/drawable-ldpi/done_normal.png
res/drawable-ldpi/done_pressed.png
res/drawable-ldpi/ic_qs_default_user.png
res/drawable-ldpi/ic_settings_owner.png
res/drawable-ldpi/pick_profile_normal.png
res/drawable-ldpi/pick_profile_pressed.png
res/layout/nightwalkerisawesome.xml
res/layout/profile_info.xml
Decompile settings.apk and put the above files in respective folders
Step 2

Get these smali files from the extracted zip and place it in the smali/ folder of decompiled apk

Code:
smali/com/b16h22/Profile.smali
smali/com/b16h22/Profile$1.smali
smali/com/b16h22/Profile$2.smali
smali.com/b16h22/about/ProfilePicture.smali
smali/com/b16h22/about/ProfilePicture$1.smali
smali/com/b16h22/about/ProfilePicture$2.smali
smali/com/b16h22/about/ProfileName.smali
smali/com/b16h22/about/ProfileName$1.smali
Step 3

Now open the ids.xml and add these ids in it

Code:
    <item type="id" name="image">false</item>
    <item type="id" name="owner">false</item>
    <item type="id" name="linear_layout">false</item>
    <item type="id" name="profile_pic">false</item>
    <item type="id" name="layout1">false</item>
    <item type="id" name="change_picture_text">false</item>
    <item type="id" name="photo_picker">false</item>
    <item type="id" name="linear_layout1">false</item>
    <item type="id" name="layout2">false</item>
    <item type="id" name="name_field">false</item>
    <item type="id" name="name_edit">false</item>
    <item type="id" name="profile">false</item>
    <item type="id" name="profile_name">false</item>
Step 4

Open strings.xml and add these strings

Code:
    <string name="change_pic">Change profile picture</string>
    <string name="profile_pic">SET PROFILE PICTURE</string>
    <string name="profile_name">CHANGE PROFILE NAME</string>
Step 5

Now recompile the apk and decompile it again. Now open the public.xml and find these ids.These may not be the same in your apk. It may differ so change them accordingly.

Code:
    <public type="layout" name="profile_info" id="0x7f03005a" />
    <public type="drawable" name="ic_qs_default_user" id="0x7f0200b2" />
    <public type="id" name="image" id="0x7f0b011b" />
    <public type="id" name="owner" id="0x7f0b011c" />
    <public type="id" name="photo_picker" id="0x7f0b0121" />
    <public type="id" name="name_field" id="0x7f0b0124" />
    <public type="id" name="name_edit" id="0x7f0b0125" />
    <public type="id" name="profile" id="0x7f09003a" />
    <public type="id" name="profile_name" id="0x7f09003b" />
    <public type="drawable" name="ic_qs_default_user" id="0x7f02012e" />
Step 6

Open Public.xml and change them with your Ids.

Now open smali/com/b16h22/Profile.smali and find the method

Code:
.method protected onCreate(Landroid/os/Bundle;)V
And replace the ids in it with the ones from public.xml

Code:
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 4
    .parameter "savedInstanceState"

    .prologue
    .line 27
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 28
    const v2, 0x7f03005a # profile_info

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->setContentView(I)V

    .line 30
    const v2, 0x7f0b0121 #photo_picker

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    .line 31
    .local v0, photo:Landroid/widget/ImageView;
    const v2, 0x7f0b011c # owner

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    iput-object v2, p0, Lcom/b16h22/Profile;->owner:Landroid/widget/TextView;

    .line 32
    const v2, 0x7f0b0124 # name_field

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/EditText;

    iput-object v2, p0, Lcom/b16h22/Profile;->name:Landroid/widget/EditText;

    .line 33
    const v2, 0x7f0b0125 # name_edit

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, p0, Lcom/b16h22/Profile;->done:Landroid/widget/ImageView;

    .line 34
    const v2, 0x7f0b011b # image

    invoke-virtual {p0, v2}, Lcom/b16h22/Profile;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    iput-object v2, p0, Lcom/b16h22/Profile;->imageView:Landroid/widget/ImageView;

    .line 37
    const-string v2, "EvoPrefsFile"

    const/4 v3, 0x0

    invoke-virtual {p0, v2, v3}, Lcom/b16h22/Profile;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 38
    .local v1, sharedPreferences:Landroid/content/SharedPreferences;
    const-string v2, "profileName"

    const-string v3, "null"

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/b16h22/Profile;->profName:Ljava/lang/String;

    .line 39
    iget-object v2, p0, Lcom/b16h22/Profile;->profName:Ljava/lang/String;

    const-string v3, "null"

    if-ne v2, v3, :cond_0

    .line 40
    iget-object v2, p0, Lcom/b16h22/Profile;->owner:Landroid/widget/TextView;

    const-string v3, "Owner"

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 46
    :goto_0
    const-string v2, "profilePic"

    const-string v3, "null"

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/b16h22/Profile;->imageUri:Ljava/lang/String;

    .line 47
    iget-object v2, p0, Lcom/b16h22/Profile;->imageUri:Ljava/lang/String;

    const-string v3, "null"

    if-ne v2, v3, :cond_1

    .line 48
    iget-object v2, p0, Lcom/b16h22/Profile;->imageView:Landroid/widget/ImageView;

    const v3, 0x7f0200b2 #ic_qs_default_user

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 53
    :goto_1
    new-instance v2, Lcom/b16h22/Profile$1;

    invoke-direct {v2, p0}, Lcom/b16h22/Profile$1;-><init>(Lcom/b16h22/Profile;)V

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 64
    iget-object v2, p0, Lcom/b16h22/Profile;->done:Landroid/widget/ImageView;

    new-instance v3, Lcom/b16h22/Profile$2;

    invoke-direct {v3, p0}, Lcom/b16h22/Profile$2;-><init>(Lcom/b16h22/Profile;)V

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 80
    return-void

    .line 42
    :cond_0
    iget-object v2, p0, Lcom/b16h22/Profile;->owner:Landroid/widget/TextView;

    iget-object v3, p0, Lcom/b16h22/Profile;->profName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 43
    iget-object v2, p0, Lcom/b16h22/Profile;->name:Landroid/widget/EditText;

    iget-object v3, p0, Lcom/b16h22/Profile;->profName:Ljava/lang/String;

    invoke-virtual {v2, v3}, Landroid/widget/EditText;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 50
    :cond_1
    iget-object v2, p0, Lcom/b16h22/Profile;->imageView:Landroid/widget/ImageView;

    iget-object v3, p0, Lcom/b16h22/Profile;->imageUri:Ljava/lang/String;

    invoke-static {v3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/ImageView;->setImageURI(Landroid/net/Uri;)V

    goto :goto_1
.end method
Open smali/com/b16h22/statusbar/ProfilePicture.smali and find this

Code:
    .line 21
    const v4, 0x7f09003a
replace the id with the id of "profile"

find

Code:
    const v5, 0x7f02012e
replace it with the id of drawable "ic_qs_default_user"

Open smali/com/b16h22/statusbar/ProfilePicture$1.smali

Find

Code:
    .line 19
    const v2, 0x7f09003b
replace it with the id of "profile_name".
Step 7

Now open the res/xml/settings.xml[2.3.x] or settings_header.xml[4.x.y.]

and add this iconpreferencescreen.You can add it anywhere you want.I'm assuming you have basic knowledge about preference xmls.

For 2.3.x

Code:
    <com.android.settings.IconPreferenceScreen android:title="Owner Profile" settings:icon="@drawable/ic_settings_owner">
        <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.b16h22.Profile" />
    </com.android.settings.IconPreferenceScreen>
OR

For 4.x.y

Code:
    <header android:icon="@drawable/ic_owner_settings" android:title="Owner Profile">
        <intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.b16h22.Profile" />
    </header>
Step 8

Add this in your device_info_settings.xml

Code:
    <PreferenceCategory android:title=" INFO " />
    <Preference android:focusable="false" android:clickable="true" android:fragment=Add your App Package android:layout="@layout/nightwalkerisawesome" />
Step 9

Add this activity in your androidmanifest.xml

Code:
        <activity android:label="@string/change_pic" android:name="com.b16h22.Profile">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>
Step 10

All Done.Now Recompile and push it to system.You have to resign the apk and other system apks or disable signature verification
.
Files Download :-UPDATED_RESOURCES
Credits
  1. b16h22[Took everything and many things from his guide also]
  2. iamareebjamal[just got an idea for adding lines in device_info_settings.xml]
  3. carldeancatabay[Got this idea from his Rom.]
  4. khan_frd2002[He is the person who helped me when I didn't knew how to decompile also.]
  5. Super-droid BOND[He helped me a lot.]
G: D.B.X -Gingerbean Dream Bolt X | Xolo A500s | Micromax A25 | Micromax A110 | Upcoming Samsung Galaxy S3
1.[GUIDE]Owner Profile In Owner Profile
2.Xolo A500s | All-In-One-Discussion-Thread

Phones: Xolo A500s-S019 Stock Rom | Micromax A25-G: D.B.X Reloaded | Micromax A110-Galaxy S5 Rom
The Following 33 Users Say Thank You to nightwalker For This Useful Post: [ Click to Expand ]
 
khan_frd2002
Old
#2  
khan_frd2002's Avatar
Senior Member
Thanks Meter 1,398
Posts: 1,116
Join Date: Nov 2011
Location: Dressosa

 
DONATE TO ME
Nice Guide Brother....I will definitely try
The Following User Says Thank You to khan_frd2002 For This Useful Post: [ Click to Expand ]
 
Akhilendra Gadde
Old
#3  
Akhilendra Gadde's Avatar
Recognized Contributor
Thanks Meter 1,521
Posts: 738
Join Date: Oct 2012
Location: Mumbai
good work bro, i will try this.
The Following User Says Thank You to Akhilendra Gadde For This Useful Post: [ Click to Expand ]
 
nightwalker
Old
#4  
nightwalker's Avatar
Senior Member - OP
Thanks Meter 306
Posts: 664
Join Date: Mar 2013
Location: Uttar Pradesh>Meerut
Quote:
Originally Posted by Akhilendra Gadde View Post
good work bro, i will try this.
Sure bro,try it and post here!!
G: D.B.X -Gingerbean Dream Bolt X | Xolo A500s | Micromax A25 | Micromax A110 | Upcoming Samsung Galaxy S3
1.[GUIDE]Owner Profile In Owner Profile
2.Xolo A500s | All-In-One-Discussion-Thread

Phones: Xolo A500s-S019 Stock Rom | Micromax A25-G: D.B.X Reloaded | Micromax A110-Galaxy S5 Rom
The Following 2 Users Say Thank You to nightwalker For This Useful Post: [ Click to Expand ]
 
Akhilendra Gadde
Old
(Last edited by Akhilendra Gadde; 4th January 2014 at 03:13 AM.)
#5  
Akhilendra Gadde's Avatar
Recognized Contributor
Thanks Meter 1,521
Posts: 738
Join Date: Oct 2012
Location: Mumbai
Quote:
Originally Posted by nightwalker View Post
Sure bro,try it and post here!!
Buddy, I tried . Successfull with some modifications.
In nightwalkerisawesome.xml there are line starting with com.nightwalker.about.***

Replace nightwalker with b16h22

And in icon preference for 4.x.x change @drawable/microfire with @drawable/(imagename).
Making this changes will not give any fc's...
And also in device_info_settings remove these codes like "" android:focusable="false" and android:clickable="true" ""

Sent from my a110 using XDA-Developers App
The Following 2 Users Say Thank You to Akhilendra Gadde For This Useful Post: [ Click to Expand ]
 
nightwalker
Old
#6  
nightwalker's Avatar
Senior Member - OP
Thanks Meter 306
Posts: 664
Join Date: Mar 2013
Location: Uttar Pradesh>Meerut
Quote:
Originally Posted by Akhilendra Gadde View Post
Buddy, I tried . Successfull with some modifications.
In nightwalkerisawesome.xml there are line starting with com.nightwalker.about.***

Replace nightwalker with b16h22

And in icon preference for 4.x.x change @drawable/microfire with @drawable/(imagename).
Making this changes will not give any fc's...
And also in device_info_settings remove these codes like "" android:focusable="false" and android:clickable="true" ""

Sent from my a110 using XDA-Developers App
Thanks for reminding me
I forget to change these
I will update the files with correct things
Thanks
G: D.B.X -Gingerbean Dream Bolt X | Xolo A500s | Micromax A25 | Micromax A110 | Upcoming Samsung Galaxy S3
1.[GUIDE]Owner Profile In Owner Profile
2.Xolo A500s | All-In-One-Discussion-Thread

Phones: Xolo A500s-S019 Stock Rom | Micromax A25-G: D.B.X Reloaded | Micromax A110-Galaxy S5 Rom
The Following User Says Thank You to nightwalker For This Useful Post: [ Click to Expand ]
 
Akhilendra Gadde
Old
#7  
Akhilendra Gadde's Avatar
Recognized Contributor
Thanks Meter 1,521
Posts: 738
Join Date: Oct 2012
Location: Mumbai
Quote:
Originally Posted by nightwalker View Post
Thanks for reminding me
I forget to change these
I will update the files with correct things
Thanks
Good. Keep it up brother.
The Following User Says Thank You to Akhilendra Gadde For This Useful Post: [ Click to Expand ]
 
nightwalker
Old
#8  
nightwalker's Avatar
Senior Member - OP
Thanks Meter 306
Posts: 664
Join Date: Mar 2013
Location: Uttar Pradesh>Meerut
Quote:
Originally Posted by Akhilendra Gadde View Post
Good. Keep it up brother.
Thanks a lot bro!!
G: D.B.X -Gingerbean Dream Bolt X | Xolo A500s | Micromax A25 | Micromax A110 | Upcoming Samsung Galaxy S3
1.[GUIDE]Owner Profile In Owner Profile
2.Xolo A500s | All-In-One-Discussion-Thread

Phones: Xolo A500s-S019 Stock Rom | Micromax A25-G: D.B.X Reloaded | Micromax A110-Galaxy S5 Rom
 
rastigo
Old
#9  
rastigo's Avatar
Senior Member
Thanks Meter 736
Posts: 830
Join Date: Apr 2013
Location: Pune
@nightwalker, you mod looks amazing. I have a request to make. I tried decompiling my settings.apk, but am facing problem decompiling. If i can send you the required filed, would you be able to make the mod for me. If yes, what files would you require.
If no, its ok.
Thanks and do let me know

Sent from my MT27i using xda app-developers app
The Following User Says Thank You to rastigo For This Useful Post: [ Click to Expand ]
 
nightwalker
Old
#10  
nightwalker's Avatar
Senior Member - OP
Thanks Meter 306
Posts: 664
Join Date: Mar 2013
Location: Uttar Pradesh>Meerut
Quote:
Originally Posted by rastigo View Post
@nightwalker, you mod looks amazing. I have a request to make. I tried decompiling my settings.apk, but am facing problem decompiling. If i can send you the required filed, would you be able to make the mod for me. If yes, what files would you require.
If no, its ok.
Thanks and do let me know

Sent from my MT27i using xda app-developers app
Bro,i have no problem in doing this!!
As my winter vacations are going so i am at my mama's place
Will come back at home till 18th
So,if u can wait so i will do it!!
G: D.B.X -Gingerbean Dream Bolt X | Xolo A500s | Micromax A25 | Micromax A110 | Upcoming Samsung Galaxy S3
1.[GUIDE]Owner Profile In Owner Profile
2.Xolo A500s | All-In-One-Discussion-Thread

Phones: Xolo A500s-S019 Stock Rom | Micromax A25-G: D.B.X Reloaded | Micromax A110-Galaxy S5 Rom

Tags
2.3 4.2 4.1, about phone, nightwalker, owner pic.own pic
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes