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

(guide how to add samsung clock widget on lockscreen Gb

$
0
0
Here is My guide how to add Samsung Note 3 clock widget on lockscreen .




Always backup any original file before modifying. If your phone doesn't boot push that backup to your phone.**

What you need

- Basic xml techniques
- Decompile recompile skills
- android.policy.jar
- framework-res.apk


Steps:

  1. Decompile android.policy.jar.
  2. Download ninjask.zip in attachment and extract it to smali folder.
  3. Decompile framework-res.apk.
  4. now download S4clockwidget
  5. now copy my res folder to your
  6. open res/layout/keyguard_screen_unlock_portrait.xml :
  7. search for this
  8.  
    Code:

    <com.android.internal.widget.DigitalClock android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="20.0dip" android:layout_marginTop="15.0dip" android:layout_alignParentLeft="true" android:layout_alignParentTop="true">
                <TextView android:textAppearance="?textAppearanceMedium" android:textSize="70.0sp" android:ellipsize="none" android:gravity="bottom" android:id="@id/timeDisplay" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="6.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
                <TextView android:textAppearance="?textAppearanceMedium" android:textSize="18.0sp" android:ellipsize="none" android:gravity="bottom" android:id="@id/am_pm" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginLeft="4.0dip" android:singleLine="true" android:shadowColor="#c0000000" android:shadowDx="0.0" android:shadowDy="0.0" android:shadowRadius="3.0" />
            </com.android.internal.widget.DigitalClock>

  9. Replace it with
  10. Code:

    <com.ninjask.internal.policy.impl.LockScreenDigitalClock android:gravity="center" android:layout_gravity="center" android:orientation="vertical" android:id="@id/time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="25.0dip">
                        <LinearLayout android:id="@id/time2" android:layout_width="wrap_content" android:layout_height="58.0dip" android:layout_marginTop="40.0dip" android:layout_alignParentTop="true" android:layout_centerHorizontal="true">
                            <ImageView android:id="@id/first_digital" android:layout_width="wrap_content" android:layout_height="58.0dip" />
                            <ImageView android:id="@id/second_digital" android:layout_width="wrap_content" android:layout_height="58.0dip" />
                            <ImageView android:id="@id/dot_digital" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/zzz_unlock_clock_colon_s" />
                            <ImageView android:id="@id/third_digital" android:layout_width="wrap_content" android:layout_height="58.0dip" />
                            <ImageView android:id="@id/fouth_digital" android:layout_width="wrap_content" android:layout_height="58.0dip" />
                        </LinearLayout>
                        <TextView android:textSize="21.0sp" android:textColor="#fff0ffbb" android:gravity="center" android:id="@id/current_date" android:layout_width="fill_parent" android:layout_height="wrap_content" android:shadowColor="#ff000000" android:shadowDx="0.0" android:shadowDy="1.0" android:shadowRadius="2.5" android:layout_below="@id/time2" android:layout_alignParentTop="true" />
                    </com.ninjask.internal.policy.impl.LockScreenDigitalClock>

  11. and now go to res/value/bool.xml
  12. open it
  13. now add this code
  14. Quote:

    <bool name="config_lock_screen_battery_animation_horizon tal">true</bool>
  15. before </resources>
  16. now compile back your framework-res.apk
  17. decompile your resulted framework-res.apk
  18. now open it public.xml
  19. leave it a side we have to use it next smalli editing part






Now our first part done .now we have to start our second part


  • now decompile your android.policy.jar
  • now extract this ninjask.zip to your com/smalli folder
  • now this step is for matching the codes found in public.xml with that in smalli folder
  • inside ninjask folder you will see
  • LockScreenDigitalClock.smali
  • find the id codes like 0x1.......
    4.Search dis in my PublicPre.xml.
  • then search in your public.xml
  • but note you need to remove the 0 after to 0x (Example: 0x01234567 to 0x1234567)
now compile back your android.policy.jar





I provided this flashable zip you can use it for your Flashing lockscreen (FLASHABLE.ZIP)





1 .if you are using my work so plz give me credit . because i spend many night and days for getting success.

and

If you are porting this guide to To another inform me first . then i will create a seprate guide for your device.
by giving you credit and tester


















Viewing all articles
Browse latest Browse all 3614

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>