How I ported the availability to change screen resolution to Settings - Android Software/Hacking General [Developers Only]

Ok, I am a noob and I just do things I do not understand fully.
So this thread is not going to be detail for beginner.
Because other secsettings2.apk of other rom was causing language option in settings to crash so I look into it 2 days ago and decided to port it from scratch. I was very nervous and has little hope of success. But it was paid off because it works.
You need to compare the public.xml of your port and match it to your secsettings2.apk one.
I took s7edge one as a reference for porting. res\values\public.xml
ex s7 edge: <public type="drawable" name="assistant_menu_edit_icon_home" id="0x7f02008c" />
Yours: <public type="drawable" name="assistant_menu_edit_icon_home" id="0x7f020090" />
so example const v2, 0x7f02008c change to const v2, 0x7f020090
Notice the hex used in public.xml is 0x7f and has length of 10. When compare the public.xml one thing you have to becareful is the "type=" sometime the hex may refer to a string or integer. So you cannot just search it's name without checking. Either you are very passionate to compare and change it 1 by 1 or you can ask someone write a tool for you. I found out all the smalis is at here.:
I made my own tool and has no intention to release it, so pm me if you really need it.
smali\com\samsung\android\settings\display
Have fun! Till then I hope Samsung future update made this option for all their phone using higher than 720p as some of us would love to save battery and less heat. Hey Samsung, to be stand out, you can made your Android Os awesome for all range of phone, no point of giving high end phone those features only. People may want to switch to 1+ or xiao mi because of lack of features.
p.s I'm s7 edge user
bye

after few experimenting these are the files maybe useful for reference
https://mega.nz/#!uRMSRRTb!_2bRYVXgvaTnKqySGeVc-i3ox2Xb36iv26pINNCEEM0

Can you help me to port this to my J5 Prime M?? Please

AnonMx said:
Can you help me to port this to my J5 Prime M?? Please
Click to expand...
Click to collapse
what is M ?

doulc said:
what is M ?
Click to expand...
Click to collapse
oooh, the version M, J5 Prime SM-G570M, latin america.

Related

[Q] Replace GetDeviceID() with a hard coded String (???)

This is the line of code I'm working with. I need to change this line by hard coding the device id for testing purposes.
invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getDeviceId()Ljava/lang/String;
Could anyone please step in in the right direction.
If you need the code leading up to this or even following this line, let me know and I can post more.
Thanks,
Chad

SG DEV Chat

Okay, so we've made changes to CommonUtils.smali, I'm not sure how you did it.
But there are also calls to MAKE/MODEL in MediaPlayerWrapper.smali and HDMIReceiver.
The former checks for Samsung models, the latter checks for HTC models.
You can see them as:
Code:
sget-object v0, Landroid/os/Build;->MODEL:Ljava/lang/String;
That should be the last of the device specific tests ...
Next step ... root:
Having a read through Gingerbreads DRM framework for clues, but I'm convinced the likely culprit will be in DrmAgentService.smali.
Final step ... ICS:
There are version checks for ICS all over the place, which can be amended ... But BSB really need to add ICS support, as I don't particularly fancy adding it on their behalf.
PS: Currently by Dev environment is refusing to recompile any source, so I'm a little bit hampered as to how much I can debug atm.
As far as I can work out, the calls to make and model in those files are superfluous. It's where they're checking for the kernel or such that's confusing me...
No worries ...
Interestingly ... They seemed to have left a lot of TEST code in ... I'm wondering what would happen if we set it to run as a test version.
Anyway ... VGDRM.smali seem to be the likely place to start to look for the root issue ... Going through it now to see what else it calls.
Error code called VGDRM_STATUS_DEVICE_IS_ROOTED, just can't work out where it's being called...
I believe what happens is that the when the DRM session initiates it posts a load of info like deviceName, username etc and it invariably responds with 0x7f060021 which corresponds with that the device is rooted.
Interestingly ... In SOAPconstants you can set the device to whatever you want, have a gander at HARDCODED_DEVICE_TYPE.
Finding a lot of interesting stuff ... Still no closer to where they're hiding that root check ...
Discovered how they plan to force upgrades ... if you look in Flags.smali there's a URL that pulls a config file from their site. In there, they can force people to upgrade to a specific version.
At the bottom of CommonUtils.smali, you forgot to override getManufacturerName ...
Squiggle said:
At the bottom of CommonUtils.smali, you forgot to override getManufacturerName ...
Click to expand...
Click to collapse
Doesn't seem to affect anything - people with SE phones running stock have had it working.
Sony Ericsson phones? Really?!
Hrm.
This is also confusing in terms of whether they're checking the kernel version, I guess they're not...
I was wondering if they were matching things up with the UserAgent, but there's nothing in there that would state if you're rooted or not.
I can only presume that extra code is downloaded from them that performs a Kernel check ... as I'm buggered if I can see anything in the code that does it.
Threads on BSB forums seem to indicate that Jailbroken iOS devices now experience the same issues ...
Can it help?
I extracted this code from a famous .apk:
.method public isRooting_check()Z
.locals 1
iget-boolean v0, p0, Lit/sky/go/model/Config;->rooting_check:Z
return v0
.end method
If I put
const/4 v1, 0x0
return v1
to fool it it doesn't work.
Is possible that this apk could have more controls regarding the presence of root? thank you

