Opera Mobile is a nice browser and to my knowleage the only one that can turn off animated gifs. On the Streak Mini opera mobile has a clumsy interface: With the big buttons at the top and the bottom, there is less space for the content.
Basically you have what you see in attachment one.
When you start opera on the Streak 7 or another devices with 800x480 you will get the sleek tablet mode interface. Like in attachment two.
What happend? Opera Inc. deliberately turns tablet mode off for the model name "Dell Streak"
Here I will show how circumvent this.
Prerequisites:
adb and a connection to your device
java
aapt from android-sdk
apktool.jar
signapk.jar with testkey.x509.pem and testkey.pk8 (google for them, or create you own)
minimal commandline skills, how to edit text files
20 MiB space in a temporary directory
Make a nandroid-backup before you tinker around!
Recipe:
Fetch the opera-apk from your device with adb pull /data/app/com.opera.browser-1.apk
Sometimes it is -2 or -3. Have a look with adb shell ls /data/app/com.opera.browser*
Decompile the apk with java -jar apktool.jar d -r com.opera.browser-1.apk com.opera.browser
You will find the model name "Dell Streak" inside "com.opera.browser/smali/com/opera/common/CommonUtils$2.smali"
and "com.opera.browser/smali/com/opera/common/CommonUtils$1.smali"
Basically these files define who should see tablet mode, and who not.
Edit "com.opera.browser/smali/com/opera/common/CommonUtils$2.smali" and remove the lines
Code:
const-string v0, "Dell Streak"
invoke-virtual {p0, v0}, Lcom/opera/common/CommonUtils$2;->add(Ljava/lang/Object;)Z
Edit "com.opera.browser/smali/com/opera/common/CommonUtils$1.smali" and add the following line lines just before "Dell Streak 7"
Code:
const-string v0, "Dell Streak"
invoke-virtual {p0, v0}, Lcom/opera/common/CommonUtils$1;->add(Ljava/lang/Object;)Z
While at it, we should remove the unused libraries in "com.opera.browser/lib/armeabi". Delete the directory (leave armeabi-v7a alone!) and later gain 8 MiB space on your streak /data partition.
Now we compile the changes into an (unsigned) apk with java -jar apktool.jar b com.opera.browser com.opera.browser_unsign.apk
Sign the apk with java -jar signapk.jar testkey.x509.pem testkey.pk8 com.opera.browser_unsign.apk com.opera.browser.apk
We can't update the opera-apk on the device, because we changed the signing key. That is no problem as long you have no preferences changed in opera or didn't made bookmarks. So it is time to backup your opera configuration with adb shell tar cf /data/local/tmp/backup.tar data/data/com.opera.browser/opera
Now we uninstall the old opera apk with adb uninstall com.opera.browser
... and install the modified apk with adb install com.opera.browser.apk
Last step is to get back our old configuration with adb shell tar xf /data/local/tmp/backup.tar
I'm not so ever responsible of any damages you create while trying to reproduce this guidance.
Have fun,
hunderteins
Hi dude.. Really a very nice work looks great.. Can you upload the final apk file alone..? since I m not very keen with this work please.. B. R
i lyk ur way :good:
but der is an easy way too just edit ur build.prop and change the following line...reboot !!!
ro.product.model=GT-N7000
ro.product.manufacturer=samsung
and we can get updates...
MadHaker said:
i lyk ur way :good:
but der is an easy way too just edit ur build.prop and change the following line...reboot !!!
ro.product.model=GT-N7000
ro.product.manufacturer=samsung
and we can get updates...
Click to expand...
Click to collapse
well, but after that, every app thinks you are on a note, expecting 800 x 1280 pixels, 8MP or an other GPU. Don't know in what trouble you will run into with that hack.
Best way would be an app dependant way to fake getprop.
For example intercept property_get() in /system/lib/libcutils.so - would be nice for the market, too. Later, when I have a lot of time ...
"intercept property_get() in /system/lib/libcutils.so" -
i'm in!
(f.e. dpi, etc.)
No probs in applying the patch, dumb question - can opera top bar be removed?
_n0p_ said:
No probs in applying the patch, dumb question - can opera top bar be removed?
Click to expand...
Click to collapse
so how soon will this patch become available to us?
Did you mean a patched apk? I can share mine.
That would be good a patched apk
Sent from my Dell Streak using xda premium
http://n0p.8bit.fm/streak/com.opera.browser-1.apk
Cheers _nop_
Sent from my Dell Streak using xda premium
Thank hunderteins, the OP - it's his find.
Thank hunderteins
Thanks button pressed
Sent from my Dell Streak using xda premium
@hunderteins Have you an idea how to change the Nexus 10 to use the phone mode? The icons are so tiny and it is difficult to use them.
I tried to move the lines for
const-string v0, "Full Android"
from the one file to the other but without success.
I think I need to know what identifier is used for my Nexus 10...
EDIT: Just found it out! Add below
Code:
const-string v0, "Dell Streak"
this
Code:
const-string v0, "Nexus 10"
invoke-virtual {p0, v0}, Lcom/opera/common/r;->add(Ljava/lang/Object;)Z
:laugh:
is anyone still here?
I don't use opera browser but a friend wants to use opera phone mode on his Nexus 7. I have already dicompiled the apk but I can't find the files mentioned in first post to edit them.
is something changed in the latest versions of opera? shouldn't find them just by browsing the folders or I need eclipse to do it?
sorry for the noob question
thanks
psybill said:
is anyone still here?
is something changed in the latest versions of opera?
Click to expand...
Click to collapse
I expected this to be configurable with about:config by now.
Well opera uses code obfuscating now.
That means every symbols in a new release is renamed. In this 12.1.4, versionCode="1301080958"
I'm just snooping, you will find smali/com/opera/common/CommonUtils$2.smali renamed to
smali/com/opera/common/I.smali and smali/com/opera/common/CommonUtils$1.smali is renamed to
smali/com/opera/common/H.smali.
You can find this files on other releases of opera with
$ grep -r 'Dell Streak' smali/
on a linux command prompt. I know windows can search insides files, too. But find that by yourself.
Have fun,
hunderteins
hunderteins said:
I expected this to be configurable with about:config by now.
Well opera uses code obfuscating now.
That means every symbols in a new release is renamed. In this 12.1.4, versionCode="1301080958"
I'm just snooping, you will find smali/com/opera/common/CommonUtils$2.smali renamed to
smali/com/opera/common/I.smali and smali/com/opera/common/CommonUtils$1.smali is renamed to
smali/com/opera/common/H.smali.
You can find this files on other releases of opera with
$ grep -r 'Dell Streak' smali/
on a linux command prompt. I know windows can search insides files, too. But find that by yourself.
Have fun,
hunderteins
Click to expand...
Click to collapse
thanks for your help. you ΄re right about the file names. I'll have it in mind for the next version update.
But first I have to make this version work, and still didn't make it.
I had no problems with decompile, complie and sign the apk, but I know nothing about java files and I get fc's after installation. I want to do what billyx1 says in the post above, phone mode in tablet.
Can anyone care to share apk of latest modded version? The link shared by n0p doesn't work anymore.
Sent from my Dell Streak using Tapatalk 2
ammujee said:
Can anyone care to share apk of latest modded version? The link shared by n0p doesn't work anymore.
Sent from my Dell Streak using Tapatalk 2
Click to expand...
Click to collapse
Install Opera browser beta from Google play. It has tablet mode interface
ryan.nguyen said:
Install Opera browser beta from Google play. It has tablet mode interface
Click to expand...
Click to collapse
Thanks! I know that already, but I found that a bit too heavy for my ageing Streak.
Sent from my Dell Streak using Tapatalk 2
Related
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
How to theme
Samsung Vibrant Edition
Disclaimer: this guide is not idiot proof! You must have 1/2 a brain, 1/4 a brain will not work! Currently we have no way to know if you actually have 1/4 a brain or 1/2 so please take caution!
Click to expand...
Click to collapse
If you have extra images in your framework folders, it may cause problems later.. so try not to copy & paste or add extra images! - jumaaneface
Click to expand...
Click to collapse
What you will need:
-Apk Manager (Click)
-Android SDK (Click)
-An image editor, Adobe Photoshop is recommended!
-One brain.. (Edit: Half a brain is needed, not the full thing)
-Two hands..
-Fingers, 10 of them recommended!
-framework-res.apk
-twframework-res.apk
-services.jar (If you want to change the clock color)
How-to edit the apks:
1.) Get your two apk files (framework-res.apk & twframework-res.apk)
2.) Place them in apk-manager/place-apk-here-for-modding/
3.) Open apk-manager/script.bat
4.) Select option 22
5.) Select framework-res.apk
6.) Select option 1
7.) Select option 22
8.) Select twframework-res.apk
9.) Select option 1
10.) Go to apk-manager/projects/framework-res.apk/res/drawable-hdpi (or /drawable-hdpi-v4)
11.) Edit the .png files that you would like to change
12.) Go to apk-manager/projects/twframework-res/apk/res/drawable-hdpi (or /drawable-hdpi-v4)
13.) Edit the .png files that you would like to change
14.) Go back to script.bat
15.) Select option 22
16.) Select framework-res.apk
17.) Select option 3
18.) Select option 22
19.) Select twframework-res.apk
20.) Select option 3
(Don't zipalign)
21.) There will be two files in your place-here-for-modding folder.. They are called unsingedframework-res.apk & unsingedtwframework-res.apk just backup the originals, and delete the unsinged from part from the two new files.
How-to edit services.jar, clock color:
1.) Go to your SDK folder.. example: C:\android-sdk-windows\tools
2.) Get your services.jar file & open it with winrar
3.) Take the classes.dex from it & put it in your android-sdk-windows\tools\ folder
4.) Open CMD
5.) Run the following command: "CD C:\android-sdk-windows\tools" (directory may not be the same)
6.) Run the following command: "java -jar baksmali.jar -o classout/ classes.dex"
7.) Go to classout\com\android\server\status\StatusBarIcon.smali
8.) On line 34 it will look something like: "const/4 v7, -0x1"
9.) On line 34 change the above to: "const v7, 0xffffff" (That will be black)
10.) Compile the classes.dex by using this command: "java -Xmx512M -jar smali.jar classout/ -o new-classes.dex"
11.) Get the new-classes.dex from android-sdk-windows\tools\ folder & move it to your desktop
12.) Rename new-classes.dex to classes.dex
13.) Re-open the services.jar using winrar & past your new classes.dex in there
(Notice: After editing the clock color, it will take longer to boot the first time! Be patient!)
I may update this if people need an even easier guide...
I wrote this a while ago, and just had it on my forums.
Original: Click here
Helpful things:
"How to change colors from standard hex to smali code" - Tonicacid
"How to use html colors for changing the clock" - Master (me)
Nice dude thanks
This is awesome.
shouldnt you be able to change the ffffff in "const v7, 0xffffff" to whatever color you want?
Yeah, you can change it to whatever you want.. When I get home I'll add the directions to change the text color in the pull down and market downloads...
Tonicacid said:
shouldnt you be able to change the ffffff in "const v7, 0xffffff" to whatever color you want?
Click to expand...
Click to collapse
It would actually be
"const v7, 0xffff0000" for red, etc. But yes, you can change that value.
Possibly one of the most helpful threads. Just enough to make me feel I have 1/2 a brain.
stuck
Hey I'm new to this and first of all thank you so much for this!
Second I'm having a problem, I'm stuck at "java -Xmx512M -jar smali.jar classout/ -o new-classes.dex"
I keep getting "classout\com\android\server\status\StatusBarIcon.smali[0,0] 10145074 connot fit into a short"
I'm trying to change the status bar clock to Green.
Thank you again.
r6kid said:
Hey I'm new to this and first of all thank you so much for this!
Second I'm having a problem, I'm stuck at "java -Xmx512M -jar smali.jar classout/ -o new-classes.dex"
I keep getting "classout\com\android\server\status\StatusBarIcon.smali[0,0] 10145074 connot fit into a short"
I'm trying to change the status bar clock to Green.
Thank you again.
Click to expand...
Click to collapse
What hex code are you using
Sent from my SGH-T959 using XDA App
Sorry I wasn't using my half a brain I found my mess up I over looked the "const/4"
I will take it that I don't need apk manager. Just need to unpack, repack, and sign. I could also just use a Hex editor to change the colors on the things I would like to change such as date, notification text, etc.. Just like I did with the G1.
toeshot said:
I will take it that I don't need apk manager. Just need to unpack, repack, and sign. I could also just use a Hex editor to change the colors on the things I would like to change such as date, notification text, etc.. Just like I did with the G1.
Click to expand...
Click to collapse
I am pretty sure you can't use Hexedit to edit the Clock. You need to decompile it.
Also, you don't sign /system apks
Awesome! I barely qualify as a 1/2 brain. ApkManager is sweet simple program that does the job. In the many times I have used it, I noticed that recompilation of the files are not clean after images have been change/edit. So I always optimize images inside (option 2) everytime I recompile. Does this help and worth doing?
BTW: what xml editor are you guys using? Some of the ones that I downloaded are crap.
Tonicacid said:
What hex code are you using
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
I used "9acd32" but my clock isnt showing up at all now, I should be able to flash this with NinjaMorph right? or do I need to go in and replace it?
Master™ said:
I am pretty sure you can't use Hexedit to edit the Clock. You need to decompile it.
Also, you don't sign /system apks
Click to expand...
Click to collapse
ya I have to smali, to edit the clock. I was just wondering if apk manager offered anything out of unpacking the file.
r6kid said:
I used "9acd32" but my clock isnt showing up at all now, I should be able to flash this with NinjaMorph right? or do I need to go in and replace it?
Click to expand...
Click to collapse
Use the color code 6532CD for that color.
Sent from my SGH-T959 using XDA App
Tonicacid said:
Use the color code 6532CD for that color.
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
I'm still getting a no show for the clock?
r6kid said:
I'm still getting a no show for the clock?
Click to expand...
Click to collapse
Can you post the code you used
Sent from my SGH-T959 using XDA App
".prologue
const v7, 0x6532CD"
r6kid said:
".prologue
const v7, 0x6532CD"
Click to expand...
Click to collapse
This is a dumb question but your not putting the " marks in are you?
Sent from my SGH-T959 using XDA App
like I can't even play words with friends without it crashing due to damn ads...I'm runinng iho backside cm7 by jerryscript
Sent from my LG-VM670 using Tapatalk
bump
Sent from my LG-VM670 Running 2.3.5
http://bit.ly/pkQcdI
Sent from my LG-P500 using XDA App
mihir287 said:
http://bit.ly/pkQcdI
Sent from my LG-P500 using XDA App
Click to expand...
Click to collapse
did it work for yoy
Sent from my LG-VM670 Running 2.3.5
mihir287 said:
http://bit.ly/pkQcdI
Sent from my LG-P500 using XDA App
Click to expand...
Click to collapse
Total waste of time posting that crap.
Try this :
Code:
Make the free ad-supported version free of ads:
I'm sure you have already noticed, there is only one version of this game currently released for Android. The free ad-supported version. And if you have ever played, I'm sure you've noticed the super annoying full screen advertisement after each turn you take. So a friend of mine and I have been working on blocking ads, and we have been successful! Check below to find out how to remove both the full page ad and the banner ad!
Again, this isn't that hard of a process. The tut looks long and complicated, but that is just to make it noob friendly. Really this entire thing can be broken down into a few simple steps: Extract, decompile, edit, recompile, re-package, re-install. Its that simple.
1) You will need the latest Java JDK installed. Google for java SE downloads. Install the latest version to somewhere easy to remember, like the root of your C:\ drive.
2) Make sure your enviromental PATH variable is set up properly to point to your java jdk.
---- I am not going in depth on these first 2 steps cause google can tell you what to do, if you need my help just ask!-------
3) Download smali here: http://code.google.com/p/smali/ You will need all 4 files in the download section. Put this in another easy to remember directory, like C:\smali or something like that
4) On your phone, open dropbox, press menu, press upload, press any file, press root explorer
5) navigate to /data/app/com.zynga.wordswithfriends.apk Select this app so dropbox will upload it
6) Once its done uploading. Go to your computers dropbox. Right click the app, and tell it to open with 7zip.
7) In 7zip, click on the "classes.dex" file, and click the extract button. This will extract classes.dex to the same folder your app is in.
8 ) copy (or cut) your classes.dex file, and bring it into the directory where your smali files are. Paste it there.
9) Open a command prompt.
10) navigate in your command prompt to your smali folder
11) Use the following to de-compile the classes.dex file:
Decompile:
java -jar baksmali-1.2.6.jar -o <output directory> <.dex file, typically classes.dex>
For example: java -jar baksmali-1.2.6.jar -o out classes.dex
NOTE: The version number after "baksmali" may vary depending on the version you download. You can actually leave the <output directory> blank and it will default to "out".
When you do this, you will get a new folder named whatever you put as your output directory. Inside this folder you will find a lot of .smali files. This is a programming language that is a strange mix between ASM and vomit.
Also, once you have successfully decompiled your classes.dex file. You can go ahead and delete it. This way you dont get it confused with the new classes.dex file you will recompile later on.
12) in your output smali directory, navigate to /com/zynga/words/game
13) Double click the file named "AdActivity" (not "AdActivity$1") to open it in your default text editor.
14) press ctrl + f, and type "onCreate". This should take you to a public method named onCreate
15) Inside the onCreate method, about 20 lines of code down, there are two lines that look like this:
.line 54
invoke-direct {p0}, Lcom/zynga/words/game/AdActivity;->hideContinueButton()V
16) Edit the "hideContinueButton" part to say "quit" so you end up with this:
.line 54
invoke-direct {p0}, Lcom/zynga/words/game/AdActivity;->quit()V
17) Save and close that smali file. You just stopped the large full page ad from displaying after every turn you take.
18) Navigate to /com/zynga/words/menu
19) double click "GameListActivity" to open that smali file
20) ctrl + f and type "onStop". This should take you to a public method named onStop
21) copy the entire contents of this method except for the first and last line, so you should copy this:
.registers 1
.prologue
.line 294
invoke-super {p0}, Landroid/app/Activity;->onStop()V
.line 295
invoke-static {p0}, Lcom/flurry/android/FlurryAgent;->onEndSession(Landroid/content/Context;)V
.line 296
return-void
22) ctrl + f then type "refreshBanner". This should take you to a public method named "refreshBanner"
23) Paste the entire contents of "onStop" over top of the entire contents of "refreshBanner". This way you end up with a refreshBanner method that looks like this:
.method public refreshBanner()V
.registers 1
.prologue
.line 294
invoke-super {p0}, Landroid/app/Activity;->onStop()V
.line 295
invoke-static {p0}, Lcom/flurry/android/FlurryAgent;->onEndSession(Landroid/content/Context;)V
.line 296
return-void
.end method
24) Save and exit. You have just taken the code that will fetch banner ads, and replaced it with code that closes the "news" bar at the top of the main page.
NOTE: The code you put in the "refreshBanner" method basically just sets the news bar to not be visible. So, this means that anytime the game is trying to load a banner ad, it will really be closing the news bar (even if its already closed, it will just do nothing at all). This means that, when the game is trying to load a banner ad, the news bar wont work for that short period of time. But the news bar will work any other time the game is not trying to display a banner ad.
For those of you who dont know, the news bar is just a small button you hit named "news" and it tells you useless crap like "Welcome to words with friends!" or "We released an update!" Anyways, back to the tut...
25) Go back to your smali folder, where you should have your "out" folder (or whatever you called it) that contains ALL of the smali files including the 2 that you just edited.
26) In your command prompt, use the following to recompile your smali files into a dex file
Recompile:
java -Xmx512M -jar smali-1.2.6.jar <output directory from above step> -o <name for new .dex output file>
For example: java -Xmx512M -jar smali-1.2.6.jar out -o classes.dex
HINT: You can actually leave the "-o classes.dex" off the end, and it will default to classes.dex
27) Open your words with friends apk with 7zip
28) delete the current classes.dex that is in there
29) drag and drop your new classes.dex that you just compiled into 7zip in the same place you deleted the old one. Click "yes" when 7zip asks you to update the archive. Once the archive is updated with your new classes.dex, close 7-zip.
30) If you left your app in your dropbox, then it will automatically sync. If you were doing this outside of your dropbox, then copy your app into your dropbox now
31) On your phone, go to your dropbox, find your new app and long press it. Then press download and wait for it to finish downloading.
32) Open your ZipSigner app on your phone, and press the "Choose In/Out" button. Navigate to /sdcard/dropbox/ and find your new word with friends app and select it.
33) Leave the signature as "auto-testkey" and press "sign the file"
34) Once the app is done being signed, open Uninstaller, and uninstall your current words with friends app
35) Open RootExplorer and navigate to /sdcard/dropbox and find your new words with friends app that you just signed. It will have "signed" in its name
36) Select it and install it, you now have a completely ad free game!!!
Kang'ed from hetoan2.com
use adfree app on your rooted phone and update the host files.I'm using it and it works perfectly.(on p500)
Also, if the app does not load with the ad block hosts file installed, you can install droidwall and block that app from using the internet.
Here's how to add the minimize button to your floating multiwindows. Thanks to dwitherell for pointing me in the right direction.
WARNING: This will involve modifying a system file on your phone, if done incorrectly, will cause a bootloop. Proceed with caution! This is written from a Windows perspective, but the same can be done for Linux systems.
1) Copy the android.policy.jar from your system into a directory on your system.
2) Open it using a zip program (e.g. winrar) and extract the classes.dex file.
3) Extract using baksmali. Follow up to step #5 from this site: (thanks to adrynalyne) You will need all of the utilities listed there. For this example I used, apktool.bat, apktool.jar, smali.jar and baksmali.jar (renamed from the originals).
http://adrynalyne-teachtofish.blogspot.com/2011/11/how-to-decompile-and-recompile-jar.html
4) Go into the following newly created directory: out\com\android\internal\policy\impl\multiwindow and open the MultiPhoneWindowEvent.smali into a text file editor (Preferably notepad++ if on Windows).
NOTE: If there is no multiwindow folder, then it could be that its in a separate jar file.
5) Find the following lines in the file:
Code:
.line 105
iput-boolean v9, p0, Lcom/android/internal/policy/impl/multiwindow/MultiPhoneWindowEvent;->ENABLED_MINIMIZED_BUTTON:Z
.line 106
iput-boolean v9, p0, Lcom/android/internal/policy/impl/multiwindow/MultiPhoneWindowEvent;->ENABLED_ACTION_BAR_DOUBLE_TAPPING:Z
6) Change the v9 to v8. That will enable the value. Now it should say:
Code:
.line 105
iput-boolean v8, p0, Lcom/android/internal/policy/impl/multiwindow/MultiPhoneWindowEvent;->ENABLED_MINIMIZED_BUTTON:Z
.line 106
iput-boolean v8, p0, Lcom/android/internal/policy/impl/multiwindow/MultiPhoneWindowEvent;->ENABLED_ACTION_BAR_DOUBLE_TAPPING:Z
7) Save the file, and now we have to pack it back together. Run this line in a command line:
Code:
java -Xmx512M –jar smali.jar dex –o classes.dex
8) Do you have that android.policy.jar file open? Delete the classes.dex from it and add the new one you just created. After you save it, make sure the file is still called "android.policy.jar". No zip extensions.
9) Before we add it back to your phone, we need to sign it. NOT SIGNING WILL CAUSE A BOOTLOOP. For that we use the same method for signing apks. You can find that info here: http://forum.xda-developers.com/showthread.php?t=2195680 Run the following:
Code:
java -jar SignApk.jar testkey.x509.pem testkey.pk8 android.policy.jar (or whatever named you called it) android.policy.jar.signed ( can be whatever name you give to your jar )
When its all done, you want to have android.policy.jar that's close to the same size as the original file you pulled from your phone.
10) Moment of truth: Now we are set to replace the file. Make sure you a do a nandroid or copy the android.policy.jar file to a different name so you can go back and restore it if something went wrong during this process. Copy the new file to an sdcard or internal memory and boot to recovery. Connect via adb shell on your computer and copy the file to /system/framework.
Code:
adb shell
#cp /sdcard (or wherever it is) /system/framework/
Set the permissions to rw-r-r and the owner to root.
Code:
#chmod 644 /system/framework/android.policy.jar
Code:
#chown root:root /system/framework/android.policy.jar
Or you could always put the file in an update.zip and flash it in recovery. Both methods work, however you feel comfortable in doing it.
Then reboot! Once its booting you should notice the message "Android is updating your applications" That is normal. Once everything finishes loading, your floating windows should have the minimize button present. Also, double tapping the minimized window will bring it up in full screen.
Nice looks good
That's awesome though it sails right over my head.
I'm guessing you do this on a pc.
I'll have to study this post closely to get it. Expecting a ROM update soon so probably do it after.
A video might be easier to understand if anyone wants to make one.
Sent from my Jedi Master Note 2
Yea me too. A bit much for a flasher like me. Althiugh I want to learn and im gonna give this a shot after I read for a couple days and gather all the info needed. Thanks a lot for this.
Sent from my SCH-I605 using Xparent Skyblue Tapatalk 2
sshafranko said:
Yea me too. A bit much for a flasher like me. Althiugh I want to learn and im gonna give this a shot after I read for a couple days and gather all the info needed. Thanks a lot for this.
Sent from my SCH-I605 using Xparent Skyblue Tapatalk 2
Click to expand...
Click to collapse
It does sound like a lot I agree. Just take it one step at a time and then you realize you're just:
1) Editing 2 characters in a text file
2) Packaging it back up in a .dex file
3) Replacing it in a zip.
4) Sign it like a system apk file
Kinda like theming if you think about it. Just gather all the tools and make backups of everything. The worst thing that could happen, (and I've done it) is that file is invalid and you have to pull the battery and reboot to recovery to replace it back.
Hi all,
is there a way to disable FLAG_SECURE on Nougat?
Before update from Android 6 I used Xposed module to do that, but I need a way to disable it on Nougat untill Xposed will be relised.
Thanks for attention
I need the answer aswell
I'm looking for the same thing, everything I tried so far didn't work.
Even with Root it seems to be quite hard to overcome this FLAG_SECUE.
Only way to allow taking screenshots and record video with apps that have FLAG_SECURE in Android 7.0+ (Nougat) is to modify and remove LayoutParams.FLAG_SECURE instances, and recompile the apk to remove the restraint. I don't think FLAG_SECURE can be globally disabled in Nougat yet.
Resources:
https://commonsware.com/blog/2016/06/06/psa-flag-secure-window-leaks.html
https://commonsware.com/blog/2012/01/16/secure-against-screenshots.html
https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html
https://github.com/appium/android-a...um/android/apis/app/SecureWindowActivity.java
https://reverseengineering.stackexc...repackaging-apk-file-using-baksmali-and-smali
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
edzamber said:
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
Click to expand...
Click to collapse
Very Nice!
Does services.jar belongs to target apk Itself??
Ive tried to decompile a specific apk to Disable flag secure on it (not global), but i Cant find any file to edit those strings you mentioned.
Do you have any idea on where can i find them?
renganyen said:
Very Nice!
Does services.jar belongs to target apk Itself??
Ive tried to decompile a specific apk to Disable flag secure on it (not global), but i Cant find any file to edit those strings you mentioned.
Do you have any idea on where can i find them?
Click to expand...
Click to collapse
I found it at /system/framework/services.jar
However, I don't see the targeted location in mine. Just classes.dex and MANIFEST.MF
edzamber said:
Ok guys, i found the solution !!!
Thanks to @fOmey for your help to find in witch file and smali i needed to look [emoji6]
Here we go :
services.jar/smali/com/android/server/wm/WindowManagerSmali
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
Replace complete method by this :
Code:
.method isSecureLocked(Lcom/android/server/wm/WindowState;)Z
.locals 4
const/4 v0, 0x0
return v0
.end method
That's it.
Click to expand...
Click to collapse
there will be some way to do it with a patch like lcpatch?
Kayjay0x said:
I found it at /system/framework/services.jar
However, I don't see the targeted location in mine. Just classes.dex and MANIFEST.MF
Click to expand...
Click to collapse
Deodex Services.jar first kid?
Anyone have a way to do this in Android 9.0 PIE for S9+ ?
bobfrantic said:
Anyone have a way to do this in Android 9.0 PIE for S9+ ?
Click to expand...
Click to collapse
Hi
This working also on S9 Pie services.jar
https://forum.xda-developers.com/showthread.php?p=73802410
edzamber said:
Hi
This working also on S9 Pie services.jar
https://forum.xda-developers.com/showthread.php?p=73802410
Click to expand...
Click to collapse
Thanks for the response but just a slight bit of confusion. Inside my Services.jar it is empty other than the META-INF folder. See screenshot. where is classes.dex? lol
Wait, now I remember, I need to deodex the file(s) in framework. Any recomendation on a program to deodex pie by chance?
bobfrantic said:
Thanks for the response but just a slight bit of confusion. Inside my Services.jar it is empty other than the META-INF folder. See screenshot. where is classes.dex? lol
View attachment 4711282
Wait, now I remember, I need to deodex the file(s) in framework. Any recomendation on a program to deodex pie by chance?
Click to expand...
Click to collapse
I use SuperR Kitchen paid but this tool working as well
https://forum.xda-developers.com/android/general/toad-source-android-deodexer-t3848307
edzamber said:
I use SuperR Kitchen paid but this tool working as well
https://forum.xda-developers.com/android/general/toad-source-android-deodexer-t3848307
Click to expand...
Click to collapse
Thanks, I had discovered that program and yes it deodexed the framework ok. I extrated classes.dex and tried to baksmali it to get the file but got error. Using latest versions from jesusfreke so trying to figure that out now lol. This stuff was so much easier way back with s advance days.
bobfrantic said:
Thanks, I had discovered that program and yes it deodexed the framework ok. I extrated classes.dex and tried to baksmali it to get the file but got error. Using latest versions from jesusfreke so trying to figure that out now lol. This stuff was so much easier way back with s advance days.
Click to expand...
Click to collapse
What error do you have ?
edzamber said:
What error do you have ?
Click to expand...
Click to collapse
This is the error when trying to decompile the classes.dex
C:\android\java>java -jar baksmali.jar -o classout/ classes.dex
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -o
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
C:\android\java>
bobfrantic said:
This is the error when trying to decompile the classes.dex
C:\android\java>java -jar baksmali.jar -o classout/ classes.dex
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -o
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
C:\android\java>
Click to expand...
Click to collapse
Use last TMA (tickle my android) to decompil/recompil
edzamber said:
Use last TMA (tickle my android) to decompil/recompil
Click to expand...
Click to collapse
Ok, will give it a try, thanks..
Edit:
SUCCESS!! Thanks very much.
help
Hi, could some kind soul post a step by step instructions how to do this? I am trying to disable FLAG_SECURE on AVD emulator (running on Ubuntu 18.04)
I tried adb pull /system/framework/services.jar but I only got a file which is 316 bytes, and not sure what should I do with that file after that anyway.
Thanks!
Hi All.
For all the inexperienced users/beginners, there are a few ways to achieve this:
1) https://forum.xda-developers.com/apps/magisk/module-smali-patcher-0-7-t3680053 - Secure flag - Allow screenshots/screensharing in secure apps.
2) https://github.com/veeti/DisableFlagSecure - Disable flag secure system wide using Xposed Framework.
3) Post 8 in this thread (https://forum.xda-developers.com/showpost.php?p=75323166&postcount=8)
Let me know how you get on Android family. Peace!