[Guides & Links] TOUCHWIZ UNIFIED MODS THREAD

Search This thread

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
Adding swipe suppoprt to s6 launcher

For dearest @The Sickness!

As promised, I am writing what I found about swipe support for s6 launcher:
  1. The swipe support is in a differens smali: you need to navigate to /smali/com/sec/android/app/launcher/activities/LauncherActivity
  2. There you need to find this line: .local v6, "pm":Landroid/content/pm/PackageManager;
  3. You will see the first string with the flipboard app package name couple of lines below and when you scroll some more, you will see after this line (new-instance v11, Landroid/content/ComponentName) another two strings (onw with package name and one with default class name). To remind you the package name of our app is com.wubydax.geartwswipe and the Activity name you need is com.wubydax.geartwswipe.SetAppActivity.
  4. After you replaced the three strings (first and second with package name and third with activity name), save and exit
  5. Now... Samsung, the geniuses that they are, introduce a new feature to the launcher on s6. It has a snapshot of the first time you open the briefing app and it saves it and uses it on the future openings. So we need to take care of that...
  6. Navigate to: /res/drawable/drawable-sw360dp-xxxhdpi and you will find 3 images there (which you cannot see): home_zeropage_briefing_bg, home_zeropage_briefing_chn, home_zeropage_briefing_usa. You need to replace all 3 with... well anything you want. I suggest using just a transparent png. For our rom I used a png that says (6thGear TWSwipe). I will attach them for you. Delete the old ones... or it will not compile. The old ones are not png...
  7. Now you would think that this is all... BUT! Samsing has already saved the screenshot for you. It's located in /storage/emulated/0/Android/data/.com.sec.android.app.launcher.cache/briefing.jpg
  8. After you installed your new apk with edited swipe and replaced images, delete that jpg file. DO NOT OPEN THE ZERO PAGE NOW (or it will take a snapshot again).
  9. Wipe data to the launcher from application manager
  10. There you go. You have your own swipe page clean from briefing snapshot.

Now... you will need to make sure that you delete that image for the users upon rom installation and make sure they either make clean install or clear data to the launcher.

Now to the animation. Samsung make the briefing app open with no animation (because they dont want you to see it opens on top of the snapshot...)
So... navigate to /res/anim and find two files home_zero_page_fade_in.xml and home_zero_page_fade_out.xml
In home_zero_page_fade_in.xml replace all text with:
Code:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:interpolator="@android:interpolator/decelerate_cubic" android:duration="1000" android:fromXDelta="-100.0%" android:toXDelta="0.0" />
    <alpha android:interpolator="@android:interpolator/decelerate_cubic" android:duration="@android:integer/config_shortAnimTime" android:fromAlpha="0.5" android:toAlpha="1.0" />
</set>
and in home_zero_page_fade_out.xml replace all code with this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <translate android:interpolator="@android:interpolator/decelerate_cubic" android:duration="1000" android:fromXDelta="0.0" android:toXDelta="-100.0%" />
    <alpha android:interpolator="@android:interpolator/decelerate_cubic" android:duration="@android:integer/config_shortAnimTime" android:fromAlpha="1.0" android:toAlpha="0.5" />
</set>

Now you also have a nice slide from the side animation for your swipe app.

This is the most you can get out of the s6 launcher. I am very happy with the result. The amount of smali I had to read for that is enormous. I tried different mods in smali to achieve this result but in the end this way seems to be the easiest.

If your users want to have the briefing app back, they have 2 choices. They need to install one of the apps that allow you to create activity shortcut. Once they do, they will have it show on the list of "use custom shortcut" in our app. Then they can choos the swipe action to open the flipboard main activity. or I can create a simple app for you and call it "My Magazine" which will just launch the magazine all (the boxer app for flipboard is not launcher category, so they cant choose it from the app list).
044eefb3932ed83ad9f9d3a58e9918c2.jpg
4ae4ff72aca0cd16354fabbea9cabf1f.jpg
dd893959276be4752cafaf7ec85ab65a.jpg
 

Attachments

  • drawable-sw360dp-xxxhdpi.zip
    29.1 KB · Views: 293
Last edited:

slimshouki

Senior Member
Dec 5, 2012
728
147
Haptic Feedback

