Quantcast
Channel: xda-developers - Android Software and Hacking General [Developers Only]
Viewing all articles
Browse latest Browse all 3614

[GUIDE] How To Add Lollipop Like Owner Icon In SystemUI Expand

$
0
0
Hello Droiders!! The is a Tutorial About How To Add Lollipop Like Changeable Owner Icon In Statusbar Expand.


Disclaimer:I or XDA Developers will not be responsible for any damage of your Device.A Backup is highly recomanded.


:::NOTE:::
- You Signature vefification must be disabled.you can disable it by using `Lucky Patcher` or editing your `services.jar`.
- You need to be "very patient" and have a lot of time as this is a time consuming tutorial.
- I won't explain how to do things like pushing the apps, setting the permission, or how to get a value in public.xml and use that to change something in a certain smali.

You can Try the LProfile_demo.apk from the attachment.


Things You Will Needed:
1) SystemUI.apk
2) Notepad++ or any other text editor.
3) Apktool 1.5.x/Any Other tool to deconlmpile apk.
4) Brain.jar Patient.apk :p



STEP 1:
• Decompile your Systemui.apk

• Download the LProfile.zip from the attachment,extract it and merge it into your decompiled systemui.

• Open statusbar_expand_header.xml in /res/layout and compare with this:
Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="60.0dip" android:baselineAligned="false" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
  <RelativeLayout android:orientation="vertical" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true">
    <com.android.systemui.statusbar.policy.CustomClock android:textSize="16.0sp" android:textStyle="normal" android:textColor="#ffffffff" android:id="@id/custom_clock" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
    <com.android.systemui.statusbar.policy.DateView android:textSize="14.0dip" android:textColor="#b2ffffff" android:id="@id/date" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/custom_clock"/>
    <com.bloody.badboy.DateView android:textSize="14.0sp" android:textStyle="normal" android:textColor="#b2ffffff" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/custom_clock"/>
  </RelativeLayout>
  <LinearLayout android:gravity="right|center" android:orientation="horizontal" android:paddingRight="5.0dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1.0" android:layout_alignParentRight="true">
  </LinearLayout>
  <LinearLayout android:layout_width="27.0dip" android:layout_height="27.0dip" android:layout_marginRight="16.0dip">
    <bloody.badboy.LProfilePicture android:id="@id/image" android:background="@drawable/fmd_user" android:layout_width="27.0dip" android:layout_height="27.0dip" android:scaleType="centerCrop" android:onClick="LProfile" android:contentDescription="@null"/>
  </LinearLayout>

</LinearLayout>

• Open AndroidManifest.xml
add this at the bottom before </application>
Code:

<activity android:theme="@style/Theme.LProfile" android:name="com.android.settings.Profile">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
            </intent-filter>
        </activity>

AndroidManifest.xml for compare
Code:

