[MOD][REF] Froyo Camera.apk Power Button->Shutter Key; Disable Low Batt - Fascinate Android Development

Current Functionality over stock Camera.apk:
Optional Geotagging (thanks to Adrynalyne or whoever he got it from)
Power Button in Camera mode becomes functionally the same as the touchscreen Shutter Key
Power Button in Camcorder mode becomes functionally the same as the touchscreen Shutter Key for starting recording
Removed Low Battery restriction
Removed In-Call restriction
This camera has been included with Super Clean since v2.2 until v2.9, and is included in some other ROMs as well. If you installed any of these roms, then you do not need to install this camera.
[Size=+1]Froyo Camera Mod v2.1 - APK version[/Size]
Camera.apk - Download @ MediaFire.com
Installation: Since this is a system app, it cannot be installed using the Package Installer. Camera.apk must replace /system/app/Camera.apk. You can accomplish this many different ways. Two common methods are: 1) use ADB to push it ("adb push Camera.apk /system/app/Camera.apk"); or 2) copy Camera.apk to your SD card, then use a program like Root Explorer to move it to "/system/app/". If you are running a Stock Froyo rom, you will want to delete any camera.odex files in /system/app/, clear dalvik cache and reboot. For most deodexed roms, a reboot is only necessary if the camera is not working correctly after installation.​
Thanks to s44, there is now a CWM flashable upgrade version:
[Size=+1]Froyo Camera Mod v2.1 - ClockworkMod ZIP version[/Size]
cameramodv2.1-install.zip - Download @ xdaDevelopers.com
s44 said:
The attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
Click to expand...
Click to collapse
Installation: Copy zip file to sdcard. Boot into CWM, and select "Install zip from sd card". Select the file, then confirm the flash. When finished, reboot.​
Disclaimer: This should work on any of the Froyo roms/kernels, but maybe not your's. Be sure to make a backup of your current Camera.apk for easily switching it back if you have problems.
Feedback: If it doesn't work right, let me know your setup, and what the problem is. If you see an error in my description, or if you know of a better way to do something, let me know. It's my goal to both be as unobtrusive to the original code as possible, while increasing functionality/efficiency. I am *slightly* open to suggestions on future features (I can't promise much since I'm in school and don't have too much time).
Future Features/Fixes:
In camcorder mode, Power Button second press->Pause Key
Optimize PNG's
User Requested Features/Reported Bugs:
On long press of the Power Button, Enable Auto Focus before taking picture (i.e. disable the Power Menu from popping up).
Home Key short press does not follow OS setting after using the Power Button to take a picture (happens after every odd # of Power Button presses)
Previous Versions
[Size=-1]Camera Mod v1
Camera.apk - Download @ MediaFire.com
[/size]
Changelog
v2.1
-Added "Unable to start camera while in a call" Alert Disable
-Added Remap Power Button to Shutter Key for Camcorder (start only)
v2
-Corrupted Upload... Sorry!
v1
-Initial Release
Thanks:
-Adrynalyne for providing the deodexed, froyo Camera.apk with optional geotagging added.
-The author of that forum post I read that pointed me to the "camera.smali" file. I'm sorry, I have no idea who you are.
-Whoever wrote this Dalvik VM cheatsheet
-S44 for putting together the CWM flash file
[SIZE=+1]Process - How I Made It[/SIZE]
I extracted the Camera.apk from SuperClean 2.0. From there, I extracted "classes.dex" using 7-zip. Then, I decompiled "classes.dex" using baksmali. I edited the Dalvik bytecode in the Camera.smali and AbstractCameraActivity.smali files using Notepad++. I recompiled "classses.dex" using smali. I overwrote the "classes.dex" in the Camera.apk using 7-zip. Finally, I zipaligned the resulting APK.
I did not mod the camcorder files (v2.1 - I have half of the camcorder part done), but the process would be similar. Also, if you understand the general rules of bytecode, you could adapt this to other versions of the APK fairly quickly.
The commands I used for decompiling and recompiling are as follows:
java -jar baksmali-1.2.1.jar -x classes.dex
java -Xmx512m -jar smali-1.2.1.jar -o classes.dex c:\out
Remap Power Button to Shutter Key for Camera
In com\sec\android\app\camera\Camera.smali, the red lines are the ones I modified:
Code:
.line 728
:cond_45
const/16 v1, 0x1a
[COLOR="red"]goto :cond_52[/COLOR]
.line 729
invoke-virtual {p0}, Lcom/sec/android/app/camera/Camera;->isCaptureEnabled()Z
Code:
.line 736
:sswitch_data_fc
.sparse-switch
0x4 -> :sswitch_61
0x17 -> :sswitch_69
0x18 -> :sswitch_b7
0x19 -> :sswitch_b7
[COLOR="red"] 0x1a -> :sswitch_69[/COLOR]
0x1b -> :sswitch_69
0x42 -> :sswitch_69
0x50 -> :sswitch_63
0x52 -> :sswitch_61
0x54 -> :sswitch_61
.end sparse-switch
.end method
Code:
.line 828
:cond_3a
const/16 v0, 0x1a
[COLOR="red"]goto :cond_57[/COLOR]
.line 830
invoke-direct {p0}, Lcom/sec/android/app/camera/Camera;->resetFocusDueToZoom()V
Code:
.line 848
nop
:sswitch_data_e8
.sparse-switch
0x4 -> :sswitch_83
0x17 -> :sswitch_b5
0x18 -> :sswitch_e4
0x19 -> :sswitch_e4
[COLOR="red"]0x1a -> :sswitch_b5[/COLOR]
0x1b -> :sswitch_b5
0x42 -> :sswitch_b5
0x52 -> :sswitch_b2
0x54 -> :sswitch_e4
.end sparse-switch
.end method
There you have it. You only have to modify 4 lines, and now your power button should perfectly emulate the shutter key on the screen.
Low Battery Alert Disable
In com\sec\android\app\camera\AbstractCameraActivity.smali, add the red line:
Code:
.line 855
:cond_14
invoke-virtual {p0}, Lcom/sec/android/app/camera/AbstractCameraActivity;->hideAllDlg()V
[COLOR="Red"]goto :goto_13[/COLOR]
.line 857
new-instance v0, Landroid/app/AlertDialog$Builder;
"Unable to start camera while in a call" Alert Disable - Added in v2.1
In com\sec\android\app\camera\AbstractCameraActivity.smali, add the red line:
Code:
.line 613
const/4 v2, 0x0
[COLOR="Red"]goto :goto_1a[/COLOR]
iput-boolean v2, p0, Lcom/sec/android/app/camera/AbstractCameraActivity;->mCheckCalling:Z

Excellent!
I don't suppose you could further edit the camera to disable Geotagging?

s44 said:
Excellent!
I don't suppose you could further edit the camera to disable Geotagging?
Click to expand...
Click to collapse
It's not enabled by default. It's just an option in the menu.

I really needed this, great work! I hope devs start including this standard in future ROMs.

Amazing job. I've been waiting for something like this.

I'm almost. As excited about this as I am froyo.
Sent from my SCH-I500 using XDA App

Wow this is really cool and is flawlessly working.. You da man
Sent from my SCH-I500 using XDA App

yuuup you the MAN
any chance there's a way to remap the search button to bring up the camera?
I currently use the power remap mod and it's pretty useful but having a quick camera button would be awesome

djlim4 said:
yuuup you the MAN
any chance there's a way to remap the search button to bring up the camera?
I currently use the power remap mod and it's pretty useful but having a quick camera button would be awesome
Click to expand...
Click to collapse
I have done this mod, just search forum

thatdudebutch said:
I have done this mod, just search forum
Click to expand...
Click to collapse
I can't seem to get this to install. Any help would be greatly appreciated.

I don't know what's cooler, the fact that you hacked this up and released it, or that you released a detailed HOW-TO on the process.
Oh wait, it's definitely the HOW-TO. That's going the extra-mile for sure, and helping the community grow.
You're awesome!

Doesn't install for me. I select the apk, says it's a system app and do I want to replace, click yes, install, then it says "Installing.." for a few seconds before jumping to "Application not installed." No other errors. Any ideas?

You don't install system apps, you drop them into /system/app with adb or Root Explorer. Don't forget to delete Camera.odex if you're running stock, and clear Dalvik after no matter what.
edit -- the attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
edit2 -- attached zip now has v2 of the mod
edit2.1 -- attached zip now has uncorrupted v2.1 of the mod

Wow, nice job!
I would be *very* interested if you could point me in any direction that might help understand how you knew what lines to change, and what to change them to.
I'm trying to modify a few apks, and I've been digging through all the smali files, but I can't seem to find anything that makes any sense. I see a lot of things that might be what I need to change, but it's not obvious enough to know for sure if, or how, to change it.

s44 said:
You don't install system apps, you drop them into /system/app with adb or Root Explorer. Don't forget to delete Camera.odex if you're running stock, and clear Dalvik after no matter what.
edit -- the attached Clockwork zip *should* do all the above (delete the odex if it exists, clear the Camera's dalvik cache entry, and install the Camera apk into /system/app)
Click to expand...
Click to collapse
Thanks. Putting it in /system/app worked.

Updated OP with v2.
Let me know if everything is fully functional. Thanks!

I'm getting FC with v2
Edit: I tried both the .zip and manually replacing the apk
Sent from my SCH-I500 using XDA App

Joshuaboyzn said:
I'm getting FC with v2
Sent from my SCH-I500 using XDA App
Click to expand...
Click to collapse
Does v1 work?

GizmoDroid said:
Does v1 work?
Click to expand...
Click to collapse
Yes. V1 worked for me.
Sent from my SCH-I500 using XDA App

Will you try installing s44's zip file through CWM?
-deleted because my v2 upload was corrupted-

Related

X10 Mini/Mini pro Theme Reference for Newbies

This thread was opened to consolidate the information/knowledge about themes for the x10 mini/mini pro. It is basically a reference thread with key bits of information and links so that a new user can find all the necessary information in one place. It should also help us avoid the old ‘where the hell was that image…?’ and ‘where was that … thread again?’.
Please PM me or post any useful information that is missing, especially the OPs of the threads in the Themes section below. I will continually update this thread with any new information or links.
At the moment this is a work in progress. I will fill it out in the days to come. And will keep it updated so long as I have my x10 mini pro (at least another 18 months according to t-mobile ).
All useful information that is posted here will be added to this first page, so that you don't have to wade through pages of posts to try and find something. Everything after the first page should therefore either be repeated on this page somewhere or is just conversation. Please yell at me should this not be the case
Please help me out by posting information, ideas etc.
Creating Themes for the x10:
1. Getting Started
2. Using ADB
3. Creating a Theme
4. Modifying XML files and adding resources
5. Modifying Services.jar
6. Recovery tips
7. Theme collection
8. Replace Framework with Root Explorer
Credits:
_calum_
Download all your original system applications here.
**Guys If u like this tutorial thank me by donating me .**
Getting Started
Before getting started on a theme you'll need to set a few things up. Here's a list of everything you'll need:
• Root. Your phone will need to be rooted
• Java SDK (JDK). You'll need to install the JDK (and JRE) before you can start modifying the contents of your phone. Check out this video of Chewitts if you're having problems on x64 systems.
• ADB (from the Android SDK). You need ADB to push/pull files to and from your phone (see the next post)
The easiest way to make sure everything is set up properly is to install someone elses theme.
After you've done all that take a look at this.
Using ADB
There's an ADB Guide here :
Before you start need to unsecure the shell. Use the following adb commands to do this if you haven't already (to reverse it do chmod 0755... ):
Code:
adb shell
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
chmod 4755 /system/bin/sh
This is all described in the links posted in the Getting Started section above
Thanks to MrRusch for making our lives easier with this tool. For those of you new to this, you should still read the guide linked above so that you know what is actually going on.
Here's a step by step for pulling the framework from your phone and pushing it back. The boot animation mod at the bottom is for 2.1 it is found in system/media/bootanimation.zip.
Step 1:
Connect phone to pc, enable usb debugging and open adb. Type:
adb pull /system/framework/framework-res.apk framework-res.apk
That will pull your framework-res.apk to whatever folder is displaying in your command line.
Step 2:
Find the framework-res.apk on your hard drive, right click and open with 7zip.
Step 3:
Use png's here or create your own and dump into the appropriate folder within framework-res.apk.
Step 4:
When you are done editing the files open up adb and type the following command:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push framework-res.apk /sdcard/framework-res.apk
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
That will put the new framework-res.apk on your phone. It should automatically reboot (if not reboot it) and your changes should be applied!
When running the script above you can replace framework-res.apk with whatever you want. For example, Conversations.apk,Alarm.apk etc.
Remember, it is CASE sensitive I made this problem many times)
If you would like to pull an entire folder put a slash at the end of the last word. For example, adb pull /system/etc /etc"/" (no " in actual script )
Courtesy of corruptfate is the steps to modify the Boot animation
step 1: Copy bootanimation.zip to sdcard
step 2: Open CMD (Command Prompt)
step 2: type "adb shell"
step 3: type "su"
step 5: type "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"
step 5: busybox cp /sdcard/bootanimation.zip /system/media/bootanimation.zip
step 6: chmod 755 /system/media/bootanimation.zip
Click to expand...
Click to collapse
Creating a theme
So, now that we’ve got the framework-res.apk onto our hard drive, we can take a look at creating a theme. The only skill that is really required to change the appearance of the framework (this is the system file that contains the notification bar, settings etc.) is being able to edit .png image files to suit your tastes. If you can do this then it is just a matter of knowing how to extract the images, and how to update the .apk with them after editing.
.9.png's
Before we start we need to take a look at a special kind of image in android apk’s: the .9.png’s. These are recognisable, as the name suggests, by the double extension *.9.png.
.9.png's are images with a bit of extra information embedded. They contain information on how they can be stretched, and where the content can go (e.g. for a button background, which area of the background can contain the text).
This information is contained in a single pixel border (the guides) around the image and can be added using draw9patch. The catch here is that the guides must be compiled into the image before it can be used.
The Border: For the most part, you will not have to edit the border of a .9.png because, as long as you follow the guide below, the guides will already be in the image and you will not need to change them. If you do need to create your own (I’d assume you know enough not to be reading this though ), you can find more information here.
Editing the Framework
In this example we will look at editing framework-res.apk. However, the process can be used on any apk.
The method described below may seem overly complicated for those who have experience in this area, but it is (in my opinion) the easiest ‘sure-fire’ way to make sure you don’t have any problems (especially with the .9.png’s).
In rare cases, when the .apk your modifying doesn’t have any .9.png’s (e.g. the Recent Calls widget) then you can skip straight to the ‘Updating images using Drag/Drop’ section below.
Requirements:
You will need the following:
7zip apktool - this is included in the attached file themes.zip
Some people use WinRAR instead of 7zip, but apktool uses some 7zip commands internally so make sure it is installed (I think, I know this is the case for APK Manager, I still need to test this for apktool, but hey, just use 7zip, it's free and works exceptionally well).
Setting up:
In the attached zip file (themes.zip) you will find a copy of my theme creation environment. It’s not too complicated, it only contains a couple of folders so I know where everything is, three key batch files (all one-liners) and apktool.
The first thing we need to look at is install_framework.bat. This contains the following line:
Code:
java -jar apktool.jar install-framework stock\framework-res.apk
All this does is tell apktool to install the framework on your system. The resources from stock\framework-res.apk will be extracted to a default location. If you don’t do this then you will not be able to recompile other apk’s that rely on the framework (you will get a ResourceNotFound error).
The other batch files decompile and build the framework, these are the ones that need to be modified if you start working on a different apk:
Code:
decompile.bat
java -jar apktool.jar d stock\ framework-res.apk working\ framework-res
build.bat
java -jar apktool.jar b working\framework-res out\framework-res.apk
I have included the stock X10 mini pro framework. If you use on of the other frameworks out there you may find that you get a lot of errors when trying to recompile. That’s because someone got lazy with the .9.png’s
As we are modifying the framework directly we do not need to run install_framework.bat, for a different apk (e.g. Phonebook.apk) you may need to run this first to avoid errors when decompiling.
Decompiling and Building:
1. Run decompile.bat. After this you will see that the working folder is filled with the contents of the apk. The images we need to modify are in the subfolders res/drawable-ldpi and res/drawable-land-ldpi. If you look at some of the .9.png’s in there you can see the guides (see the attached image). This makes it really easy to edit them, you can just edit them like any other image (as long as you do not touch/alter the guides).
2. Edit any images that you want. For the .9.pngs I usually make a copy without the 1 pixel border so that I can edit the entire image, then I paste the copy back into the middle of the original .9.png. You don’t have to worry about the guides, they are already set correctly.
I have created a tool that takes the stock x10 mini / mini pro status bar icons, removes the background and sets them to a colour of your choice here. This was made to make my life easier by minimizing the time I spend in photoshop.
3. Run build.bat. This compiles the framework, embedding the guide information into the .9.png’s. The output framework is in the out folder. Do not push this to your phone as it is incomplete and the resources.arsc is stored incorrectly. If you do push it to your phone then you get to reflash
Now you can just drag the edited images out of the generated framework onto your hard drive and use steps 4. and 5. of the Drag/Drop method described below to update your framework.
Updating images using Drag/Drop:
1. Open the .apk in 7zip and browse to the appropriate image folder (almost always the res\drawable-hdpi folder)
2. Drag/Drop the images you want to edit to your hard drive. Leave the .apk open in 7zip
3. Edit the images in your favourite program (photoshop or similar)
4. Drag/Drop the images back into the .apk that is still open
5. Use the process described in the previous post to push the framework back to the phone
The reason that the .apk is left open in this process is that some (all?) of them are signed and updating them in this way doesn’t mess with the signature. I’ll admit to not being 100% sure about this, I’m sort of thinking now that people just had problems re-packing due to files being compressed that shouldn’t have been (see the section on editing XML files and adding resources to see what I mean). Please correct me on this one.
This also [almost] goes without saying, but: Make a backup before you start (you can look at the installer for Chewitts Dark10 theme to see how to do this).
OK, now you can start messing with the appearance of your phone, have fun
Credits
Thanks to Mr_Element for the help testing this process and making it easier to follow
Thanks to damnitpud for his post here, without which I would still have been a bit lost in draw9patch.
Modifying XML files and adding resources
First up, thanks to MrRusch for pointing out that the resources.arsc was being zipped differently. It would have taken a few more flashes to figure out how to pack it into the apk without that little nugget
The XML files in the framework-res.apk (and the other apps) are stored in a compiled form, making them impossible to edit without decompiling them. The process of decompiling them and recompiling is reasonably simple but care is required if any images/resources are added to the apk.
Modifying the xml files opens up certain things that can’t be changed by just modifying some image files. The best example is changing the battery icon in the notification bar to show a different image for each percentage instead of just 10%, 20%, 40% etc.
When you modify xml files and add resources to your apk, make sure you copy ALL the modifications made to the stock apk each time after compiling. I have noticed strange effects if I don't do this such as the wrong images being used - I am assuming that in the newly compiled resources.arsc the image references/IDs change when compiled, but I'm not really sure yet. An example of this is when I tried to add the signal strength mod mentioned above to a framework that included the battery icon mod below. This only worked if I also copied the battery mod files to the framework (even though they were already in the apk) after recompiling the signal strength mod. If I just copied the files required for the signal strength mod then the battery indicator would start showing the wrong images .
Battery Icon:
Here is a step by step for modifying the battery icon in the framework. To do this you will need to download apktool and install 7zip (other compression programs may work, but I’ve only used 7zip). I have attached some example files with 100 steps (one for each percentage) in case you just want to add them to your existing framework. Just make sure they are added as described below!
1. Decompile the framework using the following command:
Code:
java -jar apktool.jar d framework-res.apk framework-res
2.This will decompile the framework-res.apk that’s in the current command window folder into a subfolder framework-res
Find the xml files you need to modify, e.g. the battery icon xml res\drawable\stat_sys_battery.xml and edit them. This is assuming, of course that you know what needs to go in the XML file . For the battery XML it is pretty obvious, just copy/paste the existing nodes and change them so you have the necessary percentage entries, see the attachment for an example with 100 steps.
3. Add any necessary resources to the appropriate folder. For the battery icon you need to create an image for each percentage (or download one of these) and add them to the res\drawable_hdpi folder. The name is the same as the name in the xml (stat_sys_battery_*.png)
4. Rebuild the apk using the following command:
Code:
java -jar apktool.jar b framework-res out\framework-res.apk
This will create a new framework-res.apk in a subfolder out.
IMPORTANT: Do not push this apk to your phone unless you want to reflash
5. Extract the xml files and images from the newly generated apk (you can use the original images, but the xml files must be the newly compiled ones from the new apk). Add these files to the original framework-res.apk that you want to push to your phone (see the previous post).
6. Extract the resources.arsc from the root of the apk
7. Rename the original framework-res.apk from your theme to framework-res.zip
8. Right-click the extracted resources.arsc and choose the 7zip menu item ‘Add to archive’
9. In the dialog that appears set the achive field at the top to the framework-res.zip from step 7. And set the archive format to zip. Now set the Compression level to store and click OK(if you do not do this your phone will not boot). The settings are in the attached screenshot.
10. Rename framework-res.zip to framework-res.apk and double check that the compressed size or resources.arsc is the same as the original size (see screenshot)
11. Done. Push the new framework to your phone.
Status Bar Text:
The style for most (all?) UI elements can be found in res/values/styles.xml. This xml file is only available in a decompiled framework. In the compiled version everything in res/values is compiled into resoureces.arsc.
The status bar text style is named TextAppearance.StatusBar. The file is pretty large so it's best just to do a search for the name. The definition looks like this:
Code:
<style name="TextAppearance.StatusBar" parent="@style/TextAppearance">
<item name="textSize">16.0sp</item>
<item name="textStyle">normal</item>
<item name="textColor">@color/semc_text_color_primary</item>
</style>
You can easily adjust the size or make the text bold using the textSize and textStyle elements (see here for a description of these attributes and their values). The color uses the @color/... notation. This is a reference to a color resource, these can be found in colors.xml. We could just change this to a direct color entry (see here for an example), but then we wouldn't have a resource that can be reused for other parts of the UI.
If you open colors.xml you can find this:
Code:
<color name="semc_text_color_primary">#ffffffff</color>
This sets the primary text color to white (ARGB: FFFFFFFF = White). Changing the value of this will change the color of all primary text throughout the phone (settings menu etc.). If we just want to change the notification bar then it's best to add a new color. To do this just duplicate the above color definition and change the name and color:
Code:
<color name="semc_text_color_primary">#ffffffff</color>
<color name="semc_text_color_custom">#9900ff00</color>
And then adjust the style to use this new color resource:
Code:
<style name="TextAppearance.StatusBar" parent="@style/TextAppearance">
<item name="textSize">16.0sp</item>
<item name="textStyle">normal</item>
<item name="textColor">@color/semc_text_color_custom</item>
</style>
Now recompile and copy resources.arsc to your framework as described above and push the framework to your phone for semi-transparent green text in your status bar
Modifying Services.jar
To modify services.jar we need to decompile the classes.dex file contained within. We can do this with baksmali:
1. Open services.jar (found in system/framework) with 7zip
2. Extract classes.dex from the archive
3. Open a command window and use the following to decompile:
Code:
java -jar baksmali-1.2.5.jar -o out\services classes.dex
4. You will now have a subfolder out\services with the decompiled .dex classes (smali files)
These sort of modifications will not be necessary very often. Two things that have been looked at so far are changing the text color on the status bar clock (just the clock, not the notification text) and changing the signal strength to show dBm instead of just the bars. The text color of the clock is relatively simple and is described below. The signal strength mod was done by MrRusch and requires a bit more code.
I have attached a converter MrRusch has put together to convert java to smali. This is really helpful when trying to figure out how to modify the smali or event just trying to figure out what a piece of smali code does.
You can find a reference for all the smali ops here. This one is more complete but I prefer the first purely because it's a bit more compact and it has most of what I need anyway. Thanks to untemensch and JesusFreke for the links.
Status Bar Clock Color:
I have since figured out how to do this without changing any code, just by changing some xml in res/layout, but I will keep this here as I think it is a nice, easy to follow example to start out with.
This section describes how to modify the color of the clock in the status bar without changing the color of the notification text (changing all of the status bar text is described in the xml section above).
First we need to have a look at the smali file com\android\server\status\StatusBarIcon.smali to see how the color of the clock text is set. I use Visual Studio to view/edit the smali files, but you can use any text editor - I have seen PSPad recommended a few times.
If we look at the init method we can see the following piece of smali code:
Code:
.line 44
.local v15, textColor:I
const/4 v13, -0x1
.line 50
.local v13, styleIndex:I
const v18, 0x1030079
:try_start_1f
sget-object v19, Lcom/android/internal/R$styleable;->TextAppearance:[I
move-object/from16 v0, p1
move/from16 v1, v18
move-object/from16 v2, v19
invoke-virtual {v0, v1, v2}, Landroid/content/Context;->obtainStyledAttributes(I[I)Landroid/content/res/TypedArray;
move-result-object v5
.line 53
.local v5, a:Landroid/content/res/TypedArray;
const/16 v18, 0x0
move-object v0, v5
move/from16 v1, v18
move/from16 v2, v16
invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getDimension(IF)F
move-result v16
.line 54
const/16 v18, 0x3
move-object v0, v5
move/from16 v1, v18
move v2, v15
invoke-virtual {v0, v1, v2}, Landroid/content/res/TypedArray;->getColor(II)I
move-result v15
Here's a run-down:
I'm pretty sure the lines that start with a '.' are comments from the decompiler.
The .line 4 entries are just a reference to the line number in java source-code. And I think the .local v15, textColor:I entry just notes the v15 variable name and type (I = integer).
The first bit of interest is the line invoke-virtual {v0, v1, v2}, Landroid/content/Context;->obtainStyledAttributes(I[I). The obtainStyledAttributes method definition can be found here. There are a few overloads, but the call is to the method that accepts an integer and an integer array as parameters - hence the (I[I), I and [I. The three variables in braces at the start denote the object that the method is being called on (the Context object) and the two parameters respectively. The first parameter (v1) is a resource ID and a few lines up the v18 variable is copied to this (move/from16 v1, v18 - this means move the value from v18 to the v1 variable). v18 was declared a few lines above again with the value 0x1030079. This ID can be found in the framework xml-file res/values/public.xml and the value is the name of a style (TextAppearance.StatusBar) that can be found in res/valus/styles.xml (see the xml section above).
The result of obtainStyledAttributes is copied to v5 (move-result-object v5) which (in .line 54) is copied to v0 which is then used to call Landroid/content/res/TypedArray;->getColor with the two integer parameters v18 (0x3) and v15 (0x100 - this is the color black). The first parameter is the index of the color in the style array (index 3 in v5) and the second is the default value (black).
The result of getColor() is then copied to v15 and reused later when setting up the text view for the clock:
Code:
.line 61
.local v14, t:Landroid/widget/TextView;
move-object v0, v14
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/server/status/StatusBarIcon;->mTextView:Landroid/widget/TextView;
.line 62
new-instance v11, Landroid/widget/LinearLayout$LayoutParams;
const/16 v18, -0x2
const/16 v19, -0x1
move-object v0, v11
move/from16 v1, v18
move/from16 v2, v19
invoke-direct {v0, v1, v2}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V
.line 65
.local v11, layoutParams:Landroid/widget/LinearLayout$LayoutParams;
const/16 v18, 0x0
move-object v0, v14
move/from16 v1, v18
move/from16 v2, v16
invoke-virtual {v0, v1, v2}, Landroid/widget/TextView;->setTextSize(IF)V
.line 66
invoke-virtual {v14, v15}, Landroid/widget/TextView;->setTextColor(I)V
All this means that to change the color of the clock text only, we need to declare a new style and use the ID of this style in the call to obtainStyledAttributes. When adding the style to styles.xml I keep it in the same place as the other status bar styles:
Code:
...
<style name="TextAppearance.StatusBar" parent="@style/TextAppearance">
<item name="textSize">16.0sp</item>
<item name="textStyle">normal</item>
<item name="textColor">@color/semc_text_color_primary</item>
</style>
<style name="TextAppearance.StatusBar.Clock" parent="@style/TextAppearance">
<item name="textSize">16.0sp</item>
<item name="textStyle">normal</item>
<item name="textColor">@color/semc_text_color_clock</item>
</style>
...
The name of the style can be anything, what is important is the ID reference in public.xml, and that a color semc_text_color_clock is declared in colors.xml (see the xml section above).
The style reference in public.xml must have an ID that starts with 0x0103****. This is the ID range for styles, strings and other resources have a different ID range. I always add the new style at the bottom of the style group so that I can easily see which is the next free ID:
Code:
....
<public type="style" name="SEMCTheme.Dialog.Alert.Vanilla" id="0x01030139" />
<public type="style" name="TextAppearance.StatusBar.Clock" id="0x0103013a" />
....
Now that we have added a new style we just need to adjust the smali code to use it. Change the code above from:
Code:
.line 50
.local v13, styleIndex:I
const v18, 0x1030079
to:
Code:
.line 50
.local v13, styleIndex:I
const v18, 0x103013a
Now our new style is used for the call to obtainStyledAttributes. We then need to recompile the smali to a classes.dex file and update the services.jar:
Run the following command to recompile the smali:
Code:
java -jar smali-1.2.5.jar -o out\classes.dex out\services
The output file may be a slightly different size than the original classes.dex but as long as you don't get any errors it will be OK.
Now open services.jar with 7zip and update it with the new classes.dex (drag/drop).
Done Push the services.jar to your phone with adb and reboot (make sure you have updated framework-res.apk with the new xml resources first, otherwise our new ID will point to a non-existant resource)
Possible reasons your phone won't boot after modifications:
images anren't stored properly, right format, right size etc.
unpacked apk improperly, use 7zip, it doesn't mess anything up
you signed the package before pushing it- unless you know what you're doing follow the directions to a tee and you should be fine
pushed the package to the wrong directory, /system/framework-res.apk XX, /system/framework/framework-res.apk
I'm sure many other reasons, these were the only ones I encountered
How to get past boot screen:
Use backup framework-res.apk and push that one to your phone. Remember to place that one where the modified one is.
To see if adb sees your phone type adb devices, if a serial number pops up try pushing your original, if not...
Flash your phone again from scratch . Sorry, I don't know any better way yet.
from bitter personal experience :
If anyone does mess their phone up so much that not even the SE logo shows up (just a black, maybe flickering, screen) and a reflash/seus repair doesn't help. Then what sorted me out was a reflash to Generic Nordic 1.6 using this guide the same one I used to get the 2.1 update early - then boot the phone, shut down again and run seus for the 2.1 update and bin4ry flash tool.
Not directly related, but here's a tip from XperiaX10iUser:
To reverse chmod use 0755 instead of 4755.
Click to expand...
Click to collapse
Link to All The System Apps Mini : Download
Themes:
Black Android Theme 1.6 & 2.1 (by draco_ag)
*-=ShArP sUtEr=-* Theme Design For 2.1 (by Shiven Juneja)
Black HTC Theme For x10 mini & x8 (by pulpoff)
Suavesque x10 mini pro 2.1 theme
custom framework-res for 2.1 (By Mooozer)
Black theme + original android emotions For 1.6
[WIP] X10 Mini grey theme For 1.6
Iridium Carbon for 2.1 (by Dark_dog)
~THeMe~ Simplistic v1 Port for X10 Mini/Pro (By Manny-)
~THeMe~ Gingerbread Theme for X10 Mini/Pro
[Theme]Stock Android (Nexus One)
[Theme]Gingerbread Nexus S Edition [with Android 2.3 icons]
Root Explorer
@vippie
Maybe it's a known way, but I didn't find it yet . It works great for me. Your device has to be rooted.
Zocker Tko mentioned in his thread a black theme on a german forum. There's a little tutorial on that site on howto replace the framework-res.apk using Root Explorer:
* make a backup of the original file
* Copy framework-res.apk to the SD card
* Mount /system in RootExplorer as "rw"
* Copy framework-res.apk to /system
* Set permissions for framework-res.apk to 644. See screenshot:
* Move framework-res.apk to /system/framework and replace the existing file (reported to be safer than copy).
* Reboot your phone.
Ofcourse all credits goes to Bueffel the original poster.
Click to expand...
Click to collapse
Nice Guide for installing via root explorer by DarK_dOg:
Installation procedure:
Step 1:
Copy android.policy.jar, framework.jar, framework-
res.apk files into your (/sdcard).
Step 2:
Launch Root Explorer and browse to the location of the theme
pack files. Press menu and then "Multiselect". Then
select the files and press "copy".
Step 3:
Browse to /system. Press Mount R/W tab. Then press
paste.
Step 4:
You're in /system. Select android.policy.jar file.
From the pop-up menu, choose permissions and set them
according to the screenshot:
Step 5:
We follow the exact same procedure to set the permissions for
the framework.jar and framework-res.apk files.
CAUTION:It is very important to set
proper permissions (as shown on the screenshot) to all of the three
files, or else you will end up with a bricked phone
Step 6:
Once we set the permissions, our files are ready to move on /system framework. Press menu and then "
multiselect" (we are on /system).
For once again choose android.policy.jar, framework.jar
, framework-res.apk and press move.
Step 7:
Go to /system/framework and press
paste.
Click to expand...
Click to collapse
reserved.....
Great post. Thank you!
Quick question: Unsecuring the shell, if the phone stucks at boot, will I be able to replace framework-res as long as adb recognizes the phone? No need to su?
I ask this because I recently re-flashed my phone because I couldn't replace the framework I made by the stock one, but adb was recognizing the phone, just didn't let me su...
Thanks again.
Regards
ya u r write u can replace the framework with su
Steps:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
shivenjuneja said:
ya u r write u can replace the framework with su
Steps:
adb push framework-res.apk /sdcard/framework-res.apk
adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
Click to expand...
Click to collapse
Couldn't make this work.
My adb is still asking for su to root. Doesn't allow me to mount without root (su command after ad shell) even after chmod 4755.
This way if something goes wrong, I'll definitively will have to reflash... And that's... You know...
Any idea?
I would be much more comfortable to start playing around with this 'safety net' working...
Thanks again!
Regards
Thanks
Originally Posted by pulpoff >
If your phone gets stuck on booting after playing with framework or some other stuff, I've found a way to repair it without reflash :
restart phone, connect it to usb
in adb shell run rootshell command again to gain root (wise to keep it after rooting), the "su" won't work cause it depends on gfx libs and they are not started yet..
mount sdcard with this command : mount -t vfat /dev/block/mmcblk0p1 /sdcard
and put your backed files where they belong.
Good luck!
Click to expand...
Click to collapse
try this method....
shivenjuneja said:
try this method....
Click to expand...
Click to collapse
Sorry to bother...
Code:
D:\>adb shell
$ rootshell
rootshell
rootshell: permission denied
$ mount -t vfat /dev/block/mmcblk0p1 /sdcard
mount -t vfat /dev/block/mmcblk0p1 /sdcard
mount: Operation not permitted
$
Not sure I managed the 'rootshell' command well.
This is what I get.
My phone is rooted, obviously. I can do the 'su' with no problems.
I'm just trying to be safe before starting to mess around with framework...
Thanks you once again.
Regards
if the adb thing is not working thn you can do 1 thing. download droid explorer from this site http://de.codeplex.com/releases/view/50997 thn when you dont have access to your phone you can open droid explorer move your backup framework to your system framework framework-res.apk and you can also use this tool to do the further things...
http://forum.xda-developers.com/showthread.php?t=850340
I have droid explorer and android commander installed.
I know for experience that none of them work if phone gets stuck.
No 'su', no root, no permission to mount, no permission to write...
Feel free to delete this posts if you want the thread clean.
If we manage a solution, we can post it directly instead of 10 posts aroud the same thing.
Regards and thank you!
bro seus is the last option.... bt can u plz tell me where i wrote that we can do mofications without having su permissions in the thread??
shivenjuneja said:
bro seus is the last option.... bt can u plz tell me where i wrote that we can do mofications without having su permissions in the thread??
Click to expand...
Click to collapse
No, you didn't. I'm not saying that.
What I was looking for was a way to replace framework-res.apk in case something goes wrong and phone gets stuck in 'Sony Ericsson' black screen before bootanimation. In that case, 'su' is not allowed.
That's what happened to me last time I played around with it. And in that case I were not able to put the good framework-res.apk back in place, so I had to re-flash.
Having shell unsecured, I believe I can avoid re-flashing even if something goes wrong. I think I finally got a way to have this safety through SuperOneClick although I'm not so sure it will work in a worst case scenario, once the 'shell root' gained is always temporary until next reboot...
As I told you before, none of the ways you posted here to get 'shell root' or 'shell unsecured' worked for me, that's only what I was looking for.
Thank you again for all your work and patience.
Best regards!
Welll...
Playing aroud and I'm a small step to re.flash the phone.
I have my phone stuck in the 'Sony Ericsson' black screen.
Can't get root, rootshell, adb root or su after adb shell to work.
I need at least to change the permissions of my framework-res.apk file in /system/framework
Any idea on how to do this and avoid the re-flash?
Thanks

[DEV] How to add EDT Tweaks support in your odexed ROM/Themes

Original Threads (deodexed ROM/Themes)
[MOD] [JVP] Statusbar Tweaks - EDT
[MODS][MORPH] Kahvitahra's mods - EDT TWEAK
How to get it working on an ODEXED ROM!
The only file we are going to modify is /system/app/SystemUI.apk
If you already got this apk deodexed skip to step#2 (you can check for it by opening SystemUI.apk and check if classes.dex is already present)
Step#1 (baksmali)
You need to baksmali SystemUI.apk, i suppose you already know how to do it, if not just use search button!!!
Step#2 (apk-manager)
I am using apk-manager, so before to continue make sure you already have this tool installed and working!
Copy deodexed SystemUI.apk to place-apk-here-for-modding folder
Start Script.bat (don't close this windows we will use it later on)
Select option "19) Select compression level for apk's" and hit 0
Set current project (option 22)
Decompile apk (option 9)
go to projects\SystemUI.apk\res\layout and overwrite status_bar.xml with the file attached
go to projects\SystemUI.apk\smali\com\android\systemui\statusbar and copy the following files from the attached zip file: BatteryText$1.smali, BatteryText$SettingsObserver.smali, BatteryText.smali, Clock$1.smali, Clock.smali, DateView.smali
go to projects\SystemUI.apk\smali\com\android\systemui\statusbar\policy and overwrite StatusBarPolicy.smali with the one inside the zip file attacched
go back to the apk-manager windows (cmd.exe windows started with Script.bat) and select "Compile apk" (option 11)
just answer "yes" to the two questions you will promt!
Now before to go ahead, you will notice that a new folder "keep" has been created, open up that folder and delete "classes.dex" and "resources.arsc" then go to res/layout folder and delete status_bar.xml
Go back to the apk-manager windows and press enter to continue!
At the end you will see in place-apk-here-for-modding folder you modified unsignedSystemUI.apk
Step#3 (odex back)
-Download and copy "dexopt-wrapper" on /system/bin
-In adb just type:
Code:
adb shell echo $BOOTCLASSPATH
you should use the above string later on!
-copy "unsignedSystemUI.apk" from your pc to your /sdcard/mod folder (create this folder) and rename it to SystemUI.apk
-copy /sdcard/mod/SystemUI.apk to /sdcard/mod/done/SystemUI.apk, now open without extract it (use 7zip winrar..) and delete classes.dex.
Code:
> adb remount
> adb shell
# su
# cd /system/bin
# busybox chmod 755 dexopt-wrapper
Now you have right permission for dexopt-wrapper
Let's create a new .odex file from the SystemUI.apk file
Code:
# cd /sdcard/mod
# dexopt-wrapper SystemUI.apk new.odex [BOOTCLASSPATH]
fill in the value of BOOTCLASSPATH, without the []
do NOT continue until this command succeeds!
At this point your new.odex file won't work because dalvik virtual Machine store checksum for each packages which means that your new.odex file cannot pass this check on boot.
We will fix it:
Copy over the "signature" from the current(original one in your /system/app) .odex file into the new .odex file.
Code:
# busybox dd if=/system/app/SystemUI.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
now replace the old .odex file with the new .odex file. Also we will copy the apk without classes.dex to /system/app
Code:
# cd /system/app
# busybox cp /sdcard/mod/new.odex SystemUI.odex
# busybox chmod 644 SystemUI.odex
# busybox cp /sdcard/mod/done/SystemUI.apk SystemUI.apk
# busybox chmod 644 SystemUI.apk
# sync
# reboot
That's it!
NOTE:
Remember to backup your system before you start doing it, because some time your phone won't boot, maybe because you made some mistake in the smali code you have changed...
I usualy prepare a zip package with the original file i am going to replace, therefore if something goes wrong i can flash them back via CWM the original one!
Hope it can help!
Thanks to Kahvitahra for source code and every single one in this community.
View attachment EDT_sources.zip
Hi mate!
I also moded dateview.smali to show clock in pulldownbar
kahvitahra said:
Hi mate!
I also moded dateview.smali to show clock in pulldownbar
Click to expand...
Click to collapse
Thanks Bro!
\Edit
OP has been updated!
Suggestion for thread title:
How to add EDT Tweaks support in your odexed ROM/Themes.
Another suggestion:
Put links for the original threads on first post:
[MOD] [JVP] Statusbar Tweaks - EDT
[MODS][MORPH] Kahvitahra's mods - EDT TWEAK
OK, after the 1st quick overview i must say...i like my LeoMAR ROM as it is now! ;o)
Never done something like that before and i don´t wanna challenge my luck too much...
Just wonderfull Many thanks
Second way
Edited post
mmmh?
Can i have an italian guide to apply this on my odexed rom? i never use this program...i know only how install a rom! now i have a tweaky rom v2 on my sgs
is it possible to do??? grazie infinite!!!
Hy. Can anyone make me this for XWKJ1 odexed rom pls?
Code:
.method private final updateClock()V
.locals 5
.prologue
.line 78
new-instance v0, Ljava/util/Date;
invoke-direct {v0}, Ljava/util/Date;-><init>()V
.line 85
.local v0, now:Ljava/util/Date;
const/4 v1, 0x2
const/4 v2, 0x0
invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;
move-result-object v1
invoke-virtual {v1, v0}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/DateView;->setText(Ljava/lang/CharSequence;)V
.line 87
return-void
.end method
Sorry for reviving this thread but i have a question.
With this code in DateView.smali i got an am/pm clock and i use a 24h format.
Anyone knows how to edit DateView.smali or StatusBarPolicy.smali to get a 24H format on the clock in the notification pulldown?
I´ve been searching and found some references but it looks a little "grey" to me, because they only refer on removing the am/pm and not displaying 24h format.
Is there a way to get the correct time format from this line?
Code:
invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;
Thanks
Edit: If i change system language to Portuguese, the clock displays 24h format, but in english it only displays 12h. Still no go, i want to use english.
battax said:
Code:
.method private final updateClock()V
.locals 5
.prologue
.line 78
new-instance v0, Ljava/util/Date;
invoke-direct {v0}, Ljava/util/Date;-><init>()V
.line 85
.local v0, now:Ljava/util/Date;
const/4 v1, 0x2
const/4 v2, 0x0
invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;
move-result-object v1
invoke-virtual {v1, v0}, Ljava/text/DateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
move-result-object v1
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/DateView;->setText(Ljava/lang/CharSequence;)V
.line 87
return-void
.end method
Sorry for reviving this thread but i have a question.
With this code in DateView.smali i got an am/pm clock and i use a 24h format.
Anyone knows how to edit DateView.smali or StatusBarPolicy.smali to get a 24H format on the clock in the notification pulldown?
I´ve been searching and found some references but it looks a little "grey" to me, because they only refer on removing the am/pm and not displaying 24h format.
Is there a way to get the correct time format from this line?
Code:
invoke-static {v1, v2}, Ljava/text/DateFormat;->getDateTimeInstance(II)Ljava/text/DateFormat;
Thanks
Edit: If i change system language to Portuguese, the clock displays 24h format, but in english it only displays 12h. Still no go, i want to use english.
Click to expand...
Click to collapse
Hi!
Getdatetimeinstance gets time format depending to your locale, like you said. With simpledateformat you can achive that what you are looking for.
Im on phone now so cant paste links, but you can navigate to my thread from my signature. There is edt + custom date format. You can pick code from there or just use that the way its done. There is also moded settings.apk so that you can put any format you like in that notification date/time. Affected files are told in those posts.
Thanks i´ve already used your mod yesterday a awhile after my first post, but i will search the code.
Thanks
I believe you can have a deodexed app on your odexed rom. Just remember to remove (backup) the 2 odexed files and clear dalvik-cache.
PS: this is true only for files in the app folder! Not in the framework folder!
Pps: I should include some of this mod in my mod
Thanks!
Sent from my GT-I9100 using xda premium

[MOD][HOWTO] Disabling Autorotation in Call and Alarm Clock

Hi
After study Phone.apk and ClockPackage.apk I've found how to disable properly the autorotation:
Disable autorotation in Phone.apk (only in callscreen)
Decompile Phone.apk
Locate com/android/phone/InCallScreen.smali
Locate method onConfigurationChanged
Search:
Code:
invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V
.line 6650
iget v0, p0, Lcom/android/phone/InCallScreen;->mOrientation:I
iget v1, p1, Landroid/content/res/Configuration;->orientation:I
if-ne v0, v1, [B][SIZE="4"]:cond_2[/SIZE][/B]
Replace by:
Code:
invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V
# .line 6650
# iget v0, p0, Lcom/android/phone/InCallScreen;->mOrientation:I
# iget v1, p1, Landroid/content/res/Configuration;->orientation:I
# if-ne v0, v1, [B][SIZE="4"]:cond_2[/SIZE][/B]
const/4 v0, 0x1
invoke-virtual {p0, v0}, Lcom/android/phone/InCallScreen;->setRequestedOrientation(I)V
goto [B][SIZE="4"]:cond_2[/SIZE][/B]
Noticie :cond_2 . You have to use same condition number, maybe when you decompile then you will get another number, in last baksmali I get another number
Compile new Phone.apk and zipalign
Replace classes.dex from new Phone.apk to original Phone.apk and replace it in your phone
You can install manually using adb in recovery mode
Extract Phone.apk from zip file and follow next steps in a command shell
Code:
adb root
adb push Phone.apk /system/app/Phone.apk
adb shell mount -o rw -t ext4 /dev/block/mmcblk0p10 /data
adb shell rm -f /data/dalvik-cache/*phone*
adb shell rm -f /data/dalvik-cache/*Phone*
adb shell sync
Now Autorotation is disabled in call screen
Modified Phone.apk ONLY FOR LITENING 6.1 (CMW)
http://www.mediafire.com/?wvhxynux1v3e83u
Disable autorotation in ClockPackage.apk (only when alarm is running)
Decompile ClockPackage.apk
Locate com/sec/android/app/clockpackage/alarm/AlarmAlert.smali
Locate method onConfigurationChanged
Search:
Code:
.end local v0 #config:Landroid/content/res/Configuration;
.end local v4 #r:Landroid/content/res/Resources;
:cond_1
iget-object v5, p0, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->mItem:Lcom/sec/android/app/clockpackage/alarm/AlarmItem;
iget v5, v5, Lcom/sec/android/app/clockpackage/alarm/AlarmItem;->activate:I
Replace by:
Code:
.end local v0 #config:Landroid/content/res/Configuration;
.end local v4 #r:Landroid/content/res/Resources;
:cond_1
const/4 v5, 0x1
invoke-virtual {p0, v5}, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->setRequestedOrientation(I)V
iget-object v5, p0, Lcom/sec/android/app/clockpackage/alarm/AlarmAlert;->mItem:Lcom/sec/android/app/clockpackage/alarm/AlarmItem;
iget v5, v5, Lcom/sec/android/app/clockpackage/alarm/AlarmItem;->activate:I
Modified ClockPackage.apkONLY FOR LITENING 6.1 (CMW)
http://www.mediafire.com/?cj8k0ieck6sd3vv
hello,
installed by CMW, tested and ok for me.
Thanks for your good job
vadatte said:
hello,
installed by CMW, tested and ok for me.
Thanks for your good job
Click to expand...
Click to collapse
Thks for your report
rodries said:
Hi
Attached modified Phone.apk ONLY FOR LITENING 6.1 (CMW) Probably you will have to clean dalvik cache
Click to expand...
Click to collapse
Thank u very much !!! Workin well ! No dalvik cache cleenin!
It`s working only on Litening 6.1????
Is there solution for alarm clock ? I can't catch the arrow while its ringing
--------------------------------
Sent From ® Galaxy S II using Tapatalk
Остап said:
Is there solution for alarm clock ? I can't catch the arrow while its ringing
--------------------------------
Sent From ® Galaxy S II using Tapatalk
Click to expand...
Click to collapse
if you explain me the problem exactly i can try to fix it
078gregory said:
It`s working only on Litening 6.1????
Click to expand...
Click to collapse
Not sure but if you attach your phone.apk i can try to fix it for you
rodries said:
if you explain me the problem exactly i can try to fix it
Click to expand...
Click to collapse
A problem is the same. Autorotation while alarm is ringing.
rodries said:
Another Change:
- Adjust buttons properly if you receive the call in landscape mode
Click to expand...
Click to collapse
I see the some bug here. It's difficult to explain and very difficult to get screenshot because it occurs not every time ...
I'll try. Sometimes at the end of conversation or at time of it but while putting down the telephone and landscaping him ( when proximity sensor do not sense an ear ) all buttons shrinking. It's looking ugly. You need to try some playing with it and you'll see
I hope it helps to understand what i meen ....
Остап said:
I see the some bug here. It's difficult to explain and very difficult to get screenshot because it occurs not every time ...
I'll try. Sometimes at the end of conversation or at time of it but while putting down the telephone and landscaping him ( when proximity sensor do not sense an ear ) all buttons shrinking. It's looking ugly. You need to try some playing with it and you'll see
I hope it helps to understand what i meen ....
Click to expand...
Click to collapse
Uhmm, I can't reproduce, but I know what you mean.
I'm going to do a little change for testing.
rodries said:
Uhmm, I can't reproduce, but I know what you mean.
I'm going to do a little change for testing.
Click to expand...
Click to collapse
Yeah. Good if you are understanding
It's like 5-6 buttons in the row from gorizontal ( landscape ) position suddenly place themselves on vertical position. And the ugly effect of it - that the buttons appear to be very thin
Остап said:
A problem is the same. Autorotation while alarm is ringing.
Click to expand...
Click to collapse
Ok test this CMW zip file (ony for Litening 6.1) (Always make a backup before test)
http://www.mediafire.com/?cj8k0ieck6sd3vv
If works feel free to redistribute
Остап said:
Yeah. Good if you are understanding
It's like 5-6 buttons in the row from gorizontal ( landscape ) position suddenly place themselves on vertical position. And the ugly effect of it - that the buttons appear to be very thin
Click to expand...
Click to collapse
Try this new mod & comment
http://www.mediafire.com/?wvhxynux1v3e83u
Thanks for quick reply !!! Downloaded ( BOTH )and i'll test it and report !
rodries said:
Ok test this CMW zip file (ony for Litening 6.1) (Always make a backup before test)
http://www.mediafire.com/?cj8k0ieck6sd3vv
If works feel free to redistribute
Click to expand...
Click to collapse
Works perfect !!! Thank u very much !
Остап said:
Works perfect !!! Thank u very much !
Click to expand...
Click to collapse
OK
Waiting your report about buttons problem in call screen, if you think is working fine I'll update main post with the changes
rodries said:
OK
Waiting your report about buttons problem in call screen, if you think is working fine I'll update main post with the changes
Click to expand...
Click to collapse
I've a 3 only conversations today and haven't seen any issues about shrinking buttons. I hope it solved. I'll continue to supervise this. I suppose you can update your code.
And if it possible to release code of ClockPackage.apk at the first post
And if you want to change the name of this thread a little bit for easyest searching.
You are great ! Thanks !
Остап said:
I've a 3 only conversations today and haven't seen any issues about shrinking buttons. I hope it solved. I'll continue to supervise this. I suppose you can update your code.
And if it possible to release code of ClockPackage.apk at the first post
And if you want to change the name of this thread a little bit for easyest searching.
You are great ! Thanks !
Click to expand...
Click to collapse
Thks for report
Ok, I'll try to update the first post, my problem is that my english is not very good
Another problem is that I don't remember the ClockPackage changes p but I'll do a diff
Can you recommend me a thread name?
rodries said:
Thks for report
Ok, I'll try to update the first post, my problem is that my english is not very good
Another problem is that I don't remember the ClockPackage changes p but I'll do a diff
Can you recommend me a thread name?
Click to expand...
Click to collapse
You are coder, no ? ALWAYS wrap your code with comment !
Code:
# Begin Rodries No Rotation
....
# End Rodries No Rotation
It's simple to find the changes after )))
My english is the same
"[MOD][HOWTO] Disabling Autorotation in Call and Alarm Clock"

[MOD] Remove "Your phone will shut down" prompt

Okay, here is how to remove the annoying "confirm shutdown message".
I did this with KH4, but should work with most roms.
ALWAYS MAKE A BACKUP BEFORE MODIFYING YOUR ROM...JUST IN CASE THINGS GO TERRIBLY WRONG.
1 - Decompile framework.jar
2 - Open /com/android/internal/app/ShutdownThread.smali
3 - In .method public static shutdown(Landroid/content/Context;Z)V
look for the following:
.line 159
const-string v2, "ShutdownThread"
const-string v2, "Notifying thread to start radio shutdown"
invoke-static {v4, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/StringI
.line 161
if-eqz p1, :cond_2
4 - at about .line 161, comment out: if-eqz p1, :cond_2 as follows
# if-eqz p1, :cond_2 (make sure # is at beginning of line)
5 - then add the following after the above commented line:
goto :cond_2
the 2 lines should look like this:
# if-eqz p1, :cond_2
goto :cond_2
6 - recompile framework.jar
7 - use adb to push it to your sdcard
8 - then do the following:
adb shell
cd /sdcard/
stop
cp framework.jar /system/framework/
reboot
That's it - no more shutdown prompt!
amazing find
Thanks a lot
Sent from my GT-I9100 using xda premium
Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.
jonny68 said:
Good find but alternatively why not just download http://www.appbrain.com/app/quick-boot-(reboot)/com.siriusapplications.quickboot
i cant remember the last time i DIDN'T use this app to shut down or reboot my phone.
Click to expand...
Click to collapse
I prefer use the power menu for this and i will be pleased to skip the confirmation step
sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
i don't think it really matters to be honest, it shuts down quicker actually using the app i posted but each to their own
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Sent from my GT-I9100 Photon-based, Laser-accelerated 24-core I128 CPU
Click to expand...
Click to collapse
I've been using that app now for a long time and have never once had any problems
sicopat said:
I prefer use the power menu for this and i will be pleased to skip the confirmation step
Click to expand...
Click to collapse
I agree 100%. This works exactly as I wanted.
gcrutchr said:
I prefer clean shutdowns to ensure all buffers are flushed and processes are cleanly stopped. I doubt you will have any problems with a quick shutdown but you never know - could end up with some data loss. I even shutdown my Ubuntu pc cleanly to ensure no problems.
Click to expand...
Click to collapse
Thank you for sharing this.
mostyle said:
I agree 100%. This works exactly as I wanted.
Thank you for sharing this.
Click to expand...
Click to collapse
You're welcome!
Thanks mate
Cool find. Thanks
s7
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
tech927 said:
Does this mod work on an Nougat s7? If so, how do I decompile then recompile the .jar file?
Click to expand...
Click to collapse
I think probably not. This thread was written in 2011 and android Gingerbread is the latest android version then. Gingerbread is still known for the easiest android version to mod. Now, android nougat and oreo are taking place but they're damn hard to make any modification BUT you can try to decompile with apktool and see if it works

[Tip] Activating Ink effect with fingers (4.3)

A. android.policy.jar file:
1. Copy the contents of “to android.policy.jar” folder.
2. Decompile android.policy.jar by backsmali/smali program.
3. Go to classout\com\android\internal\policy\impl\sec\ folder open CircleUnlockRippleRenderer.smali and search for "const/16 v1, 0x4002" and change this line.
search
Code:
const/16 v1, 0x4002
if-ne v0, v1, :cond_138
change
Code:
const/16 v1, 0x4002
if-ne v1, v1, :cond_138
Now recompile android.policy.jar and push them to your device.
Credits. majdinj
Sorry for my English
Great! Havent tried it yet, but it should work.. Any other way though? Like to flash via recovery? I have 4.3 leaked, stock, rooted, twrp, odexed
Sent from my GT-N7100 using XDA Premium 4 mobile app
Could you share the files.. TQ
here it is.
please help me.
sorry for bothering you with my newbies question.
i have problem,, i hope you can help me regarding to this thread.
first i used [4.3][MI6]DN3(Ditto Note 3) ROM from Electron Team(E-team)
in that ROM the ripple effect is basically mod like in this thread, what i want to do is to reverse it to the original note 2 which is the ink only out when using s-pen.
i already follow steps like you said on post#1
1. copy my android.policy.jar to my sd and move to my computer
2. decompile with backsmali/smali program
3. unlike you i go to classout\com\android\internal\policy\impl\keyguard\sec folder open CircleUnlockRippleRenderer.smali and search for "const/16 v1, 0x4002" and change
i change the value
Code:
const/16 v1, 0x4002
if-ne v1, v1, :cond_138
into the original
Code:
const/16 v1, 0x4002
if-ne v0, v1, :cond_138
4. Recompile android.policy.jar and copy to my sdcard.
5. move the android.policy.jar with rootbrowser to its original location and replace the original android.policy.jar
but i ended with many error when i push the android.policy.jar that i mod with steps like you said in post#1.
my error is non stop FC and non stop TW, NFC, and etc stopped working.
can you tell me where do i made mistake? please give me solution about this problem, thanks before.
Safe way to replace any files in framework folder is using cwm.zip
Sent from my GT-N7100 using XDA Premium 4 mobile app
ink effect for kitkat 4.4.2 with fingers.
please go here
Thanks.
Hit THANKS button, If I helped You.

Categories

Resources