[Q] Smali Compile Error - Classes.dex

Disclaimer: Perhaps this should be in Development, but I'm below the 10 post threshhold
I'm new to XDA forums posting, have no programming experience(ie:copy/paste script), but have been lurking for some time now reading as much as I can without asking for help, scouring the forums so I can achieve my whims and hopefully help others in the long run when I have more experience. I've succeeded in setting up adb/SDK, decompiling/recompiling apk's, editing 9patch, flashing, signing etc..
My post is in regards to my efforts to change the width of the drawable line used to connect the pattern dots on a security pattern lock screen.
I found these instructions from another site from someone asking the same question, The answer given was:
In com\android\internal\widget\LockPatternView.smali of framework.jar (make sure you decompile with backsmali),
find something that looks like:
Code:
iput v2, p0, Lcom/android/internal/widget/LockPatternView;->mDiameterFactor:F
Above it, you should find something like:
Code:
const/high16 v0, 0x3f00
Change 0x3f00 (or whatever it is) to 0x3dcccccd
Click to expand...
Click to collapse
I Decompiled classes.dex from framework.jar on two roms. Reaper 3.0 (default) and classes.dex from the latest CM9 (which has the thinner drawable line) to try and compare them. Attached are 2 screen shots from within notepad++ One from the Reaper LockPatternView.smali which I modified and tried to recompile. And the other from CM9's LockPatternView.smali left untouched. I tried to draw a comparison.
After editing LockPatternView.smali I saved the file, but am getting recompile errors with either autosmali or by command line.
Code:
C:\AutoSmali_1.0-2>java -Xmx512M -jar smali-1.3.2.jar out/ new-classes.dex
out\com\android\internal\widget\LockPatternView.smali[0,0] 1036831949 cannot fit
into a short
out\com\android\internal\widget\LockPatternView.smali[251,4] mismatched tree nod
e: I_STATEMENT_FORMAT22c_FIELD expecting I_CATCHES
out\com\android\internal\widget\LockPatternView.smali[261,4] mismatched tree nod
e: I_STATEMENT_FORMAT35c_METHOD expecting <UP>
I was wondering if anyone has any experience with this, or has experienced the same error. I have been able to change all the png's and customize the appearance to my hearts content, i only lack the ability to edit that 'connecting line'
I'm just a beginner who's good with Photoshop, but If i can work this out I figure I'll write a tutorial with everything combined.
twiice
Almost a year later comes someone with the exact same issue. The only difference is that I'm a Samsung Y DUOS user.
So, anyways, I was able to compile the file again with no errors.
I've changed this:
Code:
const/high16 v2, 0x3f00
Into this:
Code:
const v2, 0x3dcccccd
If I left it like this:
Code:
const/high16 v2, 0x3dcccccd
I got compile errors.
Nevertheless, I don't think that this is the right way to do this. I was able to flash the new framework.jar onto my phone and it booted ok without errors. The only thing is that I've noticed that the phone gain some LAG while moving around the UI. The LAG is not always present, but it happens with a lot more frequency than before.
So, my question is, what the hell does const/high16 means? Why do I have a compile error if I leave it like that, and why does it get recompiled ok if we remove the /high16?
Can anyone help me?
It most likely means high 16 bits of 32-bit variable.
You're using 32-bit value.
Obviously you can't stick 32-bit value into 16 bits, that's why you're getting compilation errors.
The lag has most likely nothing to do with this, and has to do with the tool version you used for recompilation and/or lack of zipaligning and/or something else caused by the change you did.