if you would like to turn on haptic feedback for all capacitive and hardware keys even if you turn off hapic feedback from settings, you can use this modified method in phonewindowmanager.smali

Code:
.method private hapticFeedback()V
    .locals 4

    iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
	
	move-result-object v1

    const-string v2, "enable_haptic"

    const/4 v3, 0x1

    invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v1

    const/4 v1, 0x0

    const/4 v2, 0x0

    const/4 v3, 0x1

    move-object/from16 v0, p0

    invoke-virtual {v0, v1, v2, v3}, Lcom/android/internal/policy/impl/PhoneWindowManager;->performHapticFeedbackLw(Landroid/view/WindowManagerPolicy$WindowState;IZ)Z
    
    return-void
.end method

Thanks to @tdunham , @Goldie
 

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
Most welcome! Did it work as it should on a ported launcher? Because I only tried on original ;)
As for the animations you can also delete an invoke of overridePendingTransition and that will launch the app with default system animation. I personally prefer the sliding transition so I decided to rewrite the resources in the transition it already is using. But just mentioning if you want to change. You can also shorten my transition duration to half a second (that would be changing 1000 to 500 in both anim files.
Cheers!

Sent from my awesome g920f powered by 6thGear
 

The Sickness

Retired Recognized Developer
Oct 27, 2012
9,785
22,733
Somewhere in Texas
Most welcome! Did it work as it should on a ported launcher? Because I only tried on original ;)
As for the animations you can also delete an invoke of overridePendingTransition and that will launch the app with default system animation. I personally prefer the sliding transition so I decided to rewrite the resources in the transition it already is using. But just mentioning if you want to change. You can also shorten my transition duration to half a second (that would be changing 1000 to 500 in both anim files.
Cheers!

Sent from my awesome g920f powered by 6thGear

I just got home from work. I will try to mess with it tonight and let you know......
 
  • Like
Reactions: daxgirl

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
@daxgirl @TheSickness Working good. Easy to follow directions and worked with ease. Great work Daxgirl. Thank you ☺

a592f5ecaf4fa0a65709692e2f375768.jpg


h72n1mG.png
My pleasure! Hopefully more presents to come... we are working really hard right now on our s6 baby... if you guys need any mods on ported apps, let us know.

Sent from my awesome g920f powered by 6thGear
 

remuntada78

Senior Member
Jun 2, 2013
903
964
Hi I'm in trouble to change statusbar battery icon color with smali code, i've found the battery id in PhoneStatusBar.smali file , but in the system_icons.xml we have
Code:
<com.android.systemui.BatteryMeterView android:id="@id/battery" android:layout_width="@dimen/battery_icon_width" android:layout_height="@dimen/battery_icon_height" android:layout_marginBottom="@dimen/battery_icon_bottom_margin" android:alpha="0.74" android:layout_marginStart="3.0dip" />
and using hierarchyviewer tool we can see
Cattura.JPG
so the file to edit is .BatteryMeterView.smali but I did not find any reference to battery id , so i tried in PhoneStatusBar.smal adding the following method
Code:
.method setBatteryColor()V
    .locals 6

	const v1, 0x7f0d0185
	
	iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;

    invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/view/View;
	
	iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

    invoke-virtual {v2}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    const-string v3, "battery_color"

    const/4 v4, -0x1

    invoke-static {v2, v3, v4}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v2
	
	invoke-virtual {v0, v2}, Landroid/view/View;->setBackgroundColor(I)V
	
	return-void
	
.end method
i added the call of the methd too, but it has no effect, then the changes are to be done in BatteryMeterView.smali but I do not know how
some help?
thanks in advance
 
  • Like
Reactions: Kamy

Jiermon

Senior Member
Dec 3, 2011
64
24
would you please give us a custom action code to lauch camera ?
Thanks a lot....
 
Last edited:

stangdriver44

Inactive Recognized Themer
Nov 16, 2006
3,015
9,401
Cali
Yesssssssssss! You will sooooooo enjoy it!!!!

Sent from my awesome g920f powered by 6thGear

I was wondering are you using the S6 or the edge version? I too will be joining soon as well! Probably the S6 version. The edge looks cool, but I would rather have more storage for the limited functionality the edge brings.
 

daxgirl

Senior Member
Jun 30, 2012
4,047
9,175
Jerusalem
I was wondering are you using the S6 or the edge version? I too will be joining soon as well! Probably the S6 version. The edge looks cool, but I would rather have more storage for the limited functionality the edge brings.
I couldn't agree more. I bought a regular s6 as soon as it came out. Imo the edge being a nice concept, still is limited in functionality (all those cool features are limited to phone calls, sms (who's using sms??) and samsung mail... oh and ChatON. .. loolllllll), gives worse grip than s6 and in general is not worth the price difference. Basically I think it's a concept in diapers. I am just happy people buy it because it got samsung back from their market stock dropping. But really, it's not worth it.
I could afford it frankly, but I never had doubt in my mind. I don't wanna say it's stupid... but... well I just did I guess.

