[HOW-TO][DIY] What You Know about Rosie?

Search This thread

msavic123

Senior Member
Jan 22, 2009
465
71
Belgrade
Rosie remap

Is it possible to remap right button to DEFAULT messaging app? For example, if you have alternative dialer, by pressing phone button, you get a prompt which dialer you want. So i can launch handcent with right button if i choose so. I know i can use launchkey for this, but this is a better (natural and straightforward way)
 

alexthesniper21

Senior Member
Dec 13, 2010
90
9
weather forcecloses when editing com.htc.resources.apk

I changed the png's in drawable hdpi to make the rosie look a bit like sense 3.5. once i swype the weather widget to a different country, htc sense forcecloses on me. weather app is fine but sense just crashes :( , what am i doing wrong?
 

tommytomatoe

Inactive Recognized Developer
Dec 13, 2010
6,282
6,800
34
Knoxville USA
I changed the png's in drawable hdpi to make the rosie look a bit like sense 3.5. once i swype the weather widget to a different country, htc sense forcecloses on me. weather app is fine but sense just crashes :( , what am i doing wrong?

Pastebin logcat of the force close. That is only way I can know.

Sent from my PG86100 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    Originally Posted Here by me.

    *****

    This one has been long overdue! This is the comprehensive guide to Rosie.

    synergy.png


    Because I am hindered at the moment and cannot test my own stuff, I would like for others to be able do it themselves! For now, this will be a rough overview of where the icons are. I will go into detail with other information like color, strings, and other stuff as time goes on.

    If this helped you, link this thread so other peeps can also learn how to theme up Rosie. :)

    Tools: archive utility (7z, bettercut, et cetera), apktool

    Sense 3.0 Rosie - courtesy he_stheone (hit that thanks button for him)

    How-To Rosie transparent app drawer & custom background

    4x4 or 5x5 App Drawer

    Theming Dock and Buttons with M10 tools

    Sense 2.1 Rosie

    Buttons


    Left Button Icon (app drawer):
    icon_all_on.png


    In Rosie.apk/res/drawable-hdpi look for:
    Code:
    icon_all_on.png 
    icon_all_rest.png
    icon_all_down_on.png
    icon_all_down_rest.png
    *Note, with the nature of the Sense 2.1 Rosie, you will only need to modify the icon_all_on.png and icon_all_rest.png
    Left Button Background:
    common_app_rosie_btn_left_rest.png
    >>
    common_app_rosie_btn_left_pressed.png


    In com.htc.resources.apk/res/drawable-hdpi look for:
    Code:
    common_app_rosie_btn_left_rest.png
    common_app_rosie_btn_left_pressed.png
    Middle Button Icon (Phone):
    icon_p_phone_on.png


    In Rosie.apk/res/drawable-hdpi look for:
    Code:
    icon_p_phone_on.png
    icon_p_phone_rest.png
    Middle Button Text (Phone):

    Decompile Rosie.apk using apktool first.
    In Rosie/res/values look for strings.xml. Open it up in text editor (textEdit, notepad++, et cetera). Search for:
    Code:
    <string name="phone">Phone</string>
    
    Change the string in between ><
    Alternatively, we can have:
    <string name="phone"></string> or <string name="phone">tt's Dialer</string>
    Middle Button Background:
    common_app_rosie_btn_middle_rest.png
    >>
    common_app_rosie_btn_middle_pressed.png


    In com.htc.resources.apk/res/drawable-hdpi look for:
    Code:
    common_app_rosie_btn_middle_rest.png
    common_app_rosie_btn_middle_pressed.png
    Right Button Icon (personalize icon):
    personalize_rest.png


    In Rosie.apk/res/drawable-port-hdpi look for:
    Code:
    personalize_rest.png
    personalize_on.png
    RightButton Background:
    common_app_rosie_btn_right_rest.png
    >>
    common_app_rosie_btn_right_pressed.png


    In com.htc.resources.apk/res/drawable-hdpi look for:
    Code:
    common_app_rosie_btn_right_rest.png
    common_app_rosie_btn_right_pressed.png

    Dock Components

    Dock (main background):
    rosie_navbar.png


    In Rosie.apk/res/drawable-port-hdpi look for:
    Code:
    rosie_navbar.png
    Dock (Scrollbar background):
    common_mainnav_scroller3.png


    In Rosie.apk/res/drawable-hdpi look for:
    Code:
    common_mainnav_scroller3.png
    Dock (Scrollbar):
    common_mainnav_scroller1.png


    In Rosie.apk/res/drawable-hdpi look for:
    Code:
    common_mainnav_scroller1.png
    Scrollbar Angle Position: Stock has curved path when you navigate between home screens. This will allow it go straight across :)

    Decompile Rosie.apk with apktool
    In Rosie/res/values-hdpi look for integers.xml and make these changes:
    CURVED PATH (stock):
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <integer name="scroll_x1">0</integer>
        <integer name="scroll_y1">37</integer>
        <integer name="scroll_x2">240</integer>
        <integer name="scroll_y2">10</integer>
        <integer name="scroll_x3">480</integer>
        <integer name="scroll_y3">37</integer>
        <integer name="cell_layout_corner_radius">5</integer>
        <integer name="cell_layout_line_width">4</integer>
        <integer name="blade_control_touch_area">50</integer>
    </resources>
    STRAIGHT PATH
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <resources>
        <integer name="scroll_x1">0</integer>
        <integer name="scroll_y1">10</integer>
        <integer name="scroll_x2">240</integer>
        <integer name="scroll_y2">10</integer>
        <integer name="scroll_x3">480</integer>
        <integer name="scroll_y3">10</integer>
        <integer name="cell_layout_corner_radius">5</integer>
        <integer name="cell_layout_line_width">4</integer>
        <integer name="blade_control_touch_area">50</integer>
    </resources>
    Modify/Edit Button:
    btn_left_rest_big.png
    >>
    btn_left_setting_pressed.png


    In Rosie.apk/res/drawable-port-hdpi look for:
    Code:
    btn_left_rest_big.png
    btn_left_setting_pressed.png
    Trash Button:
    btn_right_rest_big.png
    >>
    btn_right_remove_press.png


    In Rosie.apk/res/drawable-port-hdpi look for:
    Code:
    btn_right_rest_big.png
    btn_right_remove_press.png
    Trash Icon:
    con_trash_rest.png


    In Rosie.apk/res/drawable-hdpi look for:
    Code:
    con_trash_rest.png
    con_trash_on.png
    To Centralize The Dock:
    dialerbrowser.jpg

    Image Courtesy of DG4FREE

    In Rosie.apk/res/layout-port look for button_bar.xml:
    Code:
    android:layout_width="fill_parent"
    Change to
    Code:
    android:layout_width="320.0px"
    Add
    Code:
    android:layout_centerHorizontal="true"
    For Example:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <com.htc.launcher.widget.ButtonBar android:background="@com.htc:drawable/common_app_rosie_navbar" android:layout_width="320.0px" android:layout_height="@dimen/button_bar_height" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:launcher="http://schemes.android.com/apk/res/com.htc.launcher">
    13
    Smali Stuff

    Tools. apktoool or baksmlai/smali or android-utility
    notepad++ or textedit

    Decode Rosie.apk
    First, install proper frameworks (com.htc.resources.apk)
    apktool: apktool d Rosie.apk
    baksmali: java -jar baksmali.jar classes.dex -o out OR baksmali classes.dex -o out
    android-utility: follow prompts on screen

    Build Rosie
    apktool: apktool b Rosie
    smali: java -Xmx512M -jar smali.jar out -o classes.dex OR smali -Xmx512M out -o classes.dex
    android-utility: follow prompts on screen

    To Remap the Right Button of Rosie for Sense 2.1 and Below (Sense 3.0 is a little more tricky)

    Open Launcher.smali, found in [out|smali]/com/htc/launcher/

    Search for
    Code:
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->addItems()V
    Change to:
    Code:
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->launchCustom()V
    *Note. This line is preceded by this chunk of code for Sense 1.0 Rosie (similar for other versions):
    Code:
    .method static synthetic access$2000(Lcom/htc/launcher/tommytomatoe/Launcher;)V
        .locals 0
        .parameter "x0"
    
        .prologue
        .line 147

    Next, search for
    Code:
    .method private onAppWidgetReset()V
    Directly above this method, write in this method:
    Code:
    .method private launchCustom()V
        .locals 5
    
        .prologue
        .line 5536
        new-instance v1, Landroid/content/Intent;
    
        const-string v2, "android.intent.action.MAIN"
    
        invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
    
        .line 5537
        .local v1, intent:Landroid/content/Intent;
        const-string v2, "android.intent.category.LAUNCHER"
    
        invoke-virtual {v1, v2}, Landroid/content/Intent;->addCategory(Ljava/lang/String;)Landroid/content/Intent;
    
        .line 5538
        new-instance v2, Landroid/content/ComponentName;
    
        const-string v3, "com.beansoft.launchkey"
    
        const-string v4, "com.beansoft.launchkey.Redirect"
    
        invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V
    
        invoke-virtual {v1, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;
    
        .line 5540
        :try_start_0
        invoke-virtual {p0, v1}, Lcom/htc/launcher/Launcher;->startActivity(Landroid/content/Intent;)V
        :try_end_0
        .catch Landroid/content/ActivityNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
        .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_1
    
        .line 5546
        :cond_0
        :goto_0
        return-void
    
        .line 5541
        :catch_0
        move-exception v0
    
        .line 5542
        .local v0, e:Landroid/content/ActivityNotFoundException;
        sget-boolean v2, Lcom/htc/launcher/Launcher;->localLOGV:Z
    
        if-eqz v2, :cond_0
    
        invoke-virtual {v0}, Landroid/content/ActivityNotFoundException;->printStackTrace()V
    
        goto :goto_0
    
        .line 5543
        .end local v0           #e:Landroid/content/ActivityNotFoundException;
        :catch_1
        move-exception v0
    
        .line 5544
        .local v0, e:Ljava/lang/IllegalArgumentException;
        sget-boolean v2, Lcom/htc/launcher/Launcher;->localLOGV:Z
    
        if-eqz v2, :cond_0
    
        invoke-virtual {v0}, Ljava/lang/IllegalArgumentException;->printStackTrace()V
    
        goto :goto_0
    .end method

    These two lines are where the magic happens:
    Code:
        const-string v3, "com.beansoft.launchkey"
    
        const-string v4, "com.beansoft.launchkey.Redirect"
    You must place the package name and the activity which launches the desired app. The above chunk of code will launch whatever app LaunchKey has redirected. Below are some more examples.

    Browser
    Code:
        const-string v3, "com.android.browser"
    
        const-string v4, "com.android.browser.BrowserActivity"
    Camera
    Code:
        const-string v3, "com.android.camera"
    
        const-string v4, "com.android.camera.CameraEntry"
    Messaging
    Code:
        const-string v3, "com.android.mms"
    
        const-string v4, "com.android.mms.ui.ConversationList"

    Feel free to request others.
    Go from a remapped Rosie to Stock (Personalize Menu)[/code]

    Search for
    Code:
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->launchCustom()V
    Change to
    Code:
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->addItems()V
    *Hint. If you cannot find the "invoke-direct {p0}, Lcom/htc/launcher/Launcher;->launchCustom()V", look instead for this chunk of code:
    Code:
    invoke-direct {p0}, Lcom/htc/launcher/Launcher;->launch
    IF you still can't find it, because the dev used a different convention, say LaunchMms instead of LaunchCustom, it is surrounded by these other methods:
    Code:
    .method static synthetic access$1902(Lcom/htc/launcher/Launcher;Z)Z
        .registers 2
        .parameter "x0"
        .parameter "x1"
    
        .prologue
        .line 143
        iput-boolean p1, p0, Lcom/htc/launcher/Launcher;->isNeedLaunchAddToHome:Z
    
        return p1
    .end method
    
    .method static synthetic access$2000(Lcom/htc/launcher/Launcher;)V
        .registers 1
        .parameter "x0"
    
        .prologue
        .line 143
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->launchMms()V
    
        return-void
    .end method
    
    .method static synthetic access$2100(Lcom/htc/launcher/Launcher;)V
        .registers 1
        .parameter "x0"
    
        .prologue
        .line 143
        invoke-direct {p0}, Lcom/htc/launcher/Launcher;->startCallActivity()V
    
        return-void
    .end method

    More to come....

    Credits: JsChiSurf for originally bringing this to the Evo
    6
    Theming the dock for Sense 3.0 Rosie

    This is the frustrating part in Sense 3.0 - you edit the usual suspects - and nothing happens after the flash. The reason is, that large parts of button press effects and other details are now controlled by fusion.apk. This replaces a lot of the button presses from com.htc.resources.apk and parts of Rosie like the complet dock.

    1. You need to decompile fusion.apk with m.10 editor (How-To`s are all over the place), make sure you tick the "decode images" box. You will then find all pngs ether in the editor (which is a pain, if you edit fusion.apk with plenty of pngs) or in c://user/yourname/appdata/roaming/m10editor
    2. You need to identify the pngs by sight, since the decompile does not give the correct png names to the pics. Note that all pngs are turned by 180 degrees after the compile.
    3. Edit the pngs and zip Rosie in m.10 editor

    That`s it - makes it tougher, but at least the devs behind m.10 editor like flemmard or diamondback offered us the option to theme Sense 3.0
    6
    How-To Rosie transparent app drawer & custom background

    Here is how you can create a transparent app drawer for Rosie - this is based of Rosie Sense 3.0. The basic edits in values folder are usually the same for 2.1, edits in all_apps_view.xml are not necessary for 2.1 Rosie

    all_apps_view.xml

    Change all 3 instances of android:background="#ff000000" to android:background="#00000000"


    Values folder - color.xml

    Change <color name="all_item_background">#ff000000</color> to <color name="all_item_background">#00000000</color> or whatever alpha channel value you like (77 would be semi transparent, the 00 is fully transparent)

    Tip: You can also remove the annoying icon text background by editing bubble_dark_background and bubble_text_shadowColor in that xml (set alpha to 00)


    Values-hdpi folder - color.xml

    Change <color name="add_to_home_background">#ff000000</color> to <color name="add_to_home_background">#00000000</color> or whatever alpha channel value you like (77 would be semi transparent, the 00 is fully transparent)


    In rare occasions you also need to edit smalis in order to allow transparency

    Look for this value in launcher.smali

    const/high16 v23, -0x100

    and change to:

    const/high16 v23, -0x6700


    Now to my very personal variation on top of these edits - the custom background:

    all_apps_view.xml

    Add

    android:background="@drawable/applistbackground"

    after <com.htc.launcher.AllAppsView

    so the code looks like this

    <com.htc.launcher.AllAppsView android:background="@drawable/applistbackground" android:layout_width="fill_parent"

    Then add a custom png to drawable-hdpi folder BEFORE you compile (that builds the ID).

    Name: applistbackground.png Size: 480x762 pixel

    This mod allows you to have a background of your choice with gradients, semi transparency, patterns, pics, whatever you prefer...


    Enjoy your transparent app drawer with the background of your choice ;)
    5
    5x5 app drawer

    There are plenty of 4x5 mods around, but I wanted a 5x5 (EVO & DHD are big enough), so I came up with this 5x5 version:

    application_boxed.xml

    Change android:textSize="@com.htc:dimen/darklist_primary_xs" to android:textSize="17.0px"

    dimens.xml in values folder

    Change <dimen name="application_boxed_padtop_firstrow">21.0px</dimen> to 8.0px
    Change <dimen name="application_boxed_padtop_otherrows">15.0px</dimen> to 8.0px

    dimens.xml in values-hdpi folder

    Change <dimen name="application_boxed_padtop_firstrow">30.0px</dimen> to 8.0px
    Change <dimen name="application_boxed_padtop_otherrows">30.0px</dimen> to 8.0px
    Change <dimen name="application_boxed_padtop_lastrow">19.0px</dimen> to 8.0px

    dimens.xml in values-hdpi folder

    Change <dimen name="application_boxed_tv_layout_height">156.0px</dimen> to 124.0px
    Change <dimen name="application_boxed_tv_padding_top">7.0px</dimen> to 0.0px
    Change <dimen name="application_boxed_tv_padding_bottom">0.0px</dimen> to 20.0px
    Change <dimen name="application_boxed_tv_textsize">@com.htc:dimen/darklist_primary_xs</dimen> to 17.0px


    integers.xml in values folder

    Change <integer name="allprogram_grid_rows">4</integer> to <integer name="allprogram_grid_rows">5</integer>
    Change <integer name="folder_grid_columns">4</integer> to <integer name="folder_grid_columns">5</integer>
    Change <integer name="allprogram_grid_columns">4</integer> to <integer name="allprogram_grid_columns">5</integer>

    integers.xml in values-port folder

    Change <integer name="folder_grid_columns">4</integer> to <integer name="folder_grid_columns">5</integer>

    integers.xml in values-port-hdpi folder

    Change <integer name="allprogram_grid_rows">4</integer> to <integer name="allprogram_grid_rows">5</integer>

    The last edit depends on the Rosie version - older Sense 3 versions, that value is not existent in port-hdpi folder. Please also note, this might not fully work on 2.1 Sense Rosies and some dimens.xml values might differ based on the Rosie version (you see version no. in Androidmanifest.xml).

    So you can combine these 3 mods to a 5x5, transparent Rosie with your custom background ;)