Firstly I am by no means an expert and am just trying to share what i have learnt about smali as its hard to find much info about general smali. Contributions to the thread are always welcome
For the last year or so I have been developing AllianceROM on the i9100. During this time I have learnt lots about smali through a combination of trial and error and guides I have found here on XDA. The guides are great but one thing that stands out is that they all follow the same pattern of “Find a certain line in a certain file and copy/paste" to replace methods or chunks of code for the desired outcome. Whilst this is a great means to an end it is only a means to that particular end. Most people wont actually understand what they are doing or how it works and will blindly do as instructed.
So I thought that I would try to write some general guides. The aim is to give you the means to dream up your own mods and know how to go about implementing them from scratch by yourself. I am by no means an expert but hopefully there should be enough here to set you on your way. These are the methods I used to create many of the mods in alliance, lots of which didn’t exist on Touchwiz devices before.
You will need certain tools to do this but I am not going into how to decompile etc. Before attempting this you should have a good knowledge of decompiling apks and modding in general and have the following tools available:
ADB
Notepad ++
A good image editor like Photoshop or GIMP
The guides are in 3 sections:
Coloring stuff with color pickers
Toggling stuff to show or hide
List choices for things like toggles in view etc
For the purposes of these guides I am using an apk from our legendary alliance developer ficeto. He has made this app to enable us to easily add color pickers, checkboxes and lists by adding a single line to an xml. Huge huge thanks to him as he made this a lot easier!! You can use this to test your mods but please dont rename everything from ficeto to "ubermodders" or something and try to pass it off as your own. If you do it will be reported It is to be used as is, not changed or renamed (this causes problems for people installing alliamceMOD) and dont forget to credit ficeto!!
Please feel free to ask general smali questions here too!
So lets get started!!
Coloring Stuff:
Text Colors
There is a ton of stuff in alliance that can be colored, from text to images or backgrounds. Text works by using the setTextColor method and images and backgrounds use setColorFilter to lay a color over the top of an image ot setBackgroundColor to fill the entire background. I will cover one of each in this section starting with text color. The 3 methods use similar code and text color is the easiest to start with.
So….you decide you want to change the color of some text using a picker. For this example I will use the dropdown date. Where do you start? As you probably know dropdown stuff is dealt with by SystemUI.apk. When you decompile that you are faced with a ton of smali files. The best way to start is to use a handy function in Notepad++ called “Find in Files” which will search for certain text within files. Funnily enough its under the Search menu at the top!!
In this case the first port of call would be to search for the obvious word “date”. This returns a ton of results and you should see an obvious file called DateView.smali. If your search doesn’t return much for your specific choice of text then you have a couple of options:
1) look in the layout xml and find the id for the view you want to change. Look the id up in public.xml and then search that using “Find in Files” again. If you are unsure of the text view id then use hierarchy viewer from the tools folder of the sdk which will show you all the views on your screen
2) look through the smali files manually for anything that sounds like it might contain your target
So you think you found the right smali. Open it and search for “setText(Ljava/lang/CharSequenceV”. This will hopefully return a line something like this:
invoke-virtual {p0, v5}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequenceV
Scroll up until you see the name of the method. This should give you a good idea if you have the right text. In this case that line was in .method private final updateClock()V which sounds about right!
What this line is doing is calling settext with the parameter Ljava/lang/CharSequence which is the date string. Invoke virtual calls the method and the bit in the brackets {p0, v5} is the date view (p0 means “this file”) and the string (v5). The v is a register. Registers are used to store things. A few lines up in the method you will see something similar to this:
invoke-virtual {v0, v9, v5}, Landroid/content/Context;->getString(I[Ljava/lang/ObjectLjava/lang/String;
move-result-object v5
What that is doing is using getString to get the date and moving it into the register v5. This v5 is then used in our setText call.
So now we have identified our text view in the smali we can use setTextColor to change its color.
A bit of background is useful here. Color pickers do not act directly on any smali. Your phone has a database where it stores its settings. It is located in data/data/com.android.providers.settings/databases/settings.db. You can open it with Root Explorer and take a look. You will see a standard database with entries and values. What color picker code does is put an entry in this database with a “key” and a hex code. The smali then uses this key to look up the hex color it needs to set.
Now we need to add some code to look up that entry and return the color to the smali. There are 3 elements to this:
The ContentResolver
This is used to resolve the entry in the database. In order to use the content resolver we must put it into a register as we mentioned earlier. At the top of the method you will see .locals X where X is a number. This is the number of registers used in the method. So if it says .locals 5 there will be v0,v1,v2,v3 and v4. We need to add 3 to this value as we will be using 3 new registers. One for the resolver, one for the default color (in case there is no entry in the database it needs to have a color to set) and one for the key.
Now we need context in order to get the content resolver. There are a few ways to do this. A lot of files have a field called mContext. This can be used directly like this:
iget-object v5, p0, Lcom/android/systemui/statusbar/policy/BrightnessController;->mContext:Landroid/content/Context;
This is using iget-object to put mContext into v5. As mentioned earlier the p0 mean “this”.
The v5 should be the first of the new registers you added. So if previously .locals was 5 and you changed it to 8 then this would be v5 as v0 to v4 already exist. You can reuse registers but you can run into problems if it is needed further through the code so it is advisable to add new.
Alternatively, smali files whose .super is a view (look at the top of the smali for .super) like the date view we are working with here can use getcontext to get context like this:
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/DateView;->getContext()Landroid/content/Context;
move-result-object v5
Now we have context we can use it to get the content resolver and put it into the register using this line:
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
The Key
Next we need the key that we want to look up in the database. This is as simple as :
const-string v6, "date_color"
This just puts the constant string “date_color” into v6. The text inside the “” can be anything you like but cannot have spaces and the key must match the picker key we will add later.
The Default Value
Next we need a default color for in case there is no entry in the database. For example on a fresh install or after a wipe. The value is hex but in reverse preceded with -0x so ICS blue 33b5e5 becomes -0xcc4a1a because 0 = F, 1 = E, 2 = D etc
0 = F
1 = E
2 = D
3 = C
4 = B
5 = A
6 = 9
7 = 8
8 = 7
9 = 6
A = 5
B = 4
C = 3
D = 2
E = 1
F = 0
We put that into our 3rd new register v7 using:
const v7, -0xcc4a1a
Now we have all the needed elements we can use them to return the color to the smali from the database using:
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
This uses the getInt method with our parameters. I have colored them so you can see how the registers relate to the getInt method. V5 is the content resolver, v6 is the string and v7 is the integer of the color.
The resultant color from the database is then moved into v5. We can use v5 register again as we no longer need the content resolver.
The color from the database is now stored in v5. From the settext line we found earlier we can see that the text view is referred to as p0:
invoke-virtual {p0, v5}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequenceV
The first item in the brackets is the text view. This wont be p0 in all cases. Its only p0 here because we are working with a smali that has a view as its super so the smali is effectively the text view. If working with something like ToggleSlider for example we may have something like:
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequenceV
So in this case the text view is in v2.
We can now use setTextColor on our date which is p0 with the color which we put in v5:
invoke-virtual {p0, v5}, Lcom/android/systemui/statusbar/policy/DateView;->setTextColor(I)V
The full code looks like this:
invoke-virtual {p0, v3}, Lcom/android/systemui/statusbar/policy/DateView;->setText(Ljava/lang/CharSequenceV
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/DateView;->getContext()Landroid/content/Context;
move-result-object v5
invoke-virtual {v5}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "date_color"
const v7, -0xcc4a1a
invoke-static {v5, v6, v7}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v5
invoke-virtual {p0, v5}, Lcom/android/systemui/statusbar/policy/DateView;->setTextColor(I)V
Oh and just so you know the big V at the end of lines like ;->setText(Ljava/lang/CharSequenceV and ;->setTextColor(I)V means the method returns void or nothing.
Hopefully the apk will now compile and you can test the result. In order for something to change immediately you need observers but I wont go into that here. This will only change when the updateClock method runs. A reboot will also trigger it to update the color.
I know I have written a lot to take in here. But hopefully this will give you a good basic understanding of how methods are called with parameters in smali.
Next stop…..choosing the color!
Thanks to ficeto this part is REALLY easy!
Decompile the attached apk. You will find a file called preferences.xml in the xml folder. Open it with Notepad++. Each instance of this line will add another picker…
<com.ficeto.colorpicker.ColorPickerPreference android:title="Dropdown Date Color" android:key="date_color" android:summary="Select Color" android:dialogTitle="Select Color" />
Change the android:title to what you want your picker to be called and change android:key=“date_color” to whatever the key you used earlier was. So if your smali was....
const-string v6, "clock_color"
Then the android:key would be “clock_color”.
That’s it. Compile and push the apk or install as a system app and it will show in your app drawer as custom settings. Now go test your new mod!!
Any questions or problems please ask (with logs and files if possible) as its impossible to cover all eventualities in a guide.
OK....time for part 2
COLORING IMAGES
This part will cover two things. Coloring images in a similar way to setting text colors from part 1 and also how to create a method and pass it context. Sometimes you wont be able to use mContext or getcontext but most smali files have context already in their init so you can use that and pass it to a new method. Using your own method is more efficient as you can run your code to get the color from the database just once and use it on multiple items and in multiple places.
There are three main ways to color an image. Using the method setColorFilter(I)V which is in android/widget/ImageView smali in framework2.jar, using method public final setColorFilter(ILandroid/graphics/PorterDuff$ModeV in the same file and using method public setColorFilter(ILandroid/graphics/PorterDuff$ModeV in android/graphics/drawable/Drawable smali in framework.jar. It depends what and where the image is as to which you use. All three methods overlay a color on an existing image and the two with porterduffmode have a means of choosing what effect the overlay has. There is more about this at the bottom of the post.
Lets start....
Things are stored in fields in a smali. At the top of the file you will see them like this:
Code:
.field protected mType:Ljava/lang/String;
.field protected mView:Landroid/view/View;
.field protected mIcon:I
These fields can be used to store things of their type. So in the ones shown above you would put a string, a view and an integer respectively. You can see the type a field should hold after the :
In order to use your own method to get the color from the database we need to add a new field to store the value in so we can use it in another method. For this example i am going to use the toggle icons in lidroids toggle mod but this can be done on pretty much any image you want.
At the top of the smali with the other instance fields add your new field. You can call it whatever you want and it is going to store an integer so you will need an I after the colon. Im calling this one mToggleColor for obvious reasons:
Code:
.field private mToggleColor:I
We now have somewhere to put our value so now we can write the new method. At this point you should refer to the text color guide for explanations about the content resolver, context and registers as I will assume you have an idea about these now.
You can call your method anything you want. It will need 3 registers to store the resolver, default value and integer. This method has no context parameter (in the brackets after the method name) so you would need to use getcontext or mContext....
Code:
.method color_toggles()V
.locals 3
If you are going to use existing context and pass it to your method it would look like this. As you can see the method is expecting context as its parameter when called...
Code:
.method color_toggles(Landroid/content/Context;)V
.locals 3
Now we get the content resolver so we need context. If using the first method then you would need to call your view and invoke getcontext like this in stock toggles:
Code:
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mBtnImage:Landroid/widget/ImageView;
invoke-virtual {v1}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
As metioned in the text color guide your contentresolver is now in v1.
If you are passing context to your method then the context is the parameter of the method. Each item in brackets after methods name is stored in a p. So in this case the context would be in p1. All you need to do is use it to get the resolver:
Code:
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
Again...resolver now in v1.
The next part is identical to the text color guide so i wont repeat it. But you should have now something that looks like this:
Code:
.method color_toggles()V
.locals 3
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mBtnImage:Landroid/widget/ImageView;
invoke-virtual {v1}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object v1
const-string v2, "theme_color"
const v3, -0x4d06ff
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
or if passing context:
Code:
.method color_toggles(Landroid/content/Context;)V
.locals 3
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "theme_color"
const v3, -0xcc4a1a
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
Both of the above now have your color stored in v1. We can now put it into your new field that you created earlier using iput:
Code:
iput v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mToggleColor:I
This puts the integer in v1 into the field in p0 (this file) and stores it as mToggleColor
Your method is not expected to return anything meaning something doesnt call it and ask for a value in reply so after this we need:
Code:
return-void
....and then to finish the method....
Code:
.end method
The final methods look like this:
Code:
.method color_toggles()V
.locals 3
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mBtnImage:Landroid/widget/ImageView;
invoke-virtual {v1}, Landroid/widget/ImageView;->getContext()Landroid/content/Context;
move-result-object v1
const-string v2, "theme_color"
const v3, -0x4d06ff
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
iput v1, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->mToggleColor:I
return-void
.end method
Code:
.method color_toggles(Landroid/content/Context;)V
.locals 3
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "theme_color"
const v3, -0xcc4a1a
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
iput v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mColor:I
return-void
.end method
Now your color can be put into your new field we need to invoke your new method. Otherwise it will just be an empty field. You can do this in a number of places. Either directly before you use it or in the methods init. We will come back to this.
In order to color an image you need to find it first. There are ways of calling the image by its id but looking for it this way will familiarise you more with smali. Images can be set using setImageResource and setImageDrawable. If you search firstly for the images id in the smalis to find the correct file and if that doesnt find anything then have a look at file names and see what you can find that looks like it might be right. In this case PowerButton smali has a method called :
Code:
.method private updateImageView(II)V
...which uses setImageResource(I)V. Sounds like a good place to start!
Code:
.method private updateImageView(II)V
.locals 2
iget-object v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v1, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
invoke-virtual {v0, p2}, Landroid/widget/ImageView;->setImageResource(I)V
return-void
.end method
We need to invoke your new method. If you are not passing context you can just do this:
Code:
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->color_toggles()V
...which will invoke your new method and put your color in your field.
Or to pass context you would do:
Code:
invoke-virtual {v1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {p0, v1}, Lcom/alliance/systemui/quickpanel/PowerButton;->color_toggles(Landroid/content/Context;)V
In the above code the method you are in has a Landroid/view/View; stored in v1. You can use getContext on this and then invoke your method. The invoke says to call your method color_toggles(Landroid/content/ContextV which is in this file (p0) with the parameter v1 (the context). Now your method has run we can use iget to get the color from the field:
Code:
iget v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mColor:I
You can see in the original updateImage method that the imageView is in v0. We can now apply the color (in v1) to the image (v0).
Code:
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setColorFilter(I)V
Final methods would look like this:
Code:
.method private updateImageView(II)V
.locals 2
invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->color_toggles()V
iget-object v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v1, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
invoke-virtual {v0, p2}, Landroid/widget/ImageView;->setImageResource(I)V
iget v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mColor:I
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setColorFilter(I)V
return-void
.end method
or
Code:
.method private updateImageView(II)V
.locals 2
iget-object v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v1, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
invoke-virtual {v0, p2}, Landroid/widget/ImageView;->setImageResource(I)V
invoke-virtual {v1}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v1
invoke-virtual {p0, v1}, Lcom/alliance/systemui/quickpanel/PowerButton;->color_toggles(Landroid/content/Context;)V
iget v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mColor:I
invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setColorFilter(I)V
return-void
.end method
Your source image should be white. You can make them semi transparent so the color is not as bright. For example the off toggles could be 50% transparent so they will only appear dim compared to the on ones.
You will notice in PowerButton smali there is another method....
Code:
.method private updateImageView(ILandroid/graphics/drawable/Drawable;)V
.locals 2
iget-object v1, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v1, p1}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Landroid/widget/ImageView;
invoke-virtual {v0, p2}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V
return-void
.end method
This is the same except it uses 2 parameters (in the brackets after the name) of and (I)nteger and Landroid/graphics/drawable/Drawable rather than two (I)ntegers.
You don't HAVE to use your own method. You could just use identical code to the textColor code straight after the setImageResource and invoke setColorFilter on the ImageView rather than setTextColor on a TextView. But I think it is good practice to use a new method
PorterDuffMode
Sometimes when you implement a color picker you will get an outcome you dont want like a battery that had a a white centre and the fill in a color wouldnt show the level as it would all have the same color overlay. Instead of using setColorFilter(I)V you can use setColorFilter(ILandroid/graphics/PorterDuff$ModeV.
If you are familiar with Photoshop you may be better than me at this but basically it changes the way the color is laid over. Using different modes will give different results. As Im not great with Photoshop for me its more trial and error!
There are lots of different modes:
PorterDuff.Mode ADD Saturate(S + D)
PorterDuff.Mode CLEAR [0, 0]
PorterDuff.Mode DARKEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)]
PorterDuff.Mode DST [Da, Dc]
PorterDuff.Mode DST_ATOP [Sa, Sa * Dc + Sc * (1 - Da)]
PorterDuff.Mode DST_IN [Sa * Da, Sa * Dc]
PorterDuff.Mode DST_OUT [Da * (1 - Sa), Dc * (1 - Sa)]
PorterDuff.Mode DST_OVER [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc]
PorterDuff.Mode LIGHTEN [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)]
PorterDuff.Mode MULTIPLY [Sa * Da, Sc * Dc]
PorterDuff.Mode OVERLAY
PorterDuff.Mode SCREEN [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc]
PorterDuff.Mode SRC [Sa, Sc]
PorterDuff.Mode SRC_ATOP [Da, Sc * Da + (1 - Sa) * Dc]
PorterDuff.Mode SRC_IN [Sa * Da, Sc * Da]
PorterDuff.Mode SRC_OUT [Sa * (1 - Da), Sc * (1 - Da)]
PorterDuff.Mode SRC_OVER [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc]
PorterDuff.Mode XOR [Sa + Da - 2 * Sa * Da, Sc * (1 - Da) + (1 - Sa) * Dc]
The letters in CAPITALS are the what you put as the parameter.
I have found that MULTIPLY is the most useful. SRC_ATOP is used as default in setColorFilter(I)V
To use one you need to put the mode into a register. You do that using sget:
Code:
sget-object v1, Landroid/graphics/PorterDuff$Mode;->MULTIPLY:Landroid/graphics/PorterDuff$Mode;
Then you call the porterduff setcolorfilter method instead of the normal one. Like this:
invoke-virtual {v6, v12, v1}, Landroid/widget/ImageView;->setColorFilter(ILandroid/graphics/PorterDuff$ModeV
...instead of this:
invoke-virtual {v6, v12}, Landroid/widget/ImageView;->setColorFilter(I)V
There is a good article here
Please ask if anything is unclear.
Toggles
You have learnt how to get a value from the database creating a toggle is pretty straightforward. For this example I will use toggling the text on lidroid toggles but you can use this on anything from settings button in statusbar to things stopping auto scroll on toggles etc.
Again we start by finiding the method we need to mod. Look at the top of smali files for the field names. This may help you to find the item you wish to toggle. Method names will also help you find your place. In this example we can see in PowerButton smali there is a method called:
Code:
.method protected updateText()V
Obvious huh! It wont always be that easy to find so i will cover how to call something by it's ID later in this post.
In this method you can see that the text is set by calling the setText method. There are two ways to do this. The obvious thing to do is not to run this line so the text will not be set. This is the first way i will cover and it is the way that things are toggled such as ink effect or crt etc rather than showing/hiding things. I will get to that later.
TURNING THINGS ON/OFF
We need to read that value into our smali. This is done in exactly the same way as a color so if you are not sure please go back and read those posts.
This would be added the line before the setText call....
Code:
iget-object v3, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v3
...dont forget to add to .locals if you are using a new register!! That gets us context so now we can...
Code:
const-string v4, "toggle_text"
const v5, 0x1
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
...which gets the value from the database which will be 1 or 0 for on/off and puts it into v3.
To toggle something we then act on that value. The if-eqz checks if a value is zero. So the next line would be:
Code:
if-eqz v3, :cond_skip_text
....as you can see, if v3 is zero then it goes to the condition skip_text.
All we need to do now is make a new cond called skip_text after the setText line so it effectively does just that.....skips the setText. Right before return-void put:
Code:
:cond_skip_text
That's it. All you have to do with a toggle to turn something on or off is skip the chunk of text that does what you want to stop. So as long as your new cond comes after it then it should work
SHOWING/HIDING
This works in exactly the same way as above but instead of skipping code you are going to use setVisibility(I)V method.
We have got the value from the database as we did before:
Code:
iget-object v3, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v3
const-string v4, "toggle_text"
const v5, 0x1
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_show_text
To hide something we must set visibility of the item to "gone". The value for this is 0x8. Visible is 0x1. If the database value returns 0 then the item is unchecked and so should be hidden. If it returns 1 then the item should be visible.
If the value from the database was 1 and the checkbox was ticked then you can use the value in v3 as the value for setVisibility. If it was 0 then the value needs to be set to 0x8 for "gone". We can put 0x8 into v4 here because the line will be skipped if the checkbox was checked:
Code:
const v3, 0x8
....now we add the new cond:
Code:
:cond_show_text
and invoke the set visibility which now has either 0x1 or 0x8 in it.
Code:
invoke-virtual {v1, v3}, Landroid/widget/TextView;->setVisibility(I)V
This tells the code to find the place labelled :goto_new so we add that straight after the code that sets visibility to shown. The full code would look like this....
Code:
iget-object v3, p0, Lcom/alliance/systemui/quickpanel/PowerButton;->mView:Landroid/view/View;
invoke-virtual {v3}, Landroid/view/View;->getContext()Landroid/content/Context;
move-result-object v3
const-string v4, "toggle_text"
const v5, 0x1
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_show_text
const v4, 0x8
:cond_show_text
invoke-virtual {v1, v4}, Landroid/widget/TextView;->setVisibility(I)V
Thats it!
CALLING THINGS BY ID
Say you wanted to make a show/hide for the recents button that can be added to dropdown header. You can call it by it's public ID and then use setvisibility. Create a new method like you did for coloring images (refer to that guide if unsure), get a value from the database, test for non-zero and skip to cond. You can use mCcontext here from in Phonestatusbar:
Code:
.method Update_recents()V
.locals 6
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "recents_button"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_1
const v3, 0x8
Now to get the image we can use findViewById method. In order to use it we need the parent view that contains the image. In Phonestatusbar you can get to most stuff by using the field mStatusBarWindow.
Code:
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
Now we get the id of the image from public.xml and put it into a register:
Code:
const v5, 0x7f0d0014
....and then findViewById. This method expects an integer as a parameter which we have in v5...
Code:
invoke-virtual {v4, v5}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v4
Now we have the item we can setVisibility with the value in v3:
Code:
:cond_1
invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V
In this case I used LinearLayout but you can use imageView or whatever depending what you are doing. The full method would look like this:
Code:
.method Update_recents()V
.locals 6
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "recents_button"
const/4 v3, 0x1
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
if-nez v3, :cond_1
const/4 v3, 0x8
:cond_1
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarWindow:Lcom/android/systemui/statusbar/phone/StatusBarWindowView;
const v6, 0x7f0d0014
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/StatusBarWindowView;->findViewById(I)Landroid/view/View;
move-result-object v4
invoke-virtual {v4, v3}, Landroid/widget/LinearLayout;->setVisibility(I)V
return-void
.end method
All we need to do now is to call the method. The best place for this is during makestatusbarview. I put it right after the settings button is set but you can put it in loads of places. It just invokes update_recents_button in p0 (this file):
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButton:Landroid/widget/ImageView;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSettingsButtonListener:Landroid/view/View$OnClickListener;
invoke-virtual {v9, v10}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
[COLOR="Red"] invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->update_recents_button()V[/COLOR]
Thats all for now
USEFUL POSTS:
NOTEPAD++ SMALI HIGHLIGHTING - Thanks to @majdinj
LIST OF DALVIK OPCODES - Thanks to @majdinj
last one
one more actually
Goldie you are the best. Thanks. :victory:
finally, you're the grand master
thank you
Hope my ramblings make sense!
Very good. Thanks for all your hard work
What a fantastic guide. Top work Goldieking
Sent from my PurifieD S4
Finally !!
Was thinking you had abandoned the project
Now the challenge is on for who can make the first one thats not dropdown date
Sent from my GT-I9305 using Tapatalk
Sorry buddy for no feedback on your fantastic guide, I got busy with ither stuffs.
But I must say hey you reveal the secreat of samsuck and your hard work with us.
trying to work with smali
Hi Goldieking I'm trying to modify my SecSettings.apk trying to make a mod for toggle
In Settings/display i'm trying to add a ListPreference to show something like this
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
In my DisplaySetting.smali i've add this in red:
Code:
.field private mSmartRotationAnimationImage:[I
.field private mSmartStayAnimationImage:[I
.field mStatusbarColor:Lcom/loser/colorpicker/ColorPickerPreference;
.field mSupportFolderType:Z
[COLOR="Red"].field private mTogglesStyle:Landroid/preference/ListPreference;[/COLOR]
.field private mTouchKeyLight:Landroid/preference/ListPreference;
In the .method public onCreate(Landroid/os/Bundle)V i've add this
Code:
const-string v12, "battery_icon_list"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mBatteryStyle:Landroid/preference/ListPreference;
const-string v12, "battery_icon_list"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mBatteryStyle:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mBatteryStyle:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"] const-string v12, "toggles_icon_list"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mTogglesStyle:Landroid/preference/ListPreference;
const-string v12, "toggles_icon_list"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesStyle:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesStyle:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
And in the .method public onPreferenceChange i' ve add this:
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
[COLOR="Red"] if-eqz v0, :cond_13 [/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
move v0, v6
.line 1090
:goto_6
Code:
:cond_11
move-wide v0, v4
goto/16 :goto_3
:cond_12
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mBatteryStyle:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "battery_icon_list"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4
[COLOR="Red"][/COLOR] :cond_13
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mTogglesStyle:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_1
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_icon_list"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4 [/COLOR]
.end method
The logcat show this:
Code:
W/dalvikvm( 3982): VFY: register1 v0 type 5, wanted ref
W/dalvikvm( 3982): VFY: bad arg 1 (into Ljava/lang/Object;)
W/dalvikvm( 3982): VFY: rejecting call to Ljava/lang/String;.equals (Ljava/lang/Object;)Z
W/dalvikvm( 3982): VFY: rejecting opcode 0x6e at 0x0215
W/dalvikvm( 3982): VFY: rejected Lcom/android/settings/DisplaySettings;.onPreferenceChange (Landroid/preference/Preference;Ljava/lang/Object;)Z
W/dalvikvm( 3982): Verifier rejected class Lcom/android/settings/DisplaySettings;
W/dalvikvm( 3982): Class init failed in newInstance call (Lcom/android/settings/DisplaySettings;)
D/AndroidRuntime( 3982): Shutting down VM
W/dalvikvm( 3982): threadid=1: thread exiting with uncaught exception (group=0x41af32a0)
E/AndroidRuntime( 3982): FATAL EXCEPTION: main
E/AndroidRuntime( 3982): java.lang.VerifyError: com/android/settings/DisplaySettings
E/AndroidRuntime( 3982): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 3982): at java.lang.Class.newInstance(Class.java:1319)
E/AndroidRuntime( 3982): at android.app.Fragment.instantiate(Fragment.java:577)
E/AndroidRuntime( 3982): at android.preference.PreferenceActivity.switchToHeaderInner(PreferenceActivity.java:1229)
E/AndroidRuntime( 3982): at android.preference.PreferenceActivity.switchToHeader(PreferenceActivity.java:1245)
E/AndroidRuntime( 3982): at android.preference.PreferenceActivity.onCreate(PreferenceActivity.java:618)
E/AndroidRuntime( 3982): at com.android.settings.Settings.onCreate(Settings.java:191)
E/AndroidRuntime( 3982): at android.app.Activity.performCreate(Activity.java:5206)
E/AndroidRuntime( 3982): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
E/AndroidRuntime( 3982): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
E/AndroidRuntime( 3982): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
E/AndroidRuntime( 3982): at android.app.ActivityThread.access$700(ActivityThread.java:140)
E/AndroidRuntime( 3982): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
E/AndroidRuntime( 3982): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 3982): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 3982): at android.app.ActivityThread.main(ActivityThread.java:4921)
E/AndroidRuntime( 3982): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3982): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 3982): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
E/AndroidRuntime( 3982): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
E/AndroidRuntime( 3982): at dalvik.system.NativeStart.main(Native Method)
So i know i make errors in the .method public onPreferenceChange (Landroid/preference/Preference;Ljava/lang/ObjectZ
can you teach me how to add new lines to make it work?
Ummm.....I always use custom settings for a list which means I only gotta add a single line but in cond_d you have the same lines twice for contextualpage_settings where you move boolean result into v0 then use it as an object in the next lines. Are you sure you didnt change something there? Those four lines were already repeated?
Without looking at the file its difficult to tell but something looks wrong here...
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
[COLOR="Red"] if-eqz v0, :cond_13[/COLOR]
Sent from my GT-I9305 using Tapatalk
Goldieking said:
Ummm.....I always use custom settings for a list which means I only gotta add a single line but in cond_d you have the same lines twice for contextualpage_settings where you move boolean result into v0 then use it as an object in the next lines. Are you sure you didnt change something there? Those four lines were already repeated?
Without looking at the file its difficult to tell but something looks wrong here...
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
[COLOR="Red"] if-eqz v0, :cond_13[/COLOR]
Sent from my GT-I9305 using Tapatalk
Click to expand...
Click to collapse
I'm sorry you're right i've add this:
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
[COLOR="Red"] const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_13[/COLOR]
so i've to delete this lines?
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
edit:I tried to change the lines above whit those:
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
[COLOR="Red"] invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_13[/COLOR]
but it doesn't work again ,you try to look in my file
View attachment DisplaySettings.zip
This is a great guide.
Thanks very much, Goldie...
remuntada78 said:
I'm sorry you're right i've add this:
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
[COLOR="Red"] const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_13[/COLOR]
so i've to delete this lines?
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/ObjectZ
move-result v0
edit:I tried to change the lines above whit those:
Code:
:cond_d
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_12
[COLOR="Red"] invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_13[/COLOR]
but it doesn't work again ,you try to look in my file
View attachment 2340166
Click to expand...
Click to collapse
Hard on phone but try this...
https://db.tt/ocnydt7E
Sent from my GT-I9305 using Tapatalk
Related
I found tutorial optimization games HD for QVGA/HVGA.
Code:
http://4pda.ru/forum/index.php?showtopic=238460
I'm waiting for yours work.
reading kyrilic letters is a lil bit difficult
You try google translate
there in Russian will be the time I'll translate
ok, thanks
Recently, a lot of me in a personal message arrives with a question in about optimizing games for screens HVGA, QVGA. Since this question is relevant to many, I decided to write a short statement. Just want to warn you that every game has its own nuances and using the information described here will likely have to adjust it to suit your particular case, moreover, this statement is mostly true to the games from Gameloft. It is also very desirable to have programming skills, even if it is not under an android. In any case, I hope this statement will be helpful and will help to understand the approximate algorithm of actions. Android platform I started relatively recently, perhaps doing something not quite right / best, to it - the guru of the forum, please do not throw rotten tomatoes, and indicate an error, suggest a better option.
Let's start ...
Tools
We need the following programs:
1. Apk Manager (download here).
2. Any text editor (notepad will fit).
3. Ida Pro 5.5 (can be found in the internet, the tracker).
4. Any hex editor (I use UltraEdit).
Click to expand...
Click to collapse
Now let us think that the game is optimized for screen HVGA / QVGA?
It can be divided into several stages.
Key:
1. Changing the rendering resolution to HVGA / QVGA.
2. Adjustment grid touch screen.
Secondary:
3. How to disable the cache (necessary in order to be able to convert introductory video at lower resolution).
4. Assigning a hardware button on any action (required for phones without multitouch).
Before proceeding to any stage of optimization, we need to get to the source code, the original source code, we certainly do not get, but we can get a JAVA-byte code, which is quite to our problem would be enough. For this purpose, we use "Apk Manager".
Install and use a "Apk Manager".
The setup is nothing complicated, just unzip it to any folder. Also recommend that a file Script.bat, located in the folder "Apk Manager", change "set heapy = 64" to a higher value, such as 256 or 512, to prevent problems with large agribusiness files.
Working with "Apk Manager" also does not present difficulties. Required APK file put in folder "place-apk-here-for-modding", run "Script.bat" and the pop up window with green text, press "9 " and "Enter". Less than a minute later, the folder "projects" we unpacked APK file. Packs the same, run "Script.bat", click on "11"," Enter ", the question is whether the APC system? "Hit"n". And in the end, when the APK-packed file, sign it, for that press "12 " and "Enter". As a result, we get in the folder "place-apk-here-for-modding" file with the name signed [the name of the original APK-file].apk. Additionally, about "Apk manager" can be read here.
Click to expand...
Click to collapse
Further in the text I will miss the description of the process of unpacking / packing APK files.
Also, before you start, I recommend to first review a list of commands JAVA-byte code.
Now you can overstep directly to optimization, for example I will use the game "Modern Combat: Sandstorm".
1. Changing the rendering resolution to HVGA / QVGA.
Most games under android, written using OpenGL, an OpenGL permission given by the function "glViewPort", and it will use. The most optimal, I think the function "glViewPort" place in the function "OnDrawFrame". To do this, by looking in the folder "smali", which is located in a folder with raspakovanym APK file, look for a file containing the function "OnDrawFrame". Usually this file is named "GameRenderer.smali" or "[Name Game] Renderer.smali ", in this case, "SandstormRenderer.smali". Open it in Notepad or another text editor and find in it the function "OnDrawFrame".
Here is a fragment of this function.
HTML:
.method public onDrawFrame(Ljavax/microedition/khronos/opengles/GL10;)V
.locals 6
.parameter "gl"
.prologue
.line 174
const-wide/16 v0, 0x0
.line 177
.local v0, time:J
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v0
.line 179
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/GLMediaPlayer;->update()V
.line 180
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/SandstormRenderer;->nativeRender()V
.line 186
const-wide/16 v2, 0x32
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v4
sub-long/2addr v4, v0
sub-long v0, v2, v4
.line 188
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-lez v2, :cond_0
.line 190
:try_start_0
invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 193
:cond_0
:goto_0
return-void
.line 190
:catch_0
move-exception v2
goto :goto_0
.end method
In this snippet of code to add the function call "glViewPort", so to obtain, as in the code snippet below.
HTML:
.method public onDrawFrame(Ljavax/microedition/khronos/opengles/GL10;)V
.locals 9
.parameter "gl"
.prologue
const/16 v8, 0x1E0
const/16 v7, 0x140
const/4 v6, 0x0
invoke-interface {p1, v6, v6, v8, v7}, Ljavax/microedition/khronos/opengles/GL10;->glViewport(IIII)V
.line 174
const-wide/16 v0, 0x0
.line 177
.local v0, time:J
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v0
.line 179
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/GLMediaPlayer;->update()V
.line 180
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/SandstormRenderer;->nativeRender()V
.line 186
const-wide/16 v2, 0x32
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v4
sub-long/2addr v4, v0
sub-long v0, v2, v4
.line 188
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-lez v2, :cond_0
.line 190
:try_start_0
invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 193
:cond_0
:goto_0
return-void
.line 190
:catch_0
move-exception v2
goto :goto_0
.end method
What we have done here? We've added three constants (v6, v7, v8), assign them a value of coordinates of the left lower (v6; v6) and upper right (v8; v7) corner of the screen and transferred them to the function "glViewport". I think it is understandable why for the coordinates of the lower left corner for the X and Y is used alone and also a constant v6? Since both X and Y in this corner are equal. In addition, change the 2-th line in the function ". locals 6 " on ". locals 9 ", it determines the number of constants / variables used in functions, so we added 3 constants, 6 +3 = 9. Also note that the names of the constants (v6, v7, v8), are not taken casually, as selected by focusing on already used in the function of the constants. If suddenly someone did not understand, 0x1E0 in decimal would be 480 and 0x140 - 320.
Also pay attention to the function "onSurfaceCreated".
HTML:
.method public onSurfaceCreated(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V
.locals 7
.parameter "gl"
.parameter "config"
.prologue
const/4 v3, -0x1
.line 138
const/4 v0, 0x2
const-string v1, "SandstormRenderer"
const-string v2, "onSurfaceCreated"
invoke-static {v0, v1, v2}, Lcom/gameloft/android/GAND/GloftMCHP/GLDebug;->debugMessage(ILjava/lang/String;Ljava/lang/String;)V
.line 141
invoke-direct {p0}, Lcom/gameloft/android/GAND/GloftMCHP/SandstormRenderer;->nativeGetJNIEnv()V
.line 142
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/GLResLoader;->init()V
.line 143
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/GLMediaPlayer;->init()V
.line 144
invoke-static {}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeInit()V
.line 146
:goto_0
sget v0, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_W:I
if-eq v0, v3, :cond_0
sget v0, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_H:I
if-ne v0, v3, :cond_1
.line 149
:cond_0
const-wide/16 v0, 0x32
:try_start_0
invoke-static {v0, v1}, Ljava/lang/Thread;->sleep(J)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_0
:catch_0
move-exception v6
.local v6, ex:Ljava/lang/Exception;
invoke-virtual {v6}, Ljava/lang/Exception;->printStackTrace()V
goto :goto_0
.line 154
.end local v6 #ex:Ljava/lang/Exception;
:cond_1
sget v1, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->m_bEnableKeyboard:I
const/4 v2, 0x1
sget v3, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_W:I
sget v4, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_H:I
sget v5, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->mCurrentLang:I
move-object v0, p0
invoke-direct/range {v0 .. v5}, Lcom/gameloft/android/GAND/GloftMCHP/SandstormRenderer;->nativeInit(IIIII)V
.line 155
return-void
.end method
Namely, the code
HTML:
sget v3, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_W:I
sget v4, Lcom/gameloft/android/GAND/GloftMCHP/SandstormGLSurfaceView;->mDevice_H:I
In this code, the variable v3, v4 assigned to the real resolution screen devices, and passed to the function "nativeInit". Since the game is still designed for 480x800 resolution, it is better to have the game thinking that you have a device with this particular resolution. in this code is replaced by
HTML:
const/16 v3, 0x320
const/16 v4, 0x1E0
If you do not experience problems.
(You can ask and 480h720, since the proportion of screens with 480x800 and 320x480 are different and when "squeeze " the picture is slightly flattened (thanks for the comment G @ sh! sh). But in this case, at the stage of "adjustment grid touch screen", the coefficient must be assumed to be between 800 and between 720 and will it be 1.666666666666667 and 720/480 = 1.5)
Note
In other games instead of code, maybe something like this
HTML:
invoke-virtual {v0}, Landroid/view/Display;->getWidth()I
move-result v3
invoke-virtual {v0}, Landroid/view/Display;->getHeight()I
move-result v4
Anyway replace it at:
HTML:
const/16 v3, 0x320
const/16 v4, 0x1E0
Or variable names can not v3, v4 and v1, v2. Or nothing at all like it to be, and then change nothing.
Or if problems arise, you can just in case, go looking for all "*. smali" files and replace all function calls "Landroid / view / Display; -> getWidth () I" and "Landroid / view / Display; -> getHeight () I ", suffer from it will not.
Click to expand...
Click to collapse
For some games, our work is enough and they safely change the permissions on all the graphics you need. To do this again packs APK-file and check the phone as he works. If everything is successful then go to the item "adjustment grid the touch screen. " If not, read on. In our case, with the game Modern Combat: Sandstorm, not everything is smooth, game graphics smashtabirovalas until the required permission, and the menu - no. This means that somewhere in the function is called "glViewPort", and then change the resolution to 480x800. Thus, as in the files "*. smali" function "glViewPort" do not call, you can check by searching, so the case in the library "libsandstorm.so".
The main idea of the next step, remove all calls to library functions "glViewPort".
To analyze the library, we need the "Ida Pro". For convenience, copy "libsandstorm.so" in any folder, run "Ida Pro" and click on "New" button
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Then choose "Various files", "Unknown file" and click "OK".
In the window, open the file specify the path to the library "libsandstorm.so" and click "Open. "
In the next window, change the "Processor type" to "ARM processorARM710a", then click "Set" and "Ok ".
If after this, there will be another window with anything, click "OK ". Now you need to wait for the disassembly. This process is quite long, in this you can go to smoke or drink coffee
The fact that reverse engineering is completed, will show a message "The initial autoanalysis has been finished." in the lower box "Output window".
For greater convenience, in this case, click the right mouse button on a blue field, and on the shortcut menu, select "Text view". Moving to the beginning of assembler code for the search for "glViewPort".
Hit the keyboard shortcut "Alt + T" in the dialog box to enter search "glViewPort" and click "OK".
We are interested in function calls "BLX glViewport", "BL glViewport", "B glViewport", "BX glViewport", etc. Any other mentions of "glViewport" we deny press "Ctrl + T" and continue the search.
A necessary place, switch to the "Hex View-A".
Make sure that the function call takes 4 bytes and a "CE F7 D4 E8" (in your case, these figures may be different), it is necessary in order to see what needs to be corrected and do not accidentally overwrite anything extra.
Calling this function we need to drink, for it must be replaced by "CE F7 D4 E8" (in your case, these figures may be different) on "C0 46 C0 46. Remember the address "001F994A" and run the hex editor, I use "UltraEdit". Open it to our library.
In order to move us to the right address, click "Ctrl + G", in the input box will appear "0x001F994A" and click "OK".
Moving, we see that hit where you want, all the hexadecimal code converges to the fact that we saw in "Ida Pro" tab "Hex View-A".
Correcting the "CE F7 D4 E8" on "C0 46 C0 46.
Switches to "Ida Pro" and continue to search for the following calls "glViewPort", there may be several dozen. They have been treated similarly.
When all calls to drink, is preserved. Copy to place a revised "libsandstorm.so". Packs APK-file and set the phone to check. If done correctly, the entire schedule to Decrease the required permission.
Click to expand...
Click to collapse
P.S. Russian language is very complicated so I'm still translating! So what are waiting for will soon have everything!
Would anyone be kind enough to upload HD apk games already optimised for the x10 mini/pro? Thanks in advance!
Yes. You see for
Code:
www.forum.se-x10.pl
. There upload apk and sd data.
this site a bad check. I can not register there.
Continuing the theme of optimizing HD games under HVGA / QVGA
2. Adjustment grid touchscreen
Even when we have optimized the graphic screen HVGA / QVGA and all the buttons on the screen displayed in the right places on the grid touch screen they are on the old field, off screen.
It looks like this.
1 - This is the current place of drawing a button.
2 - An old place of rendering the button and the current location of the buttons on the touch-screen grid.
Fix is quite simple, you need to make sure that when touching the screen at the point 1, the game thought that the touch at point 2. For this to count as a changed, as a result of the previous stage, the coordinates drawn on-screen buttons. To find out, we need to calculate the ratio of how many times the screen resolution HVGA / QVGA less WVGA.
HTML:
[B]For HVGA[/B]
X: 800/480=1,666666666666667
Y: 480/320=1,5
[B]For QVGA[/B]
X: 800/320=2.5
Y: 480/240=2
Therefore if the coordinates of the buttons on the WVGA screen, for example, were 700h360, then HVGA screen, it already coordinates will 420h240 (700 / 1.666666666666667 = 420, 360 / 1,5 = 240). This pattern holds for the other buttons on the screen.
That is our task to make sure that when a player touches the coordinates 420h240 game thought he was touched in the coordinates 700h360.
From this it is understandable that only the coordinates of the touch screen to multiply X by 1,666666666666667, Y 1,5 to HVGA screen and X by 2.5, Y 2 to QVGA.
We'll do it in the event handler touchscreen "onTouchEvent". With the search we find that it is in the files "GameInstaller.smali" and "Sandstorm.smali". We want someone who is in the file "Sandstorm.smali".
HTML:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 10
.parameter "event"
.prologue
const/4 v9, 0x1
const/4 v8, 0x0
.line 379
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v0
.line 380
.local v0, action:I
and-int/lit16 v4, v0, 0xff
.line 382
.local v4, mask:I
invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v1
.line 383
.local v1, count:I
const v6, 0xff00
and-int/2addr v6, v0
shr-int/lit8 v5, v6, 0x8
.line 388
.local v5, pointerId:I
if-nez v0, :cond_0
.line 390
invoke-virtual {p1, v8}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
invoke-virtual {p1, v8}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
invoke-direct {p0, v6, v7, v8}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchPressed(III)V
.line 394
:cond_0
const/4 v6, 0x5
if-ne v4, v6, :cond_1
.line 397
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
invoke-direct {p0, v6, v7, v5}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchPressed(III)V
.line 400
:cond_1
const/4 v6, 0x2
if-ne v0, v6, :cond_2
.line 402
const/4 v2, 0x0
.local v2, i:I
:goto_0
if-ge v2, v1, :cond_2
.line 403
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v3
.line 405
.local v3, id:I
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
invoke-direct {p0, v6, v7, v3}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchMoved(III)V
.line 402
add-int/lit8 v2, v2, 0x1
goto :goto_0
.line 409
.end local v2 #i:I
.end local v3 #id:I
:cond_2
const/4 v6, 0x6
if-ne v4, v6, :cond_3
.line 412
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
invoke-direct {p0, v6, v7, v5}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchReleased(III)V
.line 415
:cond_3
if-ne v0, v9, :cond_4
.line 416
const/4 v2, 0x0
.restart local v2 #i:I
:goto_1
if-ge v2, v1, :cond_4
.line 418
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v3
.line 421
.restart local v3 #id:I
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
invoke-direct {p0, v6, v7, v3}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchReleased(III)V
.line 416
add-int/lit8 v2, v2, 0x1
goto :goto_1
.line 427
.end local v2 #i:I
.end local v3 #id:I
:cond_4
return v9
.end method
We draw attention to the function
HTML:
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F
These functions and define the coordinates of touching the touch screen, immediately after them, we multiply the coordinates on an already calculated coefficients.
For HVGA should get it.
HTML:
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 10
.parameter "event"
.prologue
const/4 v9, 0x1
const/4 v8, 0x0
.line 379
invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I
move-result v0
.line 380
.local v0, action:I
and-int/lit16 v4, v0, 0xff
.line 382
.local v4, mask:I
invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I
move-result v1
.line 383
.local v1, count:I
const v6, 0xff00
and-int/2addr v6, v0
shr-int/lit8 v5, v6, 0x8
.line 388
.local v5, pointerId:I
if-nez v0, :cond_0
.line 390
invoke-virtual {p1, v8}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
invoke-virtual {p1, v8}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
invoke-direct {p0, v6, v7, v8}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchPressed(III)V
.line 394
:cond_0
const/4 v6, 0x5
if-ne v4, v6, :cond_1
.line 397
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
invoke-direct {p0, v6, v7, v5}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchPressed(III)V
.line 400
:cond_1
const/4 v6, 0x2
if-ne v0, v6, :cond_2
.line 402
const/4 v2, 0x0
.local v2, i:I
:goto_0
if-ge v2, v1, :cond_2
.line 403
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v3
.line 405
.local v3, id:I
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
invoke-direct {p0, v6, v7, v3}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchMoved(III)V
.line 402
add-int/lit8 v2, v2, 0x1
goto :goto_0
.line 409
.end local v2 #i:I
.end local v3 #id:I
:cond_2
const/4 v6, 0x6
if-ne v4, v6, :cond_3
.line 412
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
invoke-virtual {p1, v5}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
invoke-direct {p0, v6, v7, v5}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchReleased(III)V
.line 415
:cond_3
if-ne v0, v9, :cond_4
.line 416
const/4 v2, 0x0
.restart local v2 #i:I
:goto_1
if-ge v2, v1, :cond_4
.line 418
invoke-virtual {p1, v2}, Landroid/view/MotionEvent;->getPointerId(I)I
move-result v3
.line 421
.restart local v3 #id:I
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getX(I)F
move-result v6
float-to-int v6, v6
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
invoke-virtual {p1, v3}, Landroid/view/MotionEvent;->getY(I)F
move-result v7
float-to-int v7, v7
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
invoke-direct {p0, v6, v7, v3}, Lcom/gameloft/android/GAND/GloftMCHP/Sandstorm;->nativeTouchReleased(III)V
.line 416
add-int/lit8 v2, v2, 0x1
goto :goto_1
.line 427
.end local v2 #i:I
.end local v3 #id:I
:cond_4
return v9
.end method
Here is the code that we added to the function
HTML:
mul-int/lit8 v6, v6, 0xa
div-int/lit8 v6, v6, 0x6
...
mul-int/lit8 v7, v7, 0x3
div-int/lit8 v7, v7, 0x2
I hope everyone understood that multiplying by 10 (A in hex) and is divided into 6, it is the same as multiply by 1.666666666666667 and multiplying by 3 and dividing by 2 - the same as multiply by 1.5.
Note
In principle, we can proceed a little differently and multiplying the coordinates of the code in the function "onTouchEvent" not to add, instead, to create alternative roles "nativeTouchPressedMod", "nativeTouchMovedMod", "nativeTouchReleasedMod". Replace them, called in "onTouchEvent" original features "nativeTouchPressed", "nativeTouchMoved", "nativeTouchReleased". And in alternate functions to multiply the coordinates and call them with the original function. This is especially useful in those games where instead of a 3-function "nativeTouchPressed", "nativeTouchMoved", "nativeTouchReleased" uses a "nativeOnTouch" (an example of such a game "Hero of Sparta"), there remains a need to create only 1-st alternate function "nativeOnTouchMod", and only in it one must add the code multiplication of coordinates, which is more convenient. Although this method is more convenient, it seems to me that he would be more difficult for beginners, in this I will not describe it in detail. If someone wants to become more familiar with this method, you can see how it is implemented in the "Hero of Sparta", just compare the files "HeroOfSparta.smali" with the original version and the version optimized for HVGA / QVGA
Click to expand...
Click to collapse
Click to expand...
Click to collapse
3. How to disable cache
This step is even simpler, the file "GameInstaller.smali" find function "isRequiredFile"
HTML:
.method private isRequiredFile(Ljava/lang/String;J)Z
.locals 5
.parameter "fileName"
.parameter "size"
.prologue
const/4 v4, 0x1
.line 410
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
sget-object v3, Lcom/gameloft/android/GAND/GloftMCHP/GameInstaller;->DATA_PATH:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
.line 411
.local v1, path:Ljava/lang/String;
new-instance v0, Ljava/io/File;
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 412
.local v0, file:Ljava/io/File;
invoke-direct {p0, p1}, Lcom/gameloft/android/GAND/GloftMCHP/GameInstaller;->replaceOconf(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_0
const/4 v2, 0x0
.line 415
:goto_0
return v2
:cond_0
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v2
if-eqz v2, :cond_1
invoke-virtual {v0}, Ljava/io/File;->length()J
move-result-wide v2
cmp-long v2, v2, p2
if-eqz v2, :cond_2
:cond_1
const/4 v2, 0x0
goto :goto_0
:cond_2
const/4 v2, 0x0
goto :goto_0
.end method
In it we are interested in a fragment
HTML:
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v2
if-eqz v2, :cond_1
invoke-virtual {v0}, Ljava/io/File;->length()J
move-result-wide v2
cmp-long v2, v2, p2
if-eqz v2, :cond_2
:cond_1
const/4 v2, 0x0
In this passage there is a check whether a file exists in the cache and if so, the same as its size (or checksum) with the reference? We just cut a check for file existence, but comparing the size of a reference to itself
The result should so
HTML:
.method private isRequiredFile(Ljava/lang/String;J)Z
.locals 5
.parameter "fileName"
.parameter "size"
.prologue
const/4 v4, 0x1
.line 410
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
sget-object v3, Lcom/gameloft/android/GAND/GloftMCHP/GameInstaller;->DATA_PATH:Ljava/lang/String;
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
.line 411
.local v1, path:Ljava/lang/String;
new-instance v0, Ljava/io/File;
invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 412
.local v0, file:Ljava/io/File;
invoke-direct {p0, p1}, Lcom/gameloft/android/GAND/GloftMCHP/GameInstaller;->replaceOconf(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_0
const/4 v2, 0x0
.line 415
:goto_0
return v2
:cond_0
cmp-long v2, p2, p2
if-eqz v2, :cond_2
const/4 v2, 0x0
goto :goto_0
:cond_2
const/4 v2, 0x0
goto :goto_0
.end method
HTML:
In some games, mostly to the new function "isRequiredFile" does not, then focus on the snippets "invoke-virtual {v0}, Ljava/io/File;->exists()Z", " invoke-virtual {v0}, Ljava/io/File;->length()J", if they go together and after we check if"cmp-...", then 99% of it is checking the cache, we proceed with it is similar to that described above.
Click to expand...
Click to collapse
4. Assigning a hardware button on any action
Useful
What if the game uses the wrong cache or does not start?
Sometimes such a situation, when the phone is not officially supported game, but the reasons for this game it will not start - no. And it starts, but textures are displayed incorrectly or not displayed. The problem is that the game does not know your phone and any unknown phone thinks PowerVR. Check if this is, quite simply, only need-only file "Build.prop", change the manufacturer and model of your phone, such as "HTC Desire" and if the game is run properly, then you have a similar situation. To solve this problem, we need to make an unknown phone was considered "Snapdragon".
Below is written, to a greater extent, belongs to the Games Gameloft.
Uncompressed AIC file we need to find 2 files "gi_settings.xml" and "data.txt", they usually are in the "res\raw".
Click the "gi_settings.xml" in a text editor, you should see something such content.
HTML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<carriers>
<carrier name="default">
<wifi_only>1</wifi_only>
</carrier>
<carrier name="sprint">
<wifi_only>0</wifi_only>
</carrier>
</carriers>
<devices>
<device>
<manufacturer name="default">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Samsung">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="SAMSUNG">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="samsung">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="motorola">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="samsung">
<model name="modelxxx">
<atc_textures>1</atc_textures> <!-- sample to override manufacturer value for an specific device -->
</model>
</manufacturer>
</device>
<device>
<manufacturer name="htc">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="HTC">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Htc">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Sharp">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="SHARP">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="sharp">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Sony Ericsson">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="acer">
<dxt_textures>1</dxt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="sony">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="LGE">
<dxt_textures>1</dxt_textures>
</manufacturer>
</device>
<device>
<manufacturer name="lge">
<model name="LG-SU660">
<dxt_textures>1</dxt_textures>
</model>
</manufacturer>
</device>
</devices>
</settings>
This file is given for each phone model, a cache (texture compression format) to use. Tag "<pvrt_textures> 1 </pvrt_textures> " indicates a texture format for "PoverVR", tag "<atc_textures> 1 </atc_textures> " at the texture format for "Snapdragon", and "<dxt_textures> 1 </dxt_textures> " on the texture format for "Tegra".
As we expected, the unknown device is "PoverVR".
HTML:
<manufacturer name="default">
<pvrt_textures>1</pvrt_textures>
</manufacturer>
And LG is a device "Tegra"
HTML:
<manufacturer name="LGE">
<dxt_textures>1</dxt_textures>
</manufacturer>
It is now clear for the game to start to consider your device "Snapdragon", to replace all the tags "<pvrt_textures> 1 </pvrt_textures> " and "<dxt_textures> 1 </dxt_textures> " on "<atc_textures> 1 </atc_textures > "make it through the" Edit / Change your text editor.
As a result, you should have
HTML:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<carriers>
<carrier name="default">
<wifi_only>1</wifi_only>
</carrier>
<carrier name="sprint">
<wifi_only>0</wifi_only>
</carrier>
</carriers>
<devices>
<device>
<manufacturer name="default">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Samsung">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="SAMSUNG">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="samsung">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="motorola">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="samsung">
<model name="modelxxx">
<atc_textures>1</atc_textures> <!-- sample to override manufacturer value for an specific device -->
</model>
</manufacturer>
</device>
<device>
<manufacturer name="htc">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="HTC">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Htc">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Sharp">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="SHARP">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="sharp">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="Sony Ericsson">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="acer">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="sony">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="LGE">
<atc_textures>1</atc_textures>
</manufacturer>
</device>
<device>
<manufacturer name="lge">
<model name="LG-SU660">
<atc_textures>1</atc_textures>
</model>
</manufacturer>
</device>
</devices>
</settings>
Click to expand...
Click to collapse
To be continued
Continued
In principle this is sufficient, but you can still, just in case, correct and "data.txt".
HTML:
PVRT:http://dl.gameloft.com/hdplus/android/DH2/i9000/ML/1.0.4/DH2_FINAL_PVRTC_104.zip
ATC:http://dl.gameloft.com/hdplus/android/DH2/HTC_EVO/ML/1.0.4/DH2_FINAL_ATC_104.zip
DXT:http://dl.gameloft.com/hdplus/android/DH2/LG_STAR/ML/1.0.4/DH2_FINAL_DXT_104.zip
It specifies which cache to use and where it is, for each type of accelerator. Address of 2 nd line, we copy in the 1 st and 3rd.
HTML:
PVRT:http://dl.gameloft.com/hdplus/android/DH2/HTC_EVO/ML/1.0.4/DH2_FINAL_ATC_104.zip
ATC:http://dl.gameloft.com/hdplus/android/DH2/HTC_EVO/ML/1.0.4/DH2_FINAL_ATC_104.zip
DXT:http://dl.gameloft.com/hdplus/android/DH2/HTC_EVO/ML/1.0.4/DH2_FINAL_ATC_104.zip
Thus, we point out the game, so it is not dependent on the type of accelerator used cash for "Snapdragon".
After that, the game should work correctly. By the way I always puzzling why the spread 10 times the cache under the "Snapdragon", with the headings "Cash for Desire ","Cash for Desire z ","Cash for Desire HD " if they are the same? Moreover, in games there are usually only 3 types of caches, for different video accelerators. This will make sure you can look a file "data.txt".
If the game does not start
Sometimes more so that the game does not start, but the objective reasons for this. Moreover, if the correct model of the device in "build.prop" game starts. This means that somewhere in the game code is a check Model/phone manufacturer, which resulted in the game just closes. It is clear that to solve this problem you need to make the game think she gets the right devices. For example, in "HTC Desire", if it is of course supported by the game. With the help of search through all the "*. smali" file and find those which meet the code "Landroid/os/Build;>MANUFACTURER:Ljava/lang/String" or "Landroid/os/Build;>MODEL:Ljava/lang/String". Thus we find the definition of the model code/ phone manufacturer.
HTML:
sget-object v0, Landroid/os/Build;->MANUFACTURER:Ljava/lang/String;
sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;
We need to be replaced by
HTML:
const-string v0, "HTC"
const-string v1, "HTC Desire"
(variables v0, v1-listed for an example, in your case, they may be different)
And so with all the files found.
In addition to the model/phone manufacturer in the same way in the game can also check the firmware version, or an android, and if it interferes with the launch of the game, these inspections can proceed similarly.
Click to expand...
Click to collapse
Analysis software package
Analyze JAVA-byte code files "*. smali", occupation rather complicated and a little sweet. But there is a way we can decompile apk-file and get the source code of JAVA. While these sources and are not suitable for the compilation, but a study of the program make it easy at times. For this we need 2 programs dex2jar and jd-gui, they should be extracted to arbitrary folders. Next, using the archiver with guinea apk-file to extract and copy the folder with the "dex2jar" file "classes.dex". From the command prompt run the command "dex2jar.bat classes.dex", as a result of the last in the folder "dex2jar" get file "classes.dex.dex2jar.jar". Now run the program "jd-gui" in her opening, obtained earlier, the file "classes.dex.dex2jar.jar".
The result is a readable code JAVA.
Click to expand...
Click to collapse
Translated with Google translator and me!
try to download asphalt5 here www.forum.se-x10.pl the menu is too big?
paul-xxx said:
this site a bad check. I can not register there.
Click to expand...
Click to collapse
neither i...i fill in everything, but it says i need to fill in the market things...
hah
"Gadu-Gadu" is Polish communicator, messenger. You must write eg. "1234"
hey guys heres a site in spanish (much more readable) just register and have fun!!!
http://www.se-planet.com/foro/index.php?board=111.0
I tried this tutorial with Galaxy on Fire 2, and I can't find OnDraw on any of the .smali files.
Just for the sake of transparency Here is a quick rundown of the process for everyone to see.
High level overview:
1. ) baksmali classes.dex from NfcNci.apk
2. ) Mod the resulting smali.
3. ) smali, and inject back into NfcNci.apk
Since this is the dev section I will focus on step 2 you can read about steps 1 and 3 elsewhere. For the sake of this example I will be working with the system dump from the original release of the gt-i9505g (S4 Google Edition) System Software.
What you are looking for is this function contained in the NfcIntegrityChecker class:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
If we track back the exception error message that comes up in the debug log ("Client module is tampered"), you will see that the text is contained in the NfcService class within the function ".method public enforceNfcIntegrity()V"
Code:
.method public enforceNfcIntegrity()V
.locals 3
.prologue
.line 470
iget-object v1, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
monitor-enter v1
.line 471
:try_start_0
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
invoke-virtual {v0}, Lcom/android/nfc/NfcIntegrityChecker;->getStatus()I
move-result v0
const/4 v2, 0x3
if-ne v0, v2, :cond_0
.line 472
new-instance v0, Ljava/lang/SecurityException;
const-string v2, "NfcIntegrityChecker is not on the proper status"
invoke-direct {v0, v2}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
.line 480
:catchall_0
move-exception v0
monitor-exit v1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
throw v0
.line 475
:cond_0
:try_start_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
invoke-virtual {v0}, Lcom/android/nfc/NfcIntegrityChecker;->getStatus()I
move-result v0
const/4 v2, 0x2
if-eq v0, v2, :cond_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
const-string v2, "client"
invoke-virtual {v0, v2}, Lcom/android/nfc/NfcIntegrityChecker;->checkIntegrity(Ljava/lang/String;)Z
move-result v0
if-eqz v0, :cond_1
iget-object v0, p0, Lcom/android/nfc/NfcService;->mIntegrityChecker:Lcom/android/nfc/NfcIntegrityChecker;
const-string v2, "clientlib"
invoke-virtual {v0, v2}, Lcom/android/nfc/NfcIntegrityChecker;->checkIntegrity(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_2
.line 478
:cond_1
new-instance v0, Ljava/lang/SecurityException;
const-string v2, "Client module is tampered"
invoke-direct {v0, v2}, Ljava/lang/SecurityException;-><init>(Ljava/lang/String;)V
throw v0
.line 480
:cond_2
monitor-exit v1
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 481
return-void
.end method
If we follow the flow of the application we see that the code for this failure is only reached if the function call to
Code:
checkIntegrity(Ljava/lang/String;)Z
returns false, or the status is not properly set. (the 'Z' at the end means it returns a boolean).
There are two ways to handle this. We can either patch out the call to checkIntegrity entirely (jump over it, or literally remove the calls), or we can modify the checkIntegrity function so that it always returns true.
So, let's look at the checkIntegrity function:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 11
.parameter "type"
.prologue
const/4 v10, 0x2
const/4 v9, 0x1
const/4 v8, 0x0
.line 293
iget-object v5, p0, Lcom/android/nfc/NfcIntegrityChecker;->mModuleMap:Ljava/util/HashMap;
invoke-virtual {v5, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/ArrayList;
.line 294
.local v2, modules:Ljava/util/ArrayList;,"Ljava/util/ArrayList<[Ljava/lang/String;>;"
const/4 v1, 0x0
.line 295
.local v1, module:[Ljava/lang/String;
const/4 v3, 0x1
.line 296
.local v3, ret:Z
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v4
.line 298
.local v4, size:I
const/4 v0, 0x0
.local v0, i:I
:goto_0
if-ge v0, v4, :cond_2
.line 299
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v1
.end local v1 #module:[Ljava/lang/String;
check-cast v1, [Ljava/lang/String;
.line 301
.restart local v1 #module:[Ljava/lang/String;
if-eqz v1, :cond_0
array-length v5, v1
if-eq v5, v10, :cond_4
.line 302
:cond_0
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_1
const-string v5, "NfcIntegrityChecker"
const-string v6, "checkIntegrity module format error"
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 303
:cond_1
const/4 v3, 0x0
.line 314
:cond_2
:goto_1
if-nez v3, :cond_3
iput v10, p0, Lcom/android/nfc/NfcIntegrityChecker;->mStatus:I
.line 316
:cond_3
return v3
.line 307
:cond_4
aget-object v5, v1, v8
aget-object v6, v1, v9
invoke-direct {p0, v5, v6}, Lcom/android/nfc/NfcIntegrityChecker;->checkModuleIntegrity(Ljava/lang/String;Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_6
.line 308
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_5
const-string v5, "NfcIntegrityChecker"
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "checkModuleIntegrity "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v8
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " tampered : "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v9
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 309
:cond_5
const/4 v3, 0x0
.line 310
goto :goto_1
.line 298
:cond_6
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
There is only one return statement, so this should be a simple matter of setting our value, and calling return. In some cases there is code that your application needs to run in order to function, so usually a light touch is a good idea, but in this case all of the code is there to run various checks so we can skip most of it.
The easiest way would be to replace the whole function with this:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 2
.parameter "type"
.prologue
const/4 v0, 0x1
return v0
.end method
But that method never sat right with me (old school c++ cracking I guess), so I prefer something like this:
add a goto, and modify the constant here:
.line 303
:cond_1
:goto_666
const/4 v3, 0x1
then add the following line to the beginning of the function (after the .prologue)
goto :goto_666
We end up with something like this:
Code:
.method public checkIntegrity(Ljava/lang/String;)Z
.locals 11
.parameter "type"
.prologue
const/4 v10, 0x2
const/4 v9, 0x1
const/4 v8, 0x0
goto :goto_666
.line 293
iget-object v5, p0, Lcom/android/nfc/NfcIntegrityChecker;->mModuleMap:Ljava/util/HashMap;
invoke-virtual {v5, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Ljava/util/ArrayList;
.line 294
.local v2, modules:Ljava/util/ArrayList;,"Ljava/util/ArrayList<[Ljava/lang/String;>;"
const/4 v1, 0x0
.line 295
.local v1, module:[Ljava/lang/String;
const/4 v3, 0x1
.line 296
.local v3, ret:Z
invoke-virtual {v2}, Ljava/util/ArrayList;->size()I
move-result v4
.line 298
.local v4, size:I
const/4 v0, 0x0
.local v0, i:I
:goto_0
if-ge v0, v4, :cond_2
.line 299
invoke-virtual {v2, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;
move-result-object v1
.end local v1 #module:[Ljava/lang/String;
check-cast v1, [Ljava/lang/String;
.line 301
.restart local v1 #module:[Ljava/lang/String;
if-eqz v1, :cond_0
array-length v5, v1
if-eq v5, v10, :cond_4
.line 302
:cond_0
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_1
const-string v5, "NfcIntegrityChecker"
const-string v6, "checkIntegrity module format error"
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 303
:cond_1
:goto_666
const/4 v3, 0x1
.line 314
:cond_2
:goto_1
if-nez v3, :cond_3
iput v10, p0, Lcom/android/nfc/NfcIntegrityChecker;->mStatus:I
.line 316
:cond_3
return v3
.line 307
:cond_4
aget-object v5, v1, v8
aget-object v6, v1, v9
invoke-direct {p0, v5, v6}, Lcom/android/nfc/NfcIntegrityChecker;->checkModuleIntegrity(Ljava/lang/String;Ljava/lang/String;)Z
move-result v5
if-nez v5, :cond_6
.line 308
sget-boolean v5, Lcom/android/nfc/NfcIntegrityChecker;->DBG:Z
if-eqz v5, :cond_5
const-string v5, "NfcIntegrityChecker"
new-instance v6, Ljava/lang/StringBuilder;
invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V
const-string v7, "checkModuleIntegrity "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v8
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
const-string v7, " tampered : "
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
aget-object v7, v1, v9
invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v6
invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v6
invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 309
:cond_5
const/4 v3, 0x0
.line 310
goto :goto_1
.line 298
:cond_6
add-int/lit8 v0, v0, 0x1
goto :goto_0
.end method
confirmed working
thanks again!
This is great, thanks for your contribution!
So does the integrity check call only have to do with access to the secure element? Or does it also eliminate the need to spoof device model for compatibility purposes?
CPA Poke said:
This is great, thanks for your contribution!
So does the integrity check call only have to do with access to the secure element? Or does it also eliminate the need to spoof device model for compatibility purposes?
Click to expand...
Click to collapse
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Fenny said:
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Click to expand...
Click to collapse
I think that's what the existing Xposed Wallet hack modules do (watch for the read prop values originating from Wallet). But for whatever reason it won't intercept the calls on initial setup, which is why you have to actually change the build.prop prior to initially setting up Wallet.
Fenny said:
It is just for the secure element. You can modify the wallet apk to bypass things like root checking, model versions, and carrier checks as well. It looks like the xposed framework patch that has been floating around does some of this, but it doesn't seem to patch the calls to read the device properties for device ID and such.
In my testing, I was able to replace all of those calls in the wallet app with constant strings containing "valid" values. This would kind of suck to have to do for each update... Though It would be a simple enough matter to write a script to do this automagically for each update. (Baksmali, sed/awk to find and replace in the smali, and smali to classes.dex) or write an xposed module to watch for calls to read prop values originating from wallet.
Sent from my GT-I9505G
Click to expand...
Click to collapse
if you had time to add a how-to to bypass root checking, model version and carrier check, I'd update it every time. wouldn't be a problem and I'd be happy to help out.
mrvirginia said:
if you had time to add a how-to to bypass root checking, model version and carrier check, I'd update it every time. wouldn't be a problem and I'd be happy to help out.
Click to expand...
Click to collapse
Bypassing Root:
Look at the com.google.android.apps.wallet.security.EnvironmentProperty class in the constructor method.
We're looking for this segment containing SU_COMMAND_LOCATIONS:
Code:
.line 70
new-array v0, v4, [Ljava/lang/String;
const-string v1, "/system/bin/su"
aput-object v1, v0, v3
const-string v1, "/system/xbin/su"
aput-object v1, v0, v2
sput-object v0, Lcom/google/android/apps/wallet/security/EnvironmentProperty;->SU_COMMAND_LOCATIONS:[Ljava/lang/String;
Note: These variable names change (v3, v4, etc...), usually they will be the const/4 numbers defined at the beginning of the method. Just make sure you use the one that contains 0.
Change this line from v4 (which contains the number 2)
Code:
new-array v0, v4, [Ljava/lang/String;
to v3 (which contains the number 0)
Code:
new-array v0, v3, [Ljava/lang/String;
Then simply delete the following lines:
Code:
const-string v1, "/system/bin/su"
aput-object v1, v0, v3
const-string v1, "/system/xbin/su"
aput-object v1, v0, v2
This will Set the environment property SU_COMMAND_LOCATIONS as an empty string array which will cause the checkDevice function in Lcom/google/android/apps/wallet/security/EnvironmentProperty$1 to simply break out of it's for loop and return 0 (which is what we want).
Bypassing device/carrier restrictions:
Here is a quick script I whipped up to replace the build prop calls automagically.
Usage would be something like:
Baksmali the classes.dex in your apk:
java -jar baksmali.jar your.apk -o outdir
Run the script (below):
/path/to/pwnprop.sh outdir
Do whatever other changes to the outdir directory.
Then smali:
java -jar smali.jar outdir -o classes.dex
Finally, winzip, lol. (If you actually use winzip imma kill you.)
The script:
Save this as pwnprop.sh (or whatever you feel like) and chmod +x
Code:
#!/bin/bash
do_replace ()
{
case $3 in
# Replace these with whatever device you want to clone.
MODEL)
ours="Galaxy Nexus";;
BRAND)
ours="Google" ;;
BOARD)
ours=""tuna"
ID)
ours="JDQ39E" ;;
PRODUCT)
ours="yakju" ;;
DEVICE)
ours="yakju" ;;
FINGERPRINT)
ours="google/yakju/maguro:4.2.2/JDQ39/573038:user/release-keys" ;;
*)
echo "Replacement property not defined: "$3" in "$1
return ;;
esac
sed -i 's{sget-object '$2', Landroid/os/Build;->'$3':Ljava/lang/String;{const-string '$2', "'$ours'"{g' $1
echo sed -i 's{sget-object '$2', Landroid/os/Build;->'$3':Ljava/lang/String;{const-string '$2', "'$ours'"{g' $1
}
OIFS=$IFS; IFS=$'\n'
for line in `grep -ro "[v0-9]*, Landroid/os/Build;->[A-Z]*" $ | sed 's{, Landroid/os/Build;->{:{'`
do
IFS=':'
temparray=($line)
if [ ${#temparray[@]} -eq 3 ]
then
do_replace $line
fi
IFS=$OIFS
done
CPA Poke said:
I think that's what the existing Xposed Wallet hack modules do (watch for the read prop values originating from Wallet). But for whatever reason it won't intercept the calls on initial setup, which is why you have to actually change the build.prop prior to initially setting up Wallet.
Click to expand...
Click to collapse
I think it actually just replaces the function that checks, "Is this device id allowed?" But for the initial setup the strings in build prop are sent to google where they can reject them server-side.
when trying to run the script, i keep getting a syntax error
pwnprop.sh: line 2: $'\r': command not found
pwnprop.sh: line 3: syntax error near unexpected token `$'\r''
'wnprop.sh: line 3: `do_replace ()
i'm doing:
bash pwnprop.sh classes
classes is my "outdir"
edit: alright, i've converted dos2unix. now i'm just getting errors that the file doesn't exist. argh, oh linux.
edit: zip has been updated to no longer check for su binary. still needs a device/carrier bypass restriction removed...
Fenny said:
I think it actually just replaces the function that checks, "Is this device id allowed?" But for the initial setup the strings in build prop are sent to google where they can reject them server-side.
Click to expand...
Click to collapse
Gotcha, that makes perfect sense.
mrvirginia said:
when trying to run the script, i keep getting a syntax error
pwnprop.sh: line 2: $'\r': command not found
pwnprop.sh: line 3: syntax error near unexpected token `$'\r''
'wnprop.sh: line 3: `do_replace ()
i'm doing:
bash pwnprop.sh classes
classes is my "outdir"
edit: alright, i've converted dos2unix. now i'm just getting errors that the file doesn't exist. argh, oh linux.
edit: zip has been updated to no longer check for su binary. still needs a device/carrier bypass restriction removed...
Click to expand...
Click to collapse
Make sure you have the sed, echo, and grep utilities installed and in your path.
Sent from my GT-I9505G
Fenny said:
Make sure you have the sed, echo, and grep utilities installed and in your path.
Sent from my GT-I9505G
Click to expand...
Click to collapse
i finally figured out what the problem was. iirc, i was running it as root or something. had the same problem when i tried using the Kitchen again a week or two ago and got it sorted so i'll attempt to run this again [hopefully] over the weekend and give everyone a working Wallet regardless of device so they won't have to do silly tweaks anymore with build.prop etc. thank you again, sir.
oh, did you ever figure out the SIM unlock issue?
Causes NFC to FC on official 4.3 with full wipe. Oddly, it works with dirty flash. Ideas?
[Edit]
Never mind. It was just a bad signature.
@ OP: this NfcNci mod works on TW firmware MF8.
maanz said:
@ OP: this NfcNci mod works on TW firmware MF8.
Click to expand...
Click to collapse
Good to hear. Sounds like this is a new feature in Samsung firmware. Still makes me wonder if non-samsung devices suffer the same fate. The function call is the same no matter which implementation of NfcNci you are using, but I suppose that each vendor's implementation of the integrity checks by necessesity will differ.
Sent from my GT-I9505G
@Fenny looks like Superuser (unsecure) check was removed from newest Wallet release on the Google Play Store
mrvirginia said:
@Fenny looks like Superuser (unsecure) check was removed from newest Wallet release on the Google Play Store
Click to expand...
Click to collapse
That is great news. Much less work to be done on it then.
Keep up the good work! You guys are close, I can feel it! I would offer to help this weekend, but I think I would just slow you down.
Sent from my Galaxy Nexus using XDA Premium 4 mobile app
Just in Case!!
These are smali edits I found or had help finding while converting my ASU theme to Android 4.3. I will be constantly updating this OP and hope that other folks will give me there smali finds to add to this guide. Please PM me with anything you would like to add. Feel free to use anything in this OP. You don't have to ask!!!
Please don't forget to thank Gunthermic, Naddict, Rompnit and Strongsteve for all there help as well!!!
SystemUI
1. Brightness slider color animation.
Go to SystemUI\smali\com\android\systemui\statusbar\Anim atedBrightnessIconView.smali
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Look for:
.line 73
iget-object v0, p0, Lcom/android/systemui/statusbar/AnimatedBrightnessIconView;->mPaint:Landroid/graphics/Paint;
const v1, -0x3a1f17
Change -0x3a1f17 to your desired smali color code!!!!
SecMms Messaging
1. Changing text color when searching for a contact in SecMms Messaging
Go To: SecMms\smali\com\android\mms\ui\RecipientsAdapter.smali
Look For:
.line 342
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 359
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 373
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 344
.restart local v22 # "span":Landroid/text/Spannable;
:cond_d
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 361
.restart local v22 # "span":Landroid/text/Spannable;
:cond_10
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 375
.restart local v23 # "spanNameText":Landroid/text/Spannable;
.restart local v24 # "spanNumberText":Landroid/text/Spannable;
:cond_12
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Gmail 4.7.2 smali finds
Gmail send email to text color:
Go to:
Gmail-4.7.2\smali\com\android\ex\chips\RecipientEditTextView.smali
Find:
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Insert: const v3, -0x4cf0 Of coarse changing -0x4cf0 to your smali text color code
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
So the finished product looks like this
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x4cf0
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Gmail list view email contents first line step one:
Go to:
Gmail-4.7.2-stock\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Insert this:
const v3, -0x66FFCD Changing -0x66ffcd to your favorite smali code
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
So the finished product looks like this
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x66FFCD
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Gmail list view email contents first line step two:
Go to
Gmail\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
.line 1405
Insert this:
const v0, -0x66ffcd Changing -0x66ffcd to your favorite smali code
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
INSERT HERE
.line 1405
So the finished product looks like this:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
const v0, -0x66FFCD
.line 1405
Gmail open email inbox background and text color
Go to:
Gmail\smali\com\google\android\gm\utils\b.smali
Look for:
.line 82
new-array v0, v4, [Ljava/lang/String;
const-string v1, "#dddddd" This is the background color
aput-object v1, v0, v5
const-string v1, "#777777" This is the text color
aput-object v1, v0, v6
Change hex color codes to your favorite color.
SamsungIME Keyboard Swipe Color:
Please see Gunthermic's thread http://forum.xda-developers.com/showthread.php?t=2569480
Calendar Year Tab horizontal line under month
Go to:
\Calendar\smali\com\android\calendar\month\YearView.smali
Look for:
.line 1021
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
and
.line 1027
:cond_b
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
Change -0xb4b4b5 to your favorite smali color code
Change text color in day and week events Calendar
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter$2.smali
Look for:
.line 962
.end local v0 # "paintFlag":I
:cond_2
iget-object v3, p0, Lcom/android/calendar/timeline/DayLayout$DayEventAdapter$2;->val$holder:Lcom/android/calendar/timeline/DayLayout$ViewHolder;
iget-object v3, v3, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v5, -0x1000000
invoke-virtual {v3, v5}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v5, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code.
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter.smali
Look for:
.line 1007
iget-object v6, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 940
:cond_8
iget-object v3, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v4, -0x1000000
invoke-virtual {v3, v4}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v4, -0x1000000 to const v4, -0x1000000 then change -0x1000000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\EventListWithStartTime.smali
Look for:
.line 107
iget-object v1, p0, Lcom/android/calendar/timeline/EventListWithStartTime;->mListView:Landroid/widget/ListView;
new-instance v2, Landroid/graphics/drawable/ColorDrawable;
const/high16 v3, -0x1000000
invoke-direct {v2, v3}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x100000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\WeekLayout$WeekEventAdapter.smali
Look for:
.line 1342
iget-object v6, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 1299
:goto_4
iget-object v2, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v3, -0x1000000
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code
Mine
Nice finds bud, very neat
I need one too!! Nice EMS! :highfive:
Nice to see someone take time to put it together.
I see a lot of smali edits I have been using for a while. Just never have time to write it all down,...
Reserved, cuz I do a ton of smali edits....
There goes all my trade secrets..lol
strongsteve said:
There goes all my trade secrets..lol
Click to expand...
Click to collapse
Yup... once released in an apk.. all free game.. hahaha.
You have no stinking secrets... I am Robocop.. put down your smali...
thanks
EMSpilot said:
These are smali edits I found or had help finding while converting my ASU theme to Android 4.3. I will be constantly updating this OP and hope that other folks will give me there smali finds to add to this guide. Please PM me with anything you would like to add. Feel free to use anything in this OP. You don't have to ask!!!
Please don't forget to thank Gunthermic, Naddict, Rompnit and Strongsteve for all there help as well!!!
SystemUI
1. Brightness slider color animation.
Go to SystemUI\smali\com\android\systemui\statusbar\Anim atedBrightnessIconView.smali
Look for:
.line 73
iget-object v0, p0, Lcom/android/systemui/statusbar/AnimatedBrightnessIconView;->mPaint:Landroid/graphics/Paint;
const v1, -0x3a1f17
Change -0x3a1f17 to your desired smali color code!!!!
SecMms Messaging
1. Changing text color when searching for a contact in SecMms Messaging
Go To: SecMms\smali\com\android\mms\ui\RecipientsAdapter.smali
Look For:
.line 342
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 359
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 373
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xff852e and change it to your desired smali color code.
Look For:
.line 344
.restart local v22 # "span":Landroid/text/Spannable;
:cond_d
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 361
.restart local v22 # "span":Landroid/text/Spannable;
:cond_10
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Look For:
.line 375
.restart local v23 # "spanNameText":Landroid/text/Spannable;
.restart local v24 # "spanNumberText":Landroid/text/Spannable;
:cond_12
new-instance v27, Landroid/text/style/ForegroundColorSpan;
const v28, -0xcc4a16 and change it to your desired smali color code.
Gmail 4.7.2 smali finds
Gmail send email to text color:
Go to:
Gmail-4.7.2\smali\com\android\ex\chips\RecipientEditTextView.smali
Find:
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Insert: const v3, -0x4cf0 Of coarse changing -0x4cf0 to your smali text color code
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
So the finished product looks like this
move-result-object v3
const v4, 0x106000c
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x4cf0
invoke-virtual {v7, v3}, Landroid/text/TextPaint;->setColor(I)V
Gmail list view email contents first line step one:
Go to:
Gmail-4.7.2-stock\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Insert this:
const v3, -0x66FFCD Changing -0x66ffcd to your favorite smali code
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
INSERT HERE
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
So the finished product looks like this
.line 421
new-instance v0, Landroid/text/style/ForegroundColorSpan;
const v3, 0x7f080029
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
const v3, -0x66FFCD
invoke-direct {v0, v3}, Landroid/text/style/ForegroundColorSpan;-><init>(I)V
Gmail list view email contents first line step two:
Go to
Gmail\smali\com\android\mail\browse\ConversationItemView.smali
Look for:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
.line 1405
Insert this:
const v0, -0x66ffcd Changing -0x66ffcd to your favorite smali code
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
INSERT HERE
.line 1405
So the finished product looks like this:
.line 1404
sget-object v0, Lcom/android/mail/browse/ConversationItemView;->aOX:Landroid/text/TextPaint;
iget-object v1, p0, Lcom/android/mail/browse/ConversationItemView;->aPi:Lcom/android/mail/browse/K;
iget-object v1, v1, Lcom/android/mail/browse/K;->GO:Lcom/android/mail/providers/Conversation;
iget v1, v1, Lcom/android/mail/providers/Conversation;->color:I
invoke-virtual {v0, v1}, Landroid/text/TextPaint;->setColor(I)V
const v0, -0x66FFCD
.line 1405
Gmail open email inbox background and text color
Go to:
Gmail\smali\com\google\android\gm\utils\b.smali
Look for:
.line 82
new-array v0, v4, [Ljava/lang/String;
const-string v1, "#dddddd" This is the background color
aput-object v1, v0, v5
const-string v1, "#777777" This is the text color
aput-object v1, v0, v6
Change hex color codes to your favorite color.
SamsungIME Keyboard Swipe Color:
Please see Gunthermic's thread http://forum.xda-developers.com/showthread.php?t=2569480
Calendar Year Tab horizontal line under month
Go to:
\Calendar\smali\com\android\calendar\month\YearView.smali
Look for:
.line 1021
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
and
.line 1027
:cond_b
const v1, -0xb4b4b5
invoke-virtual {v6, v1}, Landroid/graphics/Paint;->setColor(I)V
Change -0xb4b4b5 to your favorite smali color code
Change text color in day and week events Calendar
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter$2.smali
Look for:
.line 962
.end local v0 # "paintFlag":I
:cond_2
iget-object v3, p0, Lcom/android/calendar/timeline/DayLayout$DayEventAdapter$2;->val$holder:Lcom/android/calendar/timeline/DayLayout$ViewHolder;
iget-object v3, v3, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v5, -0x1000000
invoke-virtual {v3, v5}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v5, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code.
Go to:
Calendar\smali\com\android\calendar\timeline\DayLayout$DayEventAdapter.smali
Look for:
.line 1007
iget-object v6, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 940
:cond_8
iget-object v3, p2, Lcom/android/calendar/timeline/DayLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v4, -0x1000000
invoke-virtual {v3, v4}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v4, -0x1000000 to const v4, -0x1000000 then change -0x1000000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\EventListWithStartTime.smali
Look for:
.line 107
iget-object v1, p0, Lcom/android/calendar/timeline/EventListWithStartTime;->mListView:Landroid/widget/ListView;
new-instance v2, Landroid/graphics/drawable/ColorDrawable;
const/high16 v3, -0x1000000
invoke-direct {v2, v3}, Landroid/graphics/drawable/ColorDrawable;-><init>(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x100000 to your favorite smali color code
Go to:
Calendar\smali\com\android\calendar\timeline\WeekLayout$WeekEventAdapter.smali
Look for:
.line 1342
iget-object v6, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v7, -0x1000000
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v7, -0x1000000 to const v7, -0x1000000 then change -0x1000000 to your favorite smali color code
Look for:
.line 1299
:goto_4
iget-object v2, p2, Lcom/android/calendar/timeline/WeekLayout$ViewHolder;->titleView:Landroid/widget/TextView;
const/high16 v3, -0x1000000
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
Change const/high16 v3, -0x1000000 to const v3, -0x1000000 then change -0x1000000 to your favorite smali color code
Click to expand...
Click to collapse
please help me sir
This mod disables the annoying warning popup for Airplane mode when selected from Quicksetting button.
SystemUI.apk smali edit:
com/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton.smali
Add the following code in BLUE:
Code:
invoke-virtual {v3, v4}, Landroid/view/Window;->setType(I)V
.line 245
:goto_1
[COLOR="Blue"] new-instance v5, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;
invoke-direct {v5, p0, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;Z)V
const v3, 0x0
invoke-virtual {v5, v3, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;->onClick(Landroid/content/DialogInterface;I)V
return-void[/COLOR]
iget-object v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mAlertDialog:Landroid/app/AlertDialog;
invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V
This code is designed to work only on S Advance 4.1.2.
If you want to adapt this code for another device, you need to change v and p values according to this method:
.method private showConfirmPopup(Z)V
Thanks to:
@tdunham for his Galaxy S5 Unified Mods Thread
@rompnit for the original code
isaak said:
This mod disables the annoying warning popup for Airplane mode when selected from Quicksetting button.
SystemUI.apk smali edit:
com/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton.smali
Add the following code in BLUE:
Code:
invoke-virtual {v3, v4}, Landroid/view/Window;->setType(I)V
.line 245
:goto_1
[COLOR="Blue"] new-instance v5, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;
invoke-direct {v5, p0, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;Z)V
const v3, 0x0
invoke-virtual {v5, v3, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;->onClick(Landroid/content/DialogInterface;I)V
return-void[/COLOR]
iget-object v3, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mAlertDialog:Landroid/app/AlertDialog;
invoke-virtual {v3}, Landroid/app/AlertDialog;->show()V
This code is designed to work only on S Advance 4.1.2.
If you want to adapt this code for another device, you need to change v and p values according to this method:
.method private showConfirmPopup(Z)V
Thanks to:
@tdunham for his Galaxy S5 Unified Mods Thread
@rompnit for the original code
Click to expand...
Click to collapse
Hello,
Would it be possible to explain how to adapt v and p values for a different device?
I mean how to determine correct values for v and p. I know of course how to decompile and recompile.
3to4 said:
Hello,
Would it be possible to explain how to adapt v and p values for a different device?
I mean how to determine correct values for v and p. I know of course how to decompile and recompile.
Click to expand...
Click to collapse
You need to check your values inside:
Code:
.method private showConfirmPopup(Z)V
In my specific case I found them here:
Code:
invoke-virtual {v3, v4}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;
move-result-object v3
const v4, 0x104000a
[COLOR="Blue"] new-instance v5, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;
invoke-direct {v5, p0, v2}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$4;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;Z)V
invoke-virtual {v3, v4, v5}, Landroid/app/AlertDialog$Builder;->setPositiveButton(ILandroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;[/COLOR]
Of course you'll need to adapt them according to the code's logic in OP.
Credits goes to @sagitt67 and @daxgirl .
Credits for toggle goes to @tdunham main guide is here and @asc1977 for the guide here big thanks to them.
In this Guide we'll modify framework-res.apk and services.jar
framework-res.apk:
Download framework-res.zip that is attached below, extract and copy it in your decompiled framework-res.apk folder
now open res/values/arrays.xml
find <string-array name="config_globalActionsList"> and add blue
Code:
<string-array name="config_globalActionsList">
<item>power</item>
<item>datamode</item>
<item>airplane</item>
<item>restart</item>
<item>lockdown</item>
<item>bugreport</item>
<item>users</item>
[COLOR="blue"]<item>rebootsafestrap</item>[/COLOR]
<item>emergencymode</item>
<item>subscreen</item>
</string-array>
now go to res/values/strings.xml at very end and add blue
Code:
<string name="wifi_extender_notification_title">Wi-Fi extender on</string>
<string name="wifi_extender_notification_message">Tap here to set up.</string>
<string name="config_tspstate_threshold" />
[COLOR="blue"]<string name="tw_ic_do_restart_safestrap">Reboot Safestrap</string>[/COLOR]
</resources>
done with framework-res.apk recompile
Services.jar:
download services.zip that is attached below, extract and copy it in your decompiled services.jar folder
open smali/com/android/server/policy/GlobalActions.smali
add blue line in # instance fields
Code:
.field private mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="blue"].field private mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[/COLOR]
.field mRestartIconResId:I
find .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog;
add blue
Code:
if-eqz v4, :cond_27b
const v4, 0x1080a58
.line 1642
:goto_11c
const v6, 0x104070e
.line 1639
move-object/from16 v0, p0
invoke-direct {v5, v0, v4, v6}, Lcom/android/server/policy/GlobalActions$21;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRestart:Lcom/android/server/policy/GlobalActions$SinglePressAction;
[COLOR="Blue"]new-instance v4, Lcom/android/server/policy/GlobalActions$99;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "drawable"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v5
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v0
const-string v1, "tw_ic_do_restart_safestrap"
const-string v2, "string"
const-string v3, "android"
invoke-virtual {v0, v1, v2, v3}, Landroid/content/res/Resources;->getIdentifier(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
move-result v6
move-object/from16 v0, p0
invoke-direct {v4, v0, v5, v6}, Lcom/android/server/policy/GlobalActions$99;-><init>(Lcom/android/server/policy/GlobalActions;II)V
move-object/from16 v0, p0
iput-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;[/COLOR]
.line 1688
invoke-static {}, Lcom/samsung/android/feature/SemCscFeature;->getInstance()Lcom/samsung/android/feature/SemCscFeature;
move-result-object v4
const-string/jumbo v5, "CscFeature_Common_ConfigBikeMode"
invoke-virtual {v4, v5}, Lcom/samsung/android/feature/SemCscFeature;->getString(Ljava/lang/String;)Ljava/lang/String;
Now next part is tricky, add lines in blue and changes in green
Code:
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
.line 1767
new-instance v4, Lcom/android/server/policy/GlobalActions$BugReportAction;
move-object/from16 v0, p0
invoke-direct {v4, v0}, Lcom/android/server/policy/GlobalActions$BugReportAction;-><init>(Lcom/android/server/policy/GlobalActions;)V
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
[COLOR="blue"]const/16 v6, 0x100
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;[/COLOR]
const/16 v6, [COLOR="Green"]0x200[/COLOR] [COLOR="Red"]#before was 0x100[/COLOR]
const/4 v7, 0x1
move-object/from16 v0, p0
invoke-direct {v0, v6, v4, v5, v7}, Lcom/android/server/policy/GlobalActions;->addDialogItemsIfEnabled(ILcom/android/server/policy/GlobalActions$Action;Ljava/util/ArrayList;Z)Z
now search for const-string/jumbo v4, "silent" and add blue line above it and green parts must match orange part
Code:
const-string/jumbo v4, "emergencymode"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_381
.line 1835
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mEmergency:Lcom/android/server/policy/GlobalActions$ToggleAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="orange"]goto_2d9[/COLOR] #look that green part match this
.line 1836
:cond_381
[COLOR="Blue"]const-string/jumbo v4, "rebootsafestrap"
invoke-virtual {v4, v11}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v4
if-eqz v4, :cond_3da
move-object/from16 v0, p0
iget-object v4, v0, Lcom/android/server/policy/GlobalActions;->mItems:Ljava/util/ArrayList;
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/server/policy/GlobalActions;->mRebootRecovery:Lcom/android/server/policy/GlobalActions$SinglePressAction;
invoke-virtual {v4, v5}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
goto/16 :[COLOR="Green"]goto_2d9 [/COLOR]
:cond_3da[/COLOR]
const-string/jumbo v4, "silent"
next part is missing in Android 7 services.jar so we need to readd it for mod
find .method private addCustomDialogItems(Landroid/graphics/drawable/BitmapDrawable;Ljava/lang/String;Landroid/content/Intent;ILjava/util/ArrayListZ
add this above method
Code:
[COLOR="Blue"].method static synthetic access$500(Lcom/android/server/policy/GlobalActions;)Landroid/content/Context;
.locals 1
iget-object v0, p0, Lcom/android/server/policy/GlobalActions;->mContext:Landroid/content/Context;
return-object v0
.end method[/COLOR]
thats it, recompile and push to phone
Note: For me one time i get after reboot a loop of phone restarts, only one time happens. If it happen i solved it with wipe dalvik-cache and cache
Credits goes to @TheDriller for this part in this guide
Note: no need to change the code in GlobalActions$99.smali already done
GlobalActions$99.smali:
find .method public onPress()V and replace blue lines with red one
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Red"]const-string v1, "recovery"
invoke-virtual {v0, v1}, Landroid/os/PowerManager;->reboot(Ljava/lang/String;)V[/COLOR]
to
Code:
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
[COLOR="Blue"]const-string v1, "su -c echo 1 > /data/.recovery_mode && su -c reboot now"
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v2
invoke-virtual {v2, v1}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process;[/COLOR]
Wow thia makes things so much easier
Sent from my SM-G950U using Tapatalk
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
SM-N950W
dillweedinc said:
This is different on the Note 8 isn't it? I got as far as the services jar .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; I input the blue text that was mentioned but I'm curious why in your sample does it not have .method private createDialog()Lcom/android/server/policy/GlobalActions$GlobalActionsDialog; before the blue text?
The Second batch of code with the green changes I had no idea where to input that and I couldn't find const/16 v6, 0x100 to change to 200 either
The step after that I was genuinely lost nothing matched what you had in your sample I felt like I was so close to getting it.
Thanks
Click to expand...
Click to collapse
I will check them soon.
Maybe @JavixKGD can help you as he asked for the mod and he got it working on Note 8.
It is important to specify that this mod only applies to Nougat, it needs to be updated for Oreo.
I am using Nougat 7.1.1 on a note 8 sm-n950w with me's samfail firmware bl1 - I sent him a message thanks! I see it built into another firmware that is available but id rather build it into me's samfail firmy since there is some issues to be wrinkled out in the other custom firmwares.
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
xSl33p said:
This thread is more currently active than the Safestrap one. I'm just here looking for more information on how to flash ROMS while keeping your others. Like do I activate that slot then start flashing and do you know if it's possible to use Slick ROM as one of the slots? I'm rooted with Partcyborg on bootloader v2
Click to expand...
Click to collapse
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
dillweedinc said:
Dont quote me on this but im pretty sure the slots arent 100% functional yet you can do backups and restore your system flash zips ect. , I know this thread is more active but you should really stick with the topic of the thread, your question would get answered there.
I got an answer from the guy you recommended afaneh92 thanks, it looks like I need to place the smalis in a different folder as they go over the limit, I dont have time right now but he also sent me his services .jar so I can see what the difference is I got some learning to do.
Thanks
Canadian Dilly.
Click to expand...
Click to collapse
Im working on update and some fixes for the mod, then will rewrite this guide in the Note 8 section.