<?xml version="1.0" encoding="utf-8"?>
<manifest android:sharedUserId="android.uid.system" android:process="system" android:versionCode="19" android:versionName="4.4.4-bloody.badboy.creation" coreApp="true" package="com.android.systemui" xmlns:android="http://schemas.android.com/apk/res/android">
  <uses-permission android:name="android.permission.STATUS_BAR_SERVICE"/>
  <uses-permission android:name="android.permission.BLUETOOTH"/>
  <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
  <uses-permission android:name="android.permission.GET_TASKS"/>
  <uses-permission android:name="android.permission.MANAGE_USB"/>
  <uses-permission android:name="android.permission.CALL_PHONE"/>
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
  <application android:label="@string/app_label" android:icon="@drawable/ic_launcher_settings" android:allowClearUserData="false" android:persistent="true" android:allowBackup="false" android:hardwareAccelerated="true">
    <service android:name="SystemUIService" android:exported="true"/>
    <service android:name=".screenshot.TakeScreenshotService" android:exported="false" android:process=":screenshot"/>
    <service android:name=".LoadAverageService" android:exported="true"/>
    <service android:name=".ImageWallpaper" android:permission="android.permission.BIND_WALLPAPER" android:exported="true"/>
    <receiver android:name=".BootReceiver">
      <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED"/>
      </intent-filter>
    </receiver>
    <activity android:label="@*android:string/usb_storage_activity_title" android:name=".usb.UsbStorageActivity" android:excludeFromRecents="true"/>
    <activity android:theme="@*android:style/Theme.Dialog.Alert" android:name="com.android.internal.app.ExternalMediaFormatActivity" android:excludeFromRecents="true"/>
    <activity android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:name=".usb.UsbConfirmActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true"/>
    <activity android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:name=".usb.UsbPermissionActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true"/>
    <activity android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:name=".usb.UsbResolverActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true"/>
    <activity android:theme="@*android:style/Theme.Holo.Dialog.Alert" android:name=".usb.UsbAccessoryUriActivity" android:permission="android.permission.MANAGE_USB" android:exported="true" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true"/>
    <activity android:theme="@*android:style/Theme.Holo.Panel" android:name=".net.NetworkOverLimitActivity" android:permission="android.permission.MANAGE_NETWORK_POLICY" android:exported="true" android:taskAffinity="com.android.systemui.net" android:excludeFromRecents="true" android:launchMode="singleTop" android:finishOnCloseSystemDialogs="true"/>
    <activity android:theme="@*android:style/Theme.Black.NoTitleBar.Fullscreen" android:label="Nyandroid" android:icon="@drawable/nyandroid04" android:name=".Nyandroid" android:exported="true" android:excludeFromRecents="true" android:launchMode="singleInstance" android:hardwareAccelerated="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>
    </activity>
    <receiver android:name=".statusbar.ConnectedReceiver">
      <intent-filter>
        <action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
      </intent-filter>
    </receiver>
    <activity android:theme="@style/Theme.LProfile" android:name="bloody.badboy.LProfile">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
      </intent-filter>
    </activity>

  </application>
</manifest>



• Open Styles.xml in /res/values and add this at the bottom before </resources>
Code:

<style name="Theme.LProfile" parent="@*android:style/Theme.Holo.Light.Dialog">
        <item name="android:windowBackground">@*android:color/transparent</item>
        <item name="android:windowNoTitle">true</item>
    </style>

• Open SystemUIService.smali in /smali/com/android/systemui and find the method:
Code:

# virtual methods
And add this below the method:
Code:

.method public LProfile(Landroid/view/View;)V
    .locals 3
    .parameter "v"

    .prologue
    .line 2431
    new-instance v0, Landroid/content/Intent;

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

    .line 2432
    const-string v1, "com.android.systemui"

    const-string v2, "bloody.badboy.LProfile"

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

    const/high16 v2, 0x1000

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

    move-result-object v0

    .line 2433
    invoke-virtual {p0, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    const-string v1, "statusbar"

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

    move-result-object v0

    check-cast v0, Landroid/app/StatusBarManager;

    invoke-virtual {v0}, Landroid/app/StatusBarManager;->collapse()V

    .line 1720
    return-void
.end method



• Now recompile your SystemUI.apk and Sign it.Then Decompile it again.



STEP 2:

• Open LProfile.smali in /smali/bloody/badboy/here

•Search-
0x7f030000

And replace with the value of
<public type="layout" name="lprofile_picture" from your public.xml

• Do the same for

• 0x7f060001 replace with <public type="id" name="photo_picker_cover"

• 0x7f060000 replace with <public type="id" name="image_cover"

•0x7f020001 replace with <public type="drawable" name="default_user"


• Open LProfilePicture$1.smali in smali/bloody/badboy

•0x7f020001 replace with <public type="drawable" name="default_user"

• Open LProfilePicture$1.smali in smali/bloody/badboy

•0x7f020001 replace with <public type="drawable" name="default_user"

•0x7f06000 replace with <public type="id" name="name_edit_cover"

• Now recompile your systemui.apk sign and push it into system/app/ and reboot.


If You Like it then Hit My Thanks Button.It will not cost but it will motivate me. :good: :good:

Attached Thumbnails
Click image for larger version

Name:	Screenshot.png
Views:	N/A
Size:	204.3 KB
ID:	3362504   Click image for larger version

Name:	Screenshot_2015-06-14-22-08-17.png
Views:	N/A
Size:	178.4 KB
ID:	3362508  
Attached Files
File Type: apk LProfile_Demo.apk - [Click for QR Code] (227.1 KB)
File Type: zip LProfile.zip - [Click for QR Code] (33.7 KB)

Viewing all articles
Browse latest Browse all 3614

Trending Articles