Decompiling APKs question regarding .smali syntax such as .line

I'm comparing two APK's after decompiling them.
The code is very much identical apart from when I decompile one there are many lines such as
.line
.prologue
Is there anyway to cut this out as it would help very much when comparing?
Yeah.
Don't include debugging information.
For baksmali just pass the b argument. You'll see it in the binaries documentation.
zeroprobe said:
I'm comparing two APK's after decompiling them.
The code is very much identical apart from when I decompile one there are many lines such as
.line
.prologue
Is there anyway to cut this out as it would help very much when comparing?
Click to expand...
Click to collapse
Search for xda user mudhi then check his signature and goto the "A way to optimize app and framework files" thread in his sig.
It strips out the debugging code like .line .prologue etc and gives more readable code
Or, you could simply enter -b like I said before.
No need to install new software this is easy.
Thanks guys, much appreciated.

[Q] Problems in editing framework

I'm recently trying to edit my framework with this mod
http://forum.xda-developers.com/showthread.php?t=1916094
Well actually the steps in that thread are very simple, but since I'm trying to apply that to my Xperia Ray so it must have slightly different steps
What I want to ask :
- In framework/res, I found drawable-.........( mdpi,hdmpi,ldpi,etc.). If I'm going to replace the .9png's picture in there, should I make the picture as same as the original picture dimension? I'm using Dev-Drawable app in the Play Store ( it makes picture to drawable- hdpi,mdpi,etc. ), the result of using it is it gives me the mdpi version of the picture but with different dimesion from the original picture.
- I found errors and it says that I have errors in the /res/values/public.xml
I found this :
Code:
Don't do that! :) I think I should explain the purpose of public.xml file in the project wiki, because many people are confused. Note that you don't need this file when you build an apk from sources and apktool building mechanisms are very similar, so guess what: you could remove this file from decoded application and apktool will rebuild it without any problems. I had a reason why to generate public.xml - it's a feature, not a bug! ;)
Well, the reason is: there may be references to resources in the application code. If resources ids will change after build, then code will reference different resources than in original apk. public.xml file gives us sureness that resources will get same ids after build - it's the only one reason to use this file. And you want to manually modify these ids ;)
Adding or removing new resources is somewhat tricky. Yeah, I should write about that in the wiki.
You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code.
There is never much sense in modifying ids in public.xml, because then modified lines lose their purpose.
If you want to add new resources, e.g. drawables and use them in the XML files you don't have to change anything in the public.xml file.
If you want to add new resources and use them in your code, then you have to add them into public.xml, because you need to reference them somehow. Or you could use Resources.getIdentifier() method, but this is ugly.
And now the most tricky part: if you want to remove some resources, you have to remove info about them from public.xml as well. So first you have to be sure that they aren't referenced in the code. But there is also this "hole" problem, so:
If these resources are at the end of ids stack, then there is no problem.
If resources are near the end of ids stack and you are sure, that all resources after them aren't referenced in the code as well, then you could just remove them all. Actually you have did virtually the same, cause after modifying ids you made these lines totally useless, you broke them, so you could just remove them.
If you want to remove some resources, but add same or greater quantity of new ones (of the same type), then there is no problem - new resources will automatically fill in "holes" in ids. You don't have to add them to public.xml .
If none of above conditions are met, then you have holes and you have to fill them by something. But you don't have to add "useless .pngs" - just add:
Code:
<item type="drawable" name="DUMMY1" />
<item type="drawable" name="DUMMY2" />
<item type="drawable" name="DUMMY3" />
...
Like above, you don't have to add these resources to the public.xml .
And because I'm a newbie I don't really get what that mean. So I just delete the files that I'm going to replace and I can re-compile the framework, but I got bootloop, LOL.
I confused about :
1."You could remove any line from public.xml (even making a "hole" in the ids) at any moment, but you must be sure, that resource isn't referenced in the code."
What are the "holes" and " referenced in the code" mean?
2. Because I want to add .png's picture to the drawable-mdpi folder, Do I need to add dummies to the public.xml ?
3. I'm using the tricky signing method ( open archive in the original framework, copy meta-inf & android manifest and replace those files to the modded framework). Is this cause me an error?
Help me mateee:crying:
anyone???

Categories

Resources