Sorry for the OT, @tdunham (again!) :)

Sent from my awesome g920f powered by 6thGear
 

Thebear j koss

Senior Member
I couldn't agree more. I bought a regular s6 as soon as it came out. Imo the edge being a nice concept, still is limited in functionality (all those cool features are limited to phone calls, sms (who's using sms??) and samsung mail... oh and ChatON. .. loolllllll), gives worse grip than s6 and in general is not worth the price difference. Basically I think it's a concept in diapers. I am just happy people buy it because it got samsung back from their market stock dropping. But really, it's not worth it.
I could afford it frankly, but I never had doubt in my mind. I don't wanna say it's stupid... but... well I just did I guess.

Sorry for the OT, @tdunham (again!) :)

Sent from my awesome g920f powered by 6thGear
No you're right, it's stupid. Another Sammy gimmick that tricks a normal user into thinking they got the coolest new thing ever. I'll be the 1st to admit I bought the gs3 with all those cool new 1 trick pony things that I used once or twice, then never again. Lol.

Thebe@r'$ G@L@XY
Go here- http://xdaforums.com/showthread.php?t=1016053
for amazing SuperSwiftkey themes❕❕❕
 
  • Like
Reactions: daxgirl

an-_-dro

Senior Member
Dec 28, 2012
444
189
Los Fabulous
Hi aLL..
My phone KK 4.4.2 rooted but still deodexed. I try to deodexed secMMS_blue.apk to follow guide in this thread. When finish deodexed and replace secMMs in priv-app folder (n delete odex) it work normal. i did this to test if my deodexed success or not and after that try i guess indeed succeed.
Then i decompile and edit some xml and smali then recompile (no error during recompile and everything was OK). When i replace secMMs to priv-app folder and restart, the messages always force close. Even erase data and cache then wipe dalvik and cache in recovery. :confused:

Same case when i try to replace systemUI. After edited and replace, systemUI not load andd just blank without status bar :eek: but if I just deodex systemUI then replace everuthing is fine.
My question is why error when replaced after recompiling? I guarantee no error during recompiling, because i mod also my Sony's apk. This case only face me on Samsung..odex, deodex, knox and other sh** unusefull stuff grrrrrrrrrrr :eek:
 

Thebear j koss

Senior Member
Hi aLL..
My phone KK 4.4.2 rooted but still deodexed. I try to deodexed secMMS_blue.apk to follow guide in this thread. When finish deodexed and replace secMMs in priv-app folder (n delete odex) it work normal. i did this to test if my deodexed success or not and after that try i guess indeed succeed.
Then i decompile and edit some xml and smali then recompile (no error during recompile and everything was OK). When i replace secMMs to priv-app folder and restart, the messages always force close. Even erase data and cache then wipe dalvik and cache in recovery. :confused:

Same case when i try to replace systemUI. After edited and replace, systemUI not load andd just blank without status bar :eek: but if I just deodex systemUI then replace everuthing is fine.
My question is why error when replaced after recompiling? I guarantee no error during recompiling, because i mod also my Sony's apk. This case only face me on Samsung..odex, deodex, knox and other sh** unusefull stuff grrrrrrrrrrr :eek:
When recompiling are you keeping original signature? Are you editing manifest? What are you editing exactly, can you post a log of the error? Otherwise there is no telling what is going on.

Thebe@r'$ G@L@XY
Go here- http://xdaforums.com/showthread.php?t=1016053
for amazing SuperSwiftkey themes❕❕❕
 

Top Liked Posts