[Guide][JB 4.2.2] How to Disable Signature our Grand Duos - Galaxy Grand Duos i9082 General

Hallo guys
Today i will share you a guides to disable signature your devices. I have test it and its work fine !
Disable signature is very important for the modder or Developers, and will be more flexible to edit the system files.
Ok.. Lest check it out
Whats you need?
- DEODEXED
Your rom must have been deodexed. Or you can just deodex a services.jar, but I think it's better to deodexing it all (framework & app)
- Apktool or Apkmultitool
I use a Apktool from this thread
https://forum.xda-developers.com/showthread.php?t=2195680
Don't forget to hit thanks button to him
- Text Editor
I use Notepad++
- services.jar (you can found in system/framework)
- Knowlodge about editing .smali files
Click to expand...
Click to collapse
How to Disable Signatures?
- Decompile services.jar
- Go to /smali/com/android/server/pm and open PackageManagerService.smali
- Search this code
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
then replace that method with this code from .method to the .end method
Code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
.locals 7
const-string p0, "DSA:"
const-string p1, "Skip signatures check"
invoke-static {p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
const/4 v6, 0x0
return v6
.end method
- Save, Recompile, Sign and push to System :laugh:
Click to expand...
Click to collapse
Easy right?
Any question? Just ask to me in this thread
Credit and thanks to:
- Archiveandroid
- Uncle Dug
- [email protected]

Related

[Q] Editing Google Talk for Defy

I tried to decompile the Talk.apk to try and bypass the check for a front facing camera
I got it decompiled using the tools at
http://forum.xda-developers.com/showthread.php?t=1053227
Looking through the smali code, I found something, which I'm guessing is a check for a front facing camera
Talk\smali\com\google\android\videochat\CameraManager.smali
Code:
iget-boolean v1, v1, Lcom/google/android/videochat/CameraManager$CameraSpecificSettings;->cameraIsFrontFacing:Z
if-eqz v1, :cond_4
I thought if I just put the code at "cond_4" it should bypass the check (again pure guessing)
Code:
:cond_4
add-int/lit8 v0, v0, 0x1
But I just can't get it to recompile again with my changes made. If I take the recompiled APK and decompile it again, the original code remains
Can anyone help either with the recompiling, or just try it on their system?
efpob said:
I tried to decompile the Talk.apk to try and bypass the check for a front facing camera
I got it decompiled using the tools at
http://forum.xda-developers.com/showthread.php?t=1053227
Looking through the smali code, I found something, which I'm guessing is a check for a front facing camera
Talk\smali\com\google\android\videochat\CameraManager.smali
Code:
iget-boolean v1, v1, Lcom/google/android/videochat/CameraManager$CameraSpecificSettings;->cameraIsFrontFacing:Z
if-eqz v1, :cond_4
I thought if I just put the code at "cond_4" it should bypass the check (again pure guessing)
Code:
:cond_4
add-int/lit8 v0, v0, 0x1
But I just can't get it to recompile again with my changes made. If I take the recompiled APK and decompile it again, the original code remains
Can anyone help either with the recompiling, or just try it on their system?
Click to expand...
Click to collapse
Running CM7?
Try it:
http://forum.xda-developers.com/showthread.php?p=33506827#post33506827
Thanks, but I'm using CM10 at the moment

[MOD] Stock Camera apk

WARNING: Use the apks at your own risk!!!
I am not responsible for any bricked devices
You'll need root for this to work
To backup original camera apk
Code:
adb pull /system/app/OppoGallery2.apk
adb pull /system/app/OppoGallery2.odex
To Install (after you backed up the older version):
Download the version, rename it to OppoGallery2.apk
Code:
adb push OppoGallery2.apk /sdcard/
adb shell
su
mount -o remount,rw /system
#remove older version
rm /system/app/OppoGallery2.apk
#if the file below exists
rm /system/app/OppoGallery2.odex
cp /sdcard/OppoGallery2.apk /system/app/
To revert to older version(or stock firmware version)
Code:
adb push OppoGallery2.apk /sdcard/
#if reverting to stock firmware version
adb push OppoGallery2.odex /sdcard/
adb shell
su
mount -o remount,rw /system
cp /sdcard/OppoGallery2.apk /system/app/
#if reverting to stock firmware version
cp /sdcard/OppoGallery2.odex /system/app/
Releases:
v2 - 2013-4-6
v1 - 2013-4-6
Changelog
v2 - 2013-4-6 - Based off the X909EN_13_130328 firmware, svn2611
Code:
Changelog:
- Enabled more values for timer(3, 5, 10, 20)s
- Known bugs:
---- GUI Icons for all timers will have a 5 in upper right corner
---- During countdown, if timeleft > 5s, it'll flash a "5" Icon. If timeleft < 5s, it'll flash the correct Icon (eg 4s left = "4" icon)
Compatibility: should work with any rom
[url=http://d-h.st/knx]Download[/url] | [url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/OppoGallery2.v2.apk]Mirror[/url]
[url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/v2.camera.timer.diff]Smali Code Diffs[/url]
v1 - 2013-4-6 - Based off the X909EN_13_130328 firmware, svn2611
Code:
Changelog:
- Enabled ISO toggle for camera (Settings for them were present, but not enabled)
<string name="pref_camera_iso_title">Select ISO</string>
<string name="pref_camera_iso_entry_auto">AUTO</string>
<string name="pref_camera_iso_entry_isodeblur">ISO Auto(HJR)</string>
<string name="pref_camera_iso_entry_iso100">ISO100</string>
<string name="pref_camera_iso_entry_iso200">ISO200</string>
<string name="pref_camera_iso_entry_iso400">ISO400</string>
<string name="pref_camera_iso_entry_iso800">ISO800</string>
<string name="pref_camera_iso_entry_iso1600">ISO1600</string>
Compatibility: should work with any rom
[url=http://d-h.st/3ER]Download[/url] | [url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/OppoGallery2.v1.apk]Mirror[/url]
[url=http://files.ngvincent.com/android/oppo-find-5/misc/mods/camera/v1.camera.iso.diff]Smali Code Diffs[/url]
Version 1:
I don't know why Oppo didn't enable ISO selection in the camera app
they added the string values and icons, but didn't add the code to display the menu system
The selection of ISO values seem to work: ISO 1600 seems grainer than any other mode... but isn't as grainy as I thought 1600 would be
Great Mod!
Thanks!
Today I was trying to decompile this APK with APK Manager v5. but i get error:
{
"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"
}
Can you give me any tips? Thanks in advance.
I guess I have to pull res framework?
Update:
I Pulled framework-res.apk, and went with "10.Decompile APK (With Dependences)" using framework-res.apk but still get this error....
NODO-GT said:
Great Mod!
Thanks!
Today I was trying to decompile this APK with APK Manager v5. but i get error:
Can you give me any tips? Thanks in advance.
I guess I have to pull res framework?
Update:
I Pulled framework-res.apk, and went with "10.Decompile APK (With Dependences)" using framework-res.apk but still get this error....
Click to expand...
Click to collapse
I use linux tools... maybe my guide will be a little useful.
don't think I had any problems with apktool
https://git.ngvincent.com/projects/oppo-x909-cm10/wiki/Decompile-apk
EDIT: did you pull framework-res.odex ?
paperWastage said:
I use linux tools... maybe my guide will be a little useful
https://git.ngvincent.com/projects/oppo-x909-cm10/wiki/Decompile-apk
Click to expand...
Click to collapse
I switched APK Manager to APK Tool...
When I decompile, I don't get smali folder... Will keep looking how to decompile this properly.
NODO-GT said:
I switched APK Manager to APK Tool...
When I decompile, I don't get smali folder... Will keep looking how to decompile this properly.
Click to expand...
Click to collapse
the firmware isn't deoxed.... so apktool decompile won't give you the .smali
as I mentioned in my edited post, for the framework, you'll need to copy the .odex as well (and use baksmali to decompile odex to .smail, then use smali to compile .smali to .dex)
same for decompiling any applications
can you please remove the "low battery check" that disable flash if the battery is lower than 20%? Thanks.
badworker said:
can you please remove the "low battery check" that disable flash if the battery is lower than 20%? Thanks.
Click to expand...
Click to collapse
hmm, they changed some stuff since the last time I decompiled their Gallery apk
give me a few hours to reupdate everything
EDIT: here is a build that I haven't tested (I'm using CM10.1-based roms)
this is taken from the latest stock oppo beta rom - X909EN_11_130629_Beta
contains only your requested change. let me know if it works? (same instructions on my original post)
(original file allows flash if battery >= 15%. I've set it to allow flash if battery > 0%)
http://d-h.st/wQT
paperWastage said:
hmm, they changed some stuff since the last time I decompiled their Gallery apk
give me a few hours to reupdate everything
EDIT: here is a build that I haven't tested (I'm using CM10.1-based roms)
this is taken from the latest stock oppo beta rom - X909EN_11_130629_Beta
contains only your requested change. let me know if it works? (same instructions on my original post)
(original file allows flash if battery >= 15%. I've set it to allow flash if battery > 0%)
http://d-h.st/wQT
Click to expand...
Click to collapse
Thanks! I'll give it a try asap.
Btw, I was trying to enable the ISO selection in the newer firmware (>=130531) but they are so different from the 130328 where you made modification. I am able to remove the flash check (with a lot of work, i'm learning ) but when I put your modification at the .smali files (with attenction to the .line and so on) the application force close itself. It's frustrating but i must try and retry till I get it working. So the request is: have you some usefull advices for me?
Thanks again for your work!
Tapatalked via Oppo Find 5
badworker said:
Thanks! I'll give it a try asap.
Btw, I was trying to enable the ISO selection in the newer firmware (>=130531) but they are so different from the 130328 where you made modification. I am able to remove the flash check (with a lot of work, i'm learning ) but when I put your modification at the .smali files (with attenction to the .line and so on) the application force close itself. It's frustrating but i must try and retry till I get it working. So the request is: have you some usefull advices for me?
Thanks again for your work!
Tapatalked via Oppo Find 5
Click to expand...
Click to collapse
smali sucks .... it's hard to apply patches for smali. these guys manage to auto-patch smali code, but usually the target is roughly the same (~android AOSP/AOKP/CM10.1 base with the same code)... if I have time, I'll take a look to see how they organize the smali patcher
you need to understand assembly (smali opcodes), know how to read it, and how java code relates to it
maybe a small tutorial would help: the flash check disabler code . Not sure how you modified the code, but here's how my thought process went
after decompiling to source code, you'll figure out how to solve the problem: have this function return false all the time
you want the function to return false (i.e. flash IS NOT forbidden)
I decide to target that (if i>=15) check (it checks if you have at least 15% battery left)
com/android/camera/Camera.java
Code:
private boolean isForbidFlash()
{
boolean flag = true;
File file = new File("/sys/class/power_supply/battery/capacity");
if(!file.exists())
return false;
FileReader filereader;
int i;
char c;
filereader = new FileReader(file);
char ac[] = new char[3];
filereader.read(ac);
i = Integer.valueOf(String.valueOf(ac).substring(0, 2)).intValue();
if(ac[0] != '1' || ac[1] != '0')
break MISSING_BLOCK_LABEL_98;
c = ac[2];
if(c == '0')
i = 100;
try
{
filereader.close();
}
catch(Exception exception1)
{
try
{
exception1.printStackTrace();
}
catch(Exception exception)
{
exception.printStackTrace();
Log.e("OppoCamera", (new StringBuilder()).append("isForbidFlash: e = ").append(exception).toString());
return false;
}
}
[B]if(i >= 15)[/B]
flag = false;
return flag;
}
smali code equivalent of the function above
Code:
.method private isForbidFlash()Z
.registers 9
.prologue
const/16 v7, 0x30
const/4 v0, 0x1
const/4 v1, 0x0
.line 4942
:try_start_4
new-instance v2, Ljava/io/File;
const-string v3, "/sys/class/power_supply/battery/capacity"
invoke-direct {v2, v3}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 4943
invoke-virtual {v2}, Ljava/io/File;->exists()Z
move-result v3
if-nez v3, :cond_12
.line 4969
:goto_11
return v1
.line 4946
:cond_12
new-instance v3, Ljava/io/FileReader;
invoke-direct {v3, v2}, Ljava/io/FileReader;-><init>(Ljava/io/File;)V
.line 4947
const/4 v2, 0x3
new-array v4, v2, [C
.line 4948
invoke-virtual {v3, v4}, Ljava/io/FileReader;->read([C)I
.line 4950
invoke-static {v4}, Ljava/lang/String;->valueOf([C)Ljava/lang/String;
move-result-object v2
.line 4951
const/4 v5, 0x0
const/4 v6, 0x2
invoke-virtual {v2, v5, v6}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object v2
invoke-static {v2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v2
invoke-virtual {v2}, Ljava/lang/Integer;->intValue()I
move-result v2
.line 4952
const/4 v5, 0x0
aget-char v5, v4, v5
const/16 v6, 0x31
if-ne v5, v6, :cond_42
const/4 v5, 0x1
aget-char v5, v4, v5
if-ne v5, v7, :cond_42
const/4 v5, 0x2
aget-char v4, v4, v5
:try_end_3e
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_3e} :catch_50
if-ne v4, v7, :cond_42
.line 4953
const/16 v2, 0x64
.line 4956
:cond_42
:try_start_42
invoke-virtual {v3}, Ljava/io/FileReader;->close()V
:try_end_45
.catch Ljava/lang/Exception; {:try_start_42 .. :try_end_45} :catch_4b
.line 4961
:goto_45
const/16 v3, 0xf
if-ge v2, v3, :cond_6d
:goto_49
move v1, v0
goto :goto_11
.line 4957
:catch_4b
move-exception v3
.line 4959
:try_start_4c
invoke-virtual {v3}, Ljava/lang/Exception;->printStackTrace()V
:try_end_4f
.catch Ljava/lang/Exception; {:try_start_4c .. :try_end_4f} :catch_50
goto :goto_45
.line 4963
:catch_50
move-exception v0
.line 4965
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
.line 4966
const-string v2, "OppoCamera"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "isForbidFlash: e = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-static {v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_11
:cond_6d
move v0, v1
.line 4961
goto :goto_49
.end method
if you look at the smali code and walk through/compare it with the java code, you'll see different ways to tackling the problem
A) just simply return v1 (=FALSE) on the first line. side effects: you bypass the try/catch statements, dunno if you'll break anything
B) - my approach
the (if i>= 15) check). 0xf hex is the same as 15 decimal.
Change 0xf to 0x0, so it'll check if (i >= 0), i.e. at least 0% battery
Code:
.line 4961
:goto_45
const/16 v3, [B]0xf[/B]
if-ge v2, v3, :cond_6d
C) you could also target the assignment of the flag inside the if/else statement.
#assignments of the registers at the beginning of function
Code:
const/4 v0, 0x1 # true
const/4 v1, 0x0 # false
#what happens inside the condition=true block, until the return statement. condition = enough battery
the "#" lines are my comments
Code:
if-ge v2, v3, :cond_6d
#jump to :cond_6d
:cond_6d
move v0, v1 #v0 = v1 , both = FALSE(since v1 was initialize to FALSE)
.line 4961
goto :goto_49
#jump to the :goto_49 tag
:goto_49
move v1, v0 # v1 = v0, both = FALSE
goto :goto_11
#jump to the :goto_11 tag
:goto_11
return v1 # return v1 = FALSE <- result we want
#what happens inside the condition=false block, until the return statement. condition = not enough battery
Code:
if-ge v2, v3, :cond_6d # we don't jump, since condition failed. follow the next line
:goto_49
move v1, v0 # v1 = v0, both = TRUE(since v0 was initialized to TRUE)
goto :goto_11
#jump to the :goto_11 tag
:goto_11
return v1 # return v1 = TRUE <- flash forbidden
you could change v0 to initialize to FALSE as well... not sure about the side effects though
(I thought they enabled ISO selection in the latest firmware anyway?)
for the ISO selection, here's how I did it
the compiled apk already had the values, arrays, setup for the ISO.
Code:
res/xml/camera_preferences.xml:16: <IconListPreference camera:title="@string/pref_camera_iso_title" camera:key="[U][B]pref_camera_iso_key[/B][/U]" camera:defaultValue="@string/pref_camera_iso_default" camera:entryValues="@array/pref_camera_iso_entryvalues" camera:entries="@array/pref_camera_iso_entries" camera:singleIcon="@drawable/oppo_ic_iso" />
they just didn't enable the list preference in the code.
So, I looked at where they initialized that settings page, and add the pref_camera_iso_key into that array.
com/android/camera/Camera.java
Code:
as1 = (new String[] {
"pref_camera_picturesize_key", "pref_camera_time_lapse_key", "pref_camera_sound_key", "pref_camera_smile_key", "pref_camera_recordlocation_key", "pref_camera_guideline_key", "pref_camera_restore_default"
});
I need one new element inside that list
smali change
Code:
- const/4 v0, 0x7
+ const/16 v0, 0x8 #need to increase size of the list from 0x7 to 0x8
new-array v0, v0, [Ljava/lang/String;
@@ -3838,6 +3838,12 @@
const/4 v2, 0x6
+ const-string v3, "pref_camera_iso_key" # put the inserted value before pref_camera_restore_default
+
+ aput-object v3, v0, v2
+
+ const/4 v2, 0x7
+
const-string v3, "pref_camera_restore_default"
aput-object v3, v0, v2
For the timer change:
you want to change this function
Camera.java
Code:
public void onSharedPreferenceChanged()
{
Debugger.d("OppoCamera", "onSharedPreferenceChanged");
if(super.mPaused)
return;
if("[B]on[/B]".equals(mPreferences.getString("pref_camera_time_lapse_key", getString(0x7f0b0177))))
mTimerSnapShotManager.setTime([B]5[/B]);
instead of just one if statement that checks if "on" selected-> 5 second, you want
if "3" -> 3 seconds
if "5" -> 5 seconds
if "10" -> 10 seconds
if "20" -> 20 seconds
(i mean ideally, you want a slider bar on the preferences page that allows you to set any time you want... but that change is extremely difficult, as you need to touch multiple parts of the java class)
therefore, you need two things
smali: duplicate the entire [if statement and mTimerSnapShotManager.setTime()] section, modify "on" and "5" variables accordingly
arrays.xml and other *.xml changes: add in entries for the 3, 5, 10, 20, remove the "on" entry
then you go test... then you find out the app crashes.
you debug, and figure out that the program flashes the "5" icon when 5s left, "4" icon when 4s left..... if there are 20s left, it fails to load the "20" icon (since it doesn't exist), and crashes
it's too much trouble to make your own 6-20.jpg, insert into the package... it's extremely difficult to replace the [load "x" icon when x seconds left] with [somehow display the text "x" when x seconds left, instead of loading an icon]
so, for the icon-loading part, check if it's more than 5. If it is, set the variable to 5, load the 5 icon
Code:
+ add-int/lit8 v2, v0, -0x5
+
+ if-ltz v2, :cond_reset
+
+ const/4 v0, 0x4
+
+ :cond_reset
GREAT!! for the flash check the 'B way' si exactly what I did. I have a basic knowledge of assembly programming (I'm also a C,C# developer) but how the hell did you get the java code? I deodexed the apk with universal deodexer and decompiled with apktool, it's not the right way to do it?
Thanks for the very detailed explaination! It helps me so much!
Tapatalked via Oppo Find 5
badworker said:
GREAT!! for the flash check the 'B way' si exactly what I did. I have a basic knowledge of assembly programming (I'm also a C,C# developer) but how the hell did you get the java code? I deodexed the apk with universal deodexer and decompiled with apktool, it's not the right way to do it?
Thanks for the very detailed explaination! It helps me so much!
Tapatalked via Oppo Find 5
Click to expand...
Click to collapse
there are smali -> java source code decompilers. typcially, they don't give you a clean source code that actually compiles (some stuff fails to decompile properly), but it's good enough to read (better than reading smali)
(after doing deodex + apktool decompile)i use d2j-dex2jar to convert from smali-> jar
then either decompile-jad or jd-gui to convert from jar-> java source code. Sometimes, one of the tool fails to convert and I'll have to use the other
other decompilers: androguard (haven't tried this one yet)
with the source code, you can
1) read it, and make changes correspondingly in smali (this is what I do)
2) try to make the entire thing compilable, and then make modifications in java source code
3) make relevant parts of it compilable (easier than (2), make changes, compare the diffs in smali, merge the diffs into the original smali
I haven't tried steps 2, 3. those two steps are probably useful if you are making major changes(more than 10 lines)
Any chance that i can use the Oppo Camera ona Rom like Illusion?
Bump. Is this dead also?
Sent from my Find 5 using Tapatalk
killerskincanoe said:
Bump. Is this dead also?
Sent from my Find 5 using Tapatalk
Click to expand...
Click to collapse
probably
still have my Find 5, but not really using it... haven't kept up with the latest CM/ColorOS releases, so this apk probably doesn't work on the new releases
If the new APKs don't contain these features, do it yourself? I've posted how to do this hack in smali...

How do I disable Signature verification

Hi All , Im trying to install ROMS but keep getting signature verification failed , I am running SUPERSU and ran CF-Auto-Root-jflte-jfltexx-gti9505.tar.md5 using ODIN , but when I reboot my device into recovery I get : signature verification failed.
I dont have any toggle signature verification , so any ideas how I get round this ?
Thank you , any help appreciated as im pulling my hair out
Stephen
please post this in Q&A section..
Install a custom recovery. That will fix the problem. I had the same problem and i fixed installing custom recovery.
Galaxy S4 i9505 with Tapatalk 4
Done
Thanks
Service.jar
/smali/com/android/server/pm/PackageManagerService.smali
search
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI​
change all method
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 7
const-string p0, "DSA:"
const-string p1, "Skip signatures check"
invoke-static {p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/StringI
const/4 v6, 0x0
return v6
.end method​
BoBCatRoM said:
Service.jar
/smali/com/android/server/pm/PackageManagerService.smali
search
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI​
change all method
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 7
const-string p0, "DSA:"
const-string p1, "Skip signatures check"
invoke-static {p0, p1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/StringI
const/4 v6, 0x0
return v6
.end method​
Click to expand...
Click to collapse
you're welcome
Requested thread to be moved
Thread moved.
P.S you know a simpler version that doesn't waste resources outputting stuff to logcat is just:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 1
const/4 v0, 0x0
return v0
.end method​The log stuff is mainly used by devs as a sort of hidden "easter egg" so its easier to spot kangs.
DSA said:
you're welcome
Requested thread to be moved
Click to expand...
Click to collapse
I have tried that on my I9505 and got a bootloop with the message "Scale" at the Android is loading screen. Here is my code:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.registers 9
const/4 v6, 0x0
const-string v3, "PackageManager"
const-string v4, "Skip signature check."
invoke-static {v3, v4}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/StringI
return v6
.end method
I am using Android Multitool to rebuild the jar. What could be wrong?
Thanks.
Use the entire method provided (Mine or Jonny), it will work fine (im using it on my own i9505)
And just use smali/baksmali, not any multitool thing
DSA said:
Use the entire method provided (Mine or Jonny), it will work fine (im using it on my own i9505)
And just use smali/baksmali, not any multitool thing
Click to expand...
Click to collapse
Thanks for the indications, mate, but it is still a no go. Same result. Here is step by step what I did:
-Configuration I9505, MK9, GoldenEye ROM
1) Extracted the classes.dex from service.jar using Winrar
2) Decompiled using baksmali:
java -jar baksmali-2.0.2.jar -l -b -o classout/ classes.dex (I am using latest jar found of baksmali)
3) Edited the PackageManagerService,smali file under /com/android/server/pm/ like this:
.method static compareSignatures([Landroid/content/pm/Signature;[Landroid/content/pm/SignatureI
.locals 7
const/4 v0, 0x0
return v0
.end method
4) Compile back using smali:
java -Xmx512M -jar smali-2.0.2.jar classout/ -o new-classes.dex (Same here, using latest jar version of smali)
5) Renamed the new-classes.dex into classes.dex and put it back into the services.jar using Winrar and 0 compression (store option)
6) Overwrite existing service.jar with the modified service.jar on my phone under /system/framework
7) Reboot
8) Bootlooop....
Which step(s) could have gone wrong?
i was under the impression this was for a stock rom - i don't know what the chef of that rom has done so it would be best to ask him
DSA said:
i was under the impression this was for a stock rom - i don't know what the chef of that rom has done so it would be best to ask him
Click to expand...
Click to collapse
Good suggestion. I guess I will also give it a try with a stock ROM.
signature verification removal
hello, i have videocon a15...i want to install custom rom.but while installing from sd card signature verification is failed appears.what to do ??help me plzzzzz

[XPOSED][5.1.1][Z5 Home Launcher] AutoRotation

Hey Guys,
after a few hours of searching and learning how xpose is working i did my first module.
This module will enable auto rotation for the Z5 Stock Launcher (not tested on others...).
Install instructions
1. download attached Z5LauncherAutoRotate.apk and put it on your phone
2. install apk
3. enable module in xposed installer
4. restart phone
Sourcecode
Everyone can use my Sourcecode in his own modules, please short message and a mention of me in the credits.
Have fun
Nice work, works flawless on my Z2
Keep it up the good work!!
Thx... Works good on my XZ C6603
Thank you man.. ?
__BJ__ said:
Hey Guys,
after a few hours of searching and learning how xpose is working i did my first module.
This module will enable auto rotation for the Z5 Stock Launcher (not tested on others...).
Install instructions
1. download attached Z5LauncherAutoRotate.apk and put it on your phone
2. install apk
3. enable module in xposed installer
4. restart phone
Sourcecode
Everyone can use my Sourcecode in his own modules, please short message and a mention of me in the credits.
Have fun
Click to expand...
Click to collapse
could you explain me how to do this changes straigh in the apk?. cheers
juanpirulo said:
could you explain me how to do this changes straigh in the apk?. cheers
Click to expand...
Click to collapse
Here are some solutions. (decompiled apk needed)
My solution is not the best, but resource replacement didn't work for me and I don't know why but thats a xposed thing... So if you want my solution find the following method in com.sonymobile.home.HomeFragment:
Code:
private static void setRequestedOrientationIfChanged(Activity activity, int i)
{
if (activity.getRequestedOrientation() != i)
{
activity.setRequestedOrientation(i);
}
}
and change it to:
Code:
private static void setRequestedOrientationIfChanged(Activity activity, int i)
{
i = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
if (activity.getRequestedOrientation() != i)
{
activity.setRequestedOrientation(i);
}
}
Better solution find the bool values in the resources should /res/values/bool.xml and change portrait_only to false
Code:
<bool name="portrait_only">false</bool>
You could also change mPortraitModeOnly to false on the onCreate method in HomeFragment. There is the position where it gets this resource.
NOTICE FOR XPERIA PHONES: If you change the launcher apk you have to disable signature verification! If you do not the system doesn't accept this apk and your launcher won't work. You can patch service.jar or use superusermod from xperia xposed.
I found theses lines are hidden the icon to autorotate on C:\Users\smali\com\sonymobile\home\settings\HomeSettingsActivity$HomeSettingsFragment.smali
Code:
.line 59
.local v0, "preferenceScreen":Landroid/preference/PreferenceScreen;
invoke-virtual {p0}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f0c0005
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v1
if-eqz v1, :cond_0
.line 60
const-string v1, "user_settings_allow_auto_rotation"
invoke-virtual {p0, v1}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 71
:cond_0
invoke-direct {p0, v0}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->initSummary(Landroid/preference/Preference;)V
If i simple delete these lines icon shows up on home settings but doesnt rotate. Can i change in here any value?. cheers
juanpirulo said:
I found theses lines are hidden the icon to autorotate on C:\Users\smali\com\sonymobile\home\settings\HomeSettingsActivity$HomeSettingsFragment.smali
Code:
.line 59
.local v0, "preferenceScreen":Landroid/preference/PreferenceScreen;
invoke-virtual {p0}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->getResources()Landroid/content/res/Resources;
move-result-object v1
const v2, 0x7f0c0005
invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v1
if-eqz v1, :cond_0
.line 60
const-string v1, "user_settings_allow_auto_rotation"
invoke-virtual {p0, v1}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 71
:cond_0
invoke-direct {p0, v0}, Lcom/sonymobile/home/settings/HomeSettingsActivity$HomeSettingsFragment;->initSummary(Landroid/preference/Preference;)V
If i simple delete these lines icon shows up on home settings but doesnt rotate. Can i change in here any value?. cheers
Click to expand...
Click to collapse
Nope won't work. Sorry i can't read smali file
If you just change the resource file for boolean values and set portrait_only to false the settings for auto rotation will display automaticaly! The launcher hides the auto rotation settings in its preference screen if portrait_only is true (what it is!). So no need to go in the sources, just change the resources!
I read many of the source files from the launcher and it is completly ignoring any settings about rotation if this portait_only is true
__BJ__ said:
Nope won't work. Sorry i can't read smali file
If you just change the resource file for boolean values and set portrait_only to false the settings for auto rotation will display automaticaly! The launcher hides the auto rotation settings in its preference screen if portrait_only is true (what it is!). So no need to go in the sources, just change the resources!
I read many of the source files from the launcher and it is completly ignoring any settings about rotation if this portait_only is true
Click to expand...
Click to collapse
The thing is that portrait_only is allready set on false and it doesnt come up the settings for autorotate. thats why i dont understand
Code:
bool name="abc_action_bar_embed_tabs_pre_jb">false</bool>
<bool name="abc_config_allowActionMenuItemTextWithIcon">false</bool>
<bool name="actionbar_use_vertical_mode">false</bool>
<bool name="desktop_pagination_autohide">false</bool>
<bool name="abc_action_bar_embed_tabs">true</bool>
<bool name="portrait_only">false</bool>
<bool name="autoRotate">false</bool>
<bool name="is_large_screen">false</bool>
<bool name="support_alternate_resources">false</bool>
<bool name="transparent_status_and_nav_bar">true</bool>
<bool name="cui_grid_show_header">false</bool>
juanpirulo said:
The thing is that portrait_only is allready set on false and it doesnt come up the settings for autorotate. thats why i dont understand
Code:
bool name="abc_action_bar_embed_tabs_pre_jb">false</bool>
<bool name="abc_config_allowActionMenuItemTextWithIcon">false</bool>
<bool name="actionbar_use_vertical_mode">false</bool>
<bool name="desktop_pagination_autohide">false</bool>
<bool name="abc_action_bar_embed_tabs">true</bool>
<bool name="portrait_only">false</bool>
<bool name="autoRotate">false</bool>
<bool name="is_large_screen">false</bool>
<bool name="support_alternate_resources">false</bool>
<bool name="transparent_status_and_nav_bar">true</bool>
<bool name="cui_grid_show_header">false</bool>
Click to expand...
Click to collapse
Did you rebuild the apk? Because I've seen a decompiler which couldn't decompile the boolean resources correctly at setted them to false per default.
But as you can see also in the smali file its reading the resources and the portrait_only and if it is false it would display the settings.
__BJ__ said:
Did you rebuild the apk? Because I've seen a decompiler which couldn't decompile the boolean resources correctly at setted them to false per default.
But as you can see also in the smali file its reading the resources and the portrait_only and if it is false it would display the settings.
Click to expand...
Click to collapse
Is set originally false as default, on home-release form z1 doesnt shows a line like portrait_only and the settings are ok, thats why i am thinking must be smali code that change this value. Thanks anyway for your help. cheers
juanpirulo said:
Is set originally false as default, on home-release form z1 doesnt shows a line like portrait_only and the settings are ok, thats why i am thinking must be smali code that change this value. Thanks anyway for your help. cheers
Click to expand...
Click to collapse
The Xperia Xposed module only replace the resource portrait_only and its working too. I did also read the resource while developing the module here and if i logged the value everytime there was true in the console. And I read the resource not the variable in the class!

[Guide][JAN/26] Show/Hide Brightness Slider on notification Quick settings on CM13

Hey there,
first off, I am neither an experienced android-developer in any way nor am I able to support any questions regarding to this tutorial. Im new to this stuff, but kinda good in figuring stuff out, and I made it work. All Props go out to venkat kamesh, a guy over in aSony-Forum, who did a great job in implementing a "Show/Hide Brightness Slider"-Feature; one of the features I wait for the most when it comes to cm13.- The static slider is useless to me, cause I use the "cm hidden slider", this feature where you just swype over the status bar to adjust brigthness.
This workflow was reproducable on 2 international m8 devices running cm13 from Jan. 25, besides the Team M8 Kernel. In the following I will fullquote the original developer, with red comments in brackets on the spots where something differs to the cm13 m8 version of the guide.
As I said, Im not very experienced, and dont really understand everything what is happening there (especially regarding security when it comes to private/protected methods and stuff), so please be kind and feel free to optimize my work as much as you want/can
venkat kamesh said:
Hello guys
Happy new Year for first
This is my first tut in This new year 2016
All you need is Deodexed SystemUI.apk and Settings.apk
1. Decompile SystemUI.apk
2. Open SystemUI.apk/smali/com/android/systemui/qs/QSPanel.smali
3. Find this code (just look for the method name, for me the method was protected, not private)
Code:
.field private mBrightnessPaddingTop:I
Below that add this code
Code:
.field private mBrightnessSliderEnabled:Z
4. Search for this Method
Code:
.method private setDetailRecord(Lcom/android/systemui/qs/QSPanel$Record;)V
and above that method add this complete method
Code:
.method private isBrightnessSliderEnabled()I
.locals 4
const/4 v3, 0x0
iget-object v0, p0, Lcom/android/systemui/qs/QSPanel;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v1, "brightness_slider_show"
const/4 v2, 0x1
invoke-static {v0, v1, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_0
const/4 v3, 0x1
:cond_0
iput-boolean v3, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
return v3
.end method
5. Search for this method (just look for the method name, for me the method was protected, not private)
Code:
.method private showDetail(ZLcom/android/systemui/qs/QSPanel$Record;)V
Above that method, add this method (for me, there already was a method called "showBrightnessSlider", but I wasnt able to get it to work with the default one, so here, you have to delete the whole existing "showBrightnessSlider" method and paste the new one. Also, the guide states a private method here, but as the following steps include an invoke-virtual, we have to change it to protected)
Code:
.method private [COLOR="red"](protected)[/COLOR] showBrightnessSlider()Z
.locals 5
const/16 v3, 0x8
const/4 v2, 0x0
const v1, 0x7f10012e (for me, as there already was a method called "showBrightnessSlider", I didnt use this hex value here, but instead looked my own actual id up in SystemUI:/res/value/public, then search for "brightness_slider" and use this id)
invoke-direct {p0}, Lcom/android/systemui/qs/QSPanel;->isBrightnessSliderEnabled()I
move-result v4
invoke-virtual {p0, v1}, Lcom/android/systemui/qs/QSPanel;->findViewById(I)Landroid/view/View;
move-result-object v0
check-cast v0, Lcom/android/systemui/settings/ToggleSlider;
if-eqz v4, :cond_0
iget-boolean v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
if-eqz v1, :cond_0
iget-object v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessView:Landroid/view/View;
invoke-virtual {v1, v2}, Landroid/view/View;->setVisibility(I)V
invoke-virtual {v0, v2}, Lcom/android/systemui/settings/ToggleSlider;->setVisibility(I)V
:goto_0
invoke-virtual {p0}, Lcom/android/systemui/qs/QSPanel;->updateResources()V
iget-boolean v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessSliderEnabled:Z
return v1
:cond_0
iget-object v1, p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessView:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
invoke-virtual {v0, v3}, Lcom/android/systemui/settings/ToggleSlider;->setVisibility(I)V
goto :goto_0
.end method
6. Now Look for this Code (for me the whole code from step 6 was already there, so dont change anything here)
Code:
if-eqz p1, :[COLOR="red"]cond_3[/COLOR]
.line 216
iget-object [COLOR="Red"]v2[/COLOR], p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessController:Lcom/android/systemui/settings/BrightnessController;
Add the code above the .line 216 ( this .line 216 will not be same with all devices ) (as stated above, the here included invoke was already there for me, but with a virtual invoke; but I didnt change a thing here)
Code:
invoke-direct [COLOR="red"][/COLOR]{p0}, Lcom/android/systemui/qs/QSPanel;->showBrightnessSlider()Z
move-result [COLOR="red"]v2[/COLOR]
if-eqz [COLOR="red"]v2[/COLOR], :[COLOR="red"]cond_3[/COLOR]
Finally it looks like
Code:
if-eqz p1, [COLOR="blue"]:cond_3[/COLOR]
[COLOR="Red"] invoke-direct (invoke-virtual){p0}, Lcom/android/systemui/qs/QSPanel;->showBrightnessSlider()Z
move-result [COLOR="blue"]v2[/COLOR]
if-eqz [COLOR="blue"]v2[/COLOR], [COLOR="blue"]:cond_3[/COLOR][/COLOR]
.line 216
iget-object [COLOR="Blue"]v2[/COLOR], p0, Lcom/android/systemui/qs/QSPanel;->mBrightnessController:Lcom/android/systemui/settings/BrightnessController;
After adding that
replace this Public id
<public type="id" name="brightness_slider" id="0x7f10012e" />
6. Now compile the SystemUI.apk and sign it and replace
Now time to add in the settings look for post #2
Click to expand...
Click to collapse
venkat kamesh said:
Welcome to easy part on adding the option to hide/show in settings
Method 1
1. Decompile the settings.apk
2. Download this View attachment 3617395 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings ) and your wish
Code:
<PreferenceScreen android:title="Statusbar Mod" android:key="statusmod" android:fragment="com.android.settings.rz.Statusmod" />
4. Compile it and Decompile and open
Settings.apk/smali/com/android/settings/rz/Statusmod.smali
5. Compare the Public ID and replace it and recompile
6. God you did man,,, now replace and have fun
Method 2 (actually, this method worked like a charm for me, didnt even had to download his file merge the settings)
1. Decompile the Settings.apk
2. Download this View attachment 3606026 and merge to your settings
3. Add the below code to your settings ( i had added to my own settings.xml )
you can add in settings.apk/res/xml/Dispaly_settings.xml
HTML:
<com.android.settings.cyanogenmod.SystemSettingSwitchPreference android:title="Brightness Slider" android:key="brightness_slider_show" android:defaultValue="0" android:summaryOn="Brightness Slider Shown" android:summaryOff="Brightness Slider Hidden" />
and then compile/sign and replace your settings
OR
Try download this ROM Control application (View attachment 3616872 ) where you can Easily control
All you is just install and have fun
Thanks to @daxgirl for the app source ​
now have fun guys
Thanks to cyanogenmod
Dont Forget to mention me if you used my work
that feels me happy
Click to expand...
Click to collapse
And for the noobies like me: If you dont know anything about compiling/decompiling apks, get a can of coffee and make yourself ready to learn, I had fun debugging all this stuff and get this running, and I think now I know a little bit more, and you also will!
Some keywords for you, so you can spare yourself the googling (the parts I as a beginner struggled with): use apktools for de-/compiling, remember to download and install your frameworks from your phone, and for "signing", you have to copy the META-INF folder and the AndroidManifest.xml from the compiled old apk to the compiled new apk (with something like 7zip).
Have fun with it

Categories

Resources