As I'm running a stock ROM I don't know if this affects others, but I would guess it's the same situation for everyone. When you turn your phone into landscape, the volume buttons are the wrong way round. It annoyed the hell out of me, so I decided to sort it. Android does this already for phone with a DPad on, so it's a case of simply fooling the phone into thinking it has a DPad when the Vol buttons are pressed and using the existing rotation routines.
The process is a little complicated, since it affects services.jar, which is edited by theme creations, so there is no simple update or upgrade.zip, as it could wipe out part of your theme. However I will attach mine, which you can try and always revert back to a backup if you want.
First off, you need to grab a copy of the file.
Code:
adb pull /system/framework/services.jar
This pulls the file onto your computer. Open it up in WinRAR (or similar) and pull out the classes.dex file.
You then need to disassemble the dex file. I use Easy APK Disassembler as it's a doddle to use.
Put the classes.dex file into the same folder as this and run EasyApkDisassembler.EN.bat, select option 2, and give it a name. It creates a folder called out_<name>.
Find the file named KeyInputQueue.smali in out_<name>/com/android/server and open it up in an editor like notepad++
scroll down to find a section which looks similar to this:
Code:
fill-array-data v0, :array_1c
sput-object v0, Lcom/android/server/KeyInputQueue;->KEY_90_MAP:[I
This is creating an array called KEY_90_MAP, and filling it with the data from :array_1c. (It might not be array_1c for you, but whatever value you have it's that array you need to find)
Next, find where it fills the array. These are the values to rotate the DPAD buttons, but since were don't have them we can simple use the array to store the Volume code map.
Code:
:array_1c
.array-data 0x4
0x14t 0x0t 0x0t 0x0t
0x16t 0x0t 0x0t 0x0t
0x16t 0x0t 0x0t 0x0t
0x13t 0x0t 0x0t 0x0t
0x13t 0x0t 0x0t 0x0t
0x15t 0x0t 0x0t 0x0t
0x15t 0x0t 0x0t 0x0t
0x14t 0x0t 0x0t 0x0t
.end array-data
Edit the 1st 4 lines, with the codes for VOLUME_UP and VOLUME_DOWN, which are 0x18 and 0x19.
Code:
:array_1c
.array-data 0x4
0x18t 0x0t 0x0t 0x0t
0x19t 0x0t 0x0t 0x0t
0x19t 0x0t 0x0t 0x0t
0x18t 0x0t 0x0t 0x0t
0x13t 0x0t 0x0t 0x0t
0x15t 0x0t 0x0t 0x0t
0x15t 0x0t 0x0t 0x0t
0x14t 0x0t 0x0t 0x0t
.end array-data
We next need to fool the phone into thinking it has a DPAD when the buttons are pressed.
Find the section
Code:
.method public getInputConfiguration(Landroid/content/res/Configuration;)V
a few lines down from here are the line
Code:
.line 322
const/4 v4, 0x1
iput v4, p1, Landroid/content/res/Configuration;->navigation:I
Again you might have a slightly different line number. This routine essentially checks the input configuration and sets various flags if the device has a mouse, or dpad etc. The const/4 v3, 0x1 is setting it to having no dpad by default then later if it finds a dpad, it sets the flag accordingly. We're just defaulting it to say it does have a dpad. So we change it to 0x2.
Code:
.line 322
const/4 v4, 0x2
iput v4, p1, Landroid/content/res/Configuration;->navigation:I
Save the file.
We then need to recompile the dex, so run EasyAPK, select option 3, and enter the folder name you used. This compiles a file called out.dex. Open up the services.jar file in WinRAR again, and push this file into the archive. Delete the original classes.dex file in the archive, and rename out.dex to classes.dex.
You have now made the changes.
You then just need to replace your phone's version with this version. I tend to rename it to services_1.jar and push it to the sdcard. Reboot the phone into xRecovery and mount the system and sdcard, and adb shell to rename the existig file, and put this in its place. However you push it back, make sure you set the permissions to 644.
Reboot the phone. It takes a while to reboot, so just wait for a few mins. (Mine reboots twice the first time for some reason but then it's fine.)
You then have the swapped volume buttons when you put the phone in landscape mode!
My version is here:
http://www.megaupload.com/?d=R5L8M44R
Works on x10 mini stock rom!!! Good work!!
Related
Hi guys, hope yous can help, hope I'm posting in the right place...
My app records video using the MediaRecorder API, seems to work on all other phones I know of. I just bought a i9100 myself after a user reported this bug , still can't resolve the issue though. Awesome hardware though
On the Galaxy S II, when attempting to record video using the 'HIGH_QUALITY' CamcorderProfile the resultant video is playable, but corrupt (flickering green squares with garbled video @ 1920x1080).
The 'LOW_QUALITY' setting records ok but in very poor quality, as to be expected.
I can get good 720x480 video footage if I manually set up the MediaRecorder object, but get the same problems when I up the resolution beyond 480p.
Here is a breakdown of my code using the Camcorder profile... DOES NOT WORK, gives corrupt footage @ 1920x1080.
Code:
mMediaRecorder = new MediaRecorder();
// reuse the camera
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH));
mMediaRecorder.setPreviewDisplay(mSurfaceView.getHolder().getSurface());
mMediaRecorder.setOutputFile(tempVideoFile.getAbsolutePath());
mMediaRecorder.prepare();
mMediaRecorder.start();
Here is example code only this time setting up the MediaRecorder object manually from the phone provided 'HIGH_QUALITY' CamcorderProfile values, WORKS OK when specifying a video size of 720x480.
Code:
mMediaRecorder = new MediaRecorder();
// reuse the camera
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setOutputFormat(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).fileFormat);
mMediaRecorder.setVideoSize(720, 480);
mMediaRecorder.setVideoEncodingBitRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoBitRate);
mMediaRecorder.setVideoFrameRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoFrameRate);
mMediaRecorder.setVideoEncoder(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoCodec);
mMediaRecorder.setAudioEncodingBitRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioBitRate);
mMediaRecorder.setAudioSamplingRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioSampleRate);
mMediaRecorder.setAudioEncoder(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioCodec);
mMediaRecorder.setPreviewDisplay(mSurfaceView.getHolder().getSurface());
mMediaRecorder.setOutputFile(tempVideoFile.getAbsolutePath());
mMediaRecorder.prepare();
mMediaRecorder.start();
Here is example code only using MediaRecorder, DOES NOT WORK, gives corrupt footage @ 1080x720.
The only difference between this and the last, is the VideoSize.
Code:
mMediaRecorder = new MediaRecorder();
// reuse the camera
mMediaRecorder.setCamera(mCamera);
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
mMediaRecorder.setOutputFormat(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).fileFormat);
mMediaRecorder.setVideoSize(1080, 720);
mMediaRecorder.setVideoEncodingBitRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoBitRate);
mMediaRecorder.setVideoFrameRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoFrameRate);
mMediaRecorder.setVideoEncoder(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).videoCodec);
mMediaRecorder.setAudioEncodingBitRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioBitRate);
mMediaRecorder.setAudioSamplingRate(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioSampleRate);
mMediaRecorder.setAudioEncoder(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH).audioCodec);
mMediaRecorder.setPreviewDisplay(mSurfaceView.getHolder().getSurface());
mMediaRecorder.setOutputFile(tempVideoFile.getAbsolutePath());
mMediaRecorder.prepare();
mMediaRecorder.start();
Here is the details i get from the HIGH_QUALITY CamcorderProfile from the Galaxy S II
CamcorderProfile.fileFormat=2
CamcorderProfile.videoFrameWidth=1920
CamcorderProfile.videoFrameHeight=1080
CamcorderProfile.videoBitRate=2000000
CamcorderProfile.videoFrameRate=30
CamcorderProfile.videoCodec=2
CamcorderProfile.audioBitRate=96000
CamcorderProfile.audioSampleRate=16000
CamcorderProfile.audioCodec=3
I've tried tweaking all these values but to no avail...
Can anyone tell me the what are the recommended MediaRecorder settings for recording 720p & 1080p video footage? Or if there is an odd way I need to set up the camera?
Thanks
Edit: Phone is O2 UK supplied, with 2.3.3, Baseband I9100XXKDJ, Build GINGERBREAD.XWKE2
Edit2: Here is the market app if anyone want to try
https://market.android.com/details?id=net.adyno.alaprecorderhd
{
"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"
}
The same thing happens when recording using the 1920x1080 resolution on Daily Roads Voyager (blackbox app)... Green flickering. That app only works well at 720x480 with the SGSII as well.
Hey,
I might not know what Im suggesting here, as I have not looked at this myself but Are there any other profiles other than low and high?
have you tried changing this to:
mMediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.Quality_1080p));
So you have tried to change the video codec used in the profile?
CamcorderProfile.videoCodec=2 (0= default 1= 3gp h263 2= mpg4 h264 3=amr_nb)
Might also be related to the container type as well,
CamcorderProfile.fileFormat=2 (1 = 3gp 2 = mp4)
The encoding might be API level dependent.
Thought there was a post on here regarding recording hi def video .
jje
JF-GINO said:
Hey,
I might not know what Im suggesting here, as I have not looked at this myself but Are there any other profiles other than low and high?
have you tried changing this to:
mMediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.Quality_1080p));
Click to expand...
Click to collapse
Only supported by 3.0 API, gave it a try anyway but FAIL.
JF-GINO said:
So you have tried to change the video codec used in the profile?
CamcorderProfile.videoCodec=2 (0= default 1= 3gp h263 2= mpg4 h264 3=amr_nb)
Might also be related to the container type as well,
CamcorderProfile.fileFormat=2 (1 = 3gp 2 = mp4)
The encoding might be API level dependent.
Click to expand...
Click to collapse
Sure, tried them all. Checking the file properties of a video I record, and one from the default camera app showing that the video/audio encoding details etc are the same...
I found this info in the camera.apk MediaRecorderProfile.smali
Code:
.line 66
:array_0
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0x40t 0x66t 0x3t 0x1t
0xc0t 0xe1t 0xe4t 0x0t
0x40t 0x5dt 0xc6t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0x0t 0x3t 0x0t
0x1t 0x0t 0x0t 0x0t
0x44t 0xact 0x0t 0x0t
.end array-data
:array_1
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0x0t 0x1bt 0xb7t 0x0t
0x80t 0x96t 0x98t 0x0t
0x0t 0x12t 0x7at 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0x0t 0x3t 0x0t
0x1t 0x0t 0x0t 0x0t
0x44t 0xact 0x0t 0x0t
.end array-data
:array_2
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0xa8t 0xa0t 0x34t 0x0t
0x50t 0x3et 0x2bt 0x0t
0x90t 0x10t 0x23t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0x0t 0x3t 0x0t
0x1t 0x0t 0x0t 0x0t
0x44t 0xact 0x0t 0x0t
.end array-data
:array_3
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0x70t 0xf7t 0x2et 0x0t
0xa8t 0xf4t 0x26t 0x0t
0xb8t 0xcet 0x1et 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0x0t 0x3t 0x0t
0x1t 0x0t 0x0t 0x0t
0x44t 0xact 0x0t 0x0t
.end array-data
:array_4
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0x18t 0xb4t 0xbt 0x0t
0xe8t 0xc7t 0x9t 0x0t
0x70t 0xe7t 0x7t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0x0t 0x0t 0x3t 0x0t
0x1t 0x0t 0x0t 0x0t
0x44t 0xact 0x0t 0x0t
.end array-data
:array_5
.array-data 0x4
0x2t 0x0t 0x0t 0x0t
0x0t 0xdct 0x5t 0x0t
0x0t 0xe2t 0x4t 0x0t
0x0t 0xe8t 0x3t 0x0t
0x1et 0x0t 0x0t 0x0t
0x2t 0x0t 0x0t 0x0t
0x3t 0x0t 0x0t 0x0t
0xb4t 0xf5t 0x0t 0x0t
0x1t 0x0t 0x0t 0x0t
0x80t 0x3et 0x0t 0x0t
.end array-data
:array_6
.array-data 0x4
0x1t 0x0t 0x0t 0x0t
0x64t 0x77t 0x1t 0x0t
0x64t 0x77t 0x1t 0x0t
0x64t 0x77t 0x1t 0x0t
0xft 0x0t 0x0t 0x0t
0x1t 0x0t 0x0t 0x0t
0x1t 0x0t 0x0t 0x0t
0xa8t 0x2ft 0x0t 0x0t
0x1t 0x0t 0x0t 0x0t
0x40t 0x1ft 0x0t 0x0t
.end array-data
which I try to decipher the top parameters as
Code:
0x2t 0x0t 0x0t 0x0t // 2 // output file format
0x40t 0x66t 0x3t 0x1t // 17000000 // ?video encoding bitrate?
0xc0t 0xe1t 0xe4t 0x0t // 15000000 // ?
0x40t 0x5dt 0xc6t 0x0t // 13000000 // ?
0x1et 0x0t 0x0t 0x0t // 30 // fps
0x2t 0x0t 0x0t 0x0t // 2 // video codec
0x3t 0x0t 0x0t 0x0t // 3 // audio codec
0x0t 0x0t 0x3t 0x0t // 196608 // ?
0x1t 0x0t 0x0t 0x0t // 1 // audio channels
0x44t 0xact 0x0t 0x0t // 44100 // audio sampling rate
Tried messing with the bitrate and these numbers but still FAIL.
Any ideas anyone?
kaassema said:
The same thing happens when recording using the 1920x1080 resolution on Daily Roads Voyager (blackbox app)... Green flickering. That app only works well at 720x480 with the SGSII as well.
Click to expand...
Click to collapse
Thanks, I'm not going crazy then.
JJEgan said:
Thought there was a post on here regarding recording hi def video .jje
Click to expand...
Click to collapse
I found a thread about the camera.apk HD mod but info didn't help with my problem
Is there another?
Never thought to check, but this is what I get when i query the available preview sizes
Code:
Supported Preview Size, w x h=640x480
Supported Preview Size, w x h=720x480
Supported Preview Size, w x h=800x480
Supported Preview Size, w x h=320x240
Supported Preview Size, w x h=176x144
Supported Picture Size, w x h=3264x2448
Supported Picture Size, w x h=3264x1968
Supported Picture Size, w x h=2048x1536
Supported Picture Size, w x h=2048x1232
Supported Picture Size, w x h=800x480
Supported Picture Size, w x h=640x480
Not sure if it's related, as it's preview size, not video size...
UKLooney said:
I found a thread about the camera.apk HD mod but info didn't help with my problem
Is there another?
Click to expand...
Click to collapse
Yes i even tested the video but really dont know where or what .
jje
Anyone else?
Is it a firmware bug?
It is not a hardware bug.
It is a big pig from SEC! Use HTC Sensation phone.
Problem is: SEC uses internal classes for writing fullHD video.
They named SecCamera (for camera access) and SecMediaRecorder (for recording video). Only using those classes SGS S2 can record 1080p(and many other features like touch to focus, continous photo capturing, face detection and other), standard API use MediaRecorder and Camera and limited to 480p only.
Now, I experimening with source codes, SecCamera already opens, but recorder is not yet. When my experiments will success, I add a new feature to my lgCamera (1080p recording for SGS S2) and VideoReg.
PS. Sorry for my bad English, my native language is Russian.
My experiments was done. I added a new version of VideoReg app to market. That version supports 1080p recording for SGS 2.
lgCamera
A new version of lgCamera fully supports 1080p recording with continuosly focusing and exposuring for Samsung Galaxy S2.
Thanks for the tip. But how do I i find SecCamera?
RubberBigPepper said:
Now, I experimening with source codes, SecCamera already opens, but recorder is not yet. When my experiments will success, I add a new feature to my lgCamera (1080p recording for SGS S2) and VideoReg.
PS. Sorry for my bad English, my native language is Russian.
Click to expand...
Click to collapse
Great news, I've grabbed the source and plan to look into it later. Any pitfalls I should look out for? Found any documentation?
Thanks
I grabbed the two jar files from the phone, added them to my project & included them in the build path but no classes are exposed. I guess I'm not doing this right. Any pointers?
EDIT: found the files, they're in the /system/framework on the phone.
UKLooney- you need to deodex the files. I attached my deodexed jars to save you the trouble
Now, I can add these to my project and Eclipse recognizes the classes, but I get errors -
if adding seccamera.jar, I get a compilation error "Conversion to Dalvik format failed with error 1"
with only secmediarecorder.jar added, installation of the app failed with error: "Installation error: INSTALL_FAILED_DEXOPT". the logat shows:
ERROR/installd(2583): dexopt failed on '/data/dalvik-cache/[email protected][email protected]' res = 11
any ideas?
danim said:
any ideas?
Click to expand...
Click to collapse
Grabbed your deodexed files and messed around for a couple of hours, but got no where apart from replicating the same problems.
Get this in logcat just prior to app fails to install with secmediarecorder
Invalid file flags in class Lcom/sec/android/secmediarecorder/SecMediaRecorder$EventHandler;: 0002
are we maybe missing some other dependencies?
I've managed to get SecCamera working (not tried SecMediaRecorder yet)
I grabbed the .jar & .odex from the phone (/system/framework)
Deodexed the files (smali/backsmali)
Built the class files (dex2jar)
Converted to source (jd-gui)
Created a new java project
Pasted in the java source
Fixed a ton of errors??? (just deleted most of them)
Exported the jar
Added the new jar into my project build path
I can now reference the samsung camera object, compile, install and run my project.
I've attached the single new jar here (SecCamera), and I'll try sort the other one tomorrow when I have a bit more free time...
This is my first contribution here
(NOTE,Tested on my stock ICS 4.0.3, I'm not sure if GB or other rom may work.)
At your own risk that your phone may blow up!, just kidding
This will teach you how to enable 30 step volume and a smoother scrolling
1. first, download this and install it.
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html
2. if your framework.jar is odex, you will need to deodex it, download this
http://www.droidforums.net/forum/xeudoxus/47283-release-xultimate.html
3. you will need root explorer to extract your framework.jar
4. you will need this, smali/baksmali tool, download it here
http://forum.xda-developers.com/showthread.php?t=1582468
5. you need 7z, just google it and get it.
Now let's get started.
-Increase volume steps
1. Extract all the files of the smali/baksmali tool into one folder and put your framework.jar into that folder
2. Left click on 1.bat and edit it to this
java -jar baksmali.jar -x framework.jar -o classout
3. run 1.bat and wait... ones you have decompile the framework.jar, go to classout\android\media\AudioService.smali
4. open it with notepad, Ctrl plus F and type max_, click next 2 times
5. after that, dele away max_ and type array_1f6, click next 1 times
6. you will see this
:array_1f6
.array-data 0x4
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1ft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1ft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data
7. Edit it to this.
:array_1f6
.array-data 0x4
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data
8. save it! And you're done!
-smoother scrolling
1. go to classout\android\widget\AbsListView.smali
2. open it with notepad
3. Ctrl plus F and type ScrollingCache, click next 10 times
4. you should see this
.method private createScrollingCache()V
.registers 3
.prologue
const/4 v1, 0x1
5. edit it to this
.method private createScrollingCache()V
.registers 3
.prologue
const/4 v1, 0x0
6. Next Seach private initAbsListView and click next 1 time
7. you should see this
method private initAbsListView()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
.line 786
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setClickable(Z)V
.line 787
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setFocusableInTouchMode(Z)V
.line 788
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setWillNotDraw(Z)V
.line 789
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setAlwaysDrawnWithCacheEnabled(Z)V
.line 790
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
8. edit it to this
method private initAbsListView()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
.line 786
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setClickable(Z)V
.line 787
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setFocusableInTouchMode(Z)V
.line 788
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setWillNotDraw(Z)V
.line 789
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setAlwaysDrawnWithCacheEnabled(Z)V
.line 790
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
9. Ctrl plus F again and type setScrollingCacheEnabled, click next 1 times
10. you should see this
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "enabled"
11. edit it to this
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "disabled"
12. save it! And you're done!
-compile
1. open up Command Prompt.bat
2. type 2 and wait, ones it's done, you should have classes.dex in your folder.
3. open your framework.jar using 7z, and drag the newly created classes.dex into your framework.jar.
4. Copy your framework.jar onto your SD Card and put it back into your system\framework.
5. set permission to rw-r--r, overwrite it and reboot.
6. ENJOY YOUR DONE!
Give me a thanks if i had help you
thanks to the Original which was from (AndroidON) but i had gone through it and make it more simple for xperia arc ics user.
http://forum.xda-developers.com/showthread.php?t=1411317
Gonna try this one out
Edit:
After trying your guide in the modding:
- classes.dex compiled successfully
- phone boots up normally
- basic apps runs normally (phone, messaging, settings, etc)
- and BAM, smooth croll like GB.
I'm running Arconium ICS 4.0 by doomed151, ArcKnight Kernel V3.5.1 (OC Version), v6 supercharged.
My phone's scrolling is already smooth without your mod (because of the ROM and the kernel), but I noticed a very small lag when scrolling (maybe about 0.1 sec ), negligible for most of users though. But not for me as I am a gamer too (FPS sensitive guy).
I wonder why doomed not include this mod in his ROM.
Btw I compile the classes.dex in Windows x64 PC.
Gonna report to you soon, should anything going wrong.
Thanks for the mod!
Do not delete your framework.odex if you have one in your system/framework, just replace the framework.jar only.
Sent From My Sony Xperia Arc S
after apply smoother scrolling mod to my framework.jar, the phone can boot normal, however, seems all apps are not work properly, my apex launcher can not be loaded and keep showing me the gmail / google search / etc apps are stopped unexpectly...do you have any idea about this...
It should not be happening, the scrolling should be better as the logging is disable. Try restoring back up if the problem isn't solve.
Sent From My Sony Xperia Arc S
Tried it on my arconium..
It is smoother.... but much less noticeble.....
Thanx anyway.......
doesn't work
when i tried to run this script i get this message ".sh[30] : grep: not found
please run this script with SManager as Root"
my 5x4 app tray only allow 4x4. when i try to drag another icon down to the 5th row, it doesn't work.
What script? I didnt upload any script here.
Sent From My Sony Xperia Arc S
When I tried on my XV, WORKS COMPLETELY !! THANKS FOR THIS TUTORIAL !!!
SammiSaysHello said:
when i tried to run this script i get this message ".sh[30] : grep: not found
please run this script with SManager as Root"
my 5x4 app tray only allow 4x4. when i try to drag another icon down to the 5th row, it doesn't work.
Click to expand...
Click to collapse
Wrong thread bro
sony xperia ray
ics 4.0.4 rooted
stock rom
decompile ok, editing files ok, but everytime i try to compile classes.dex or framework.jar it gives me the same error. not only on this one, i used 4-5 tools to compile framework.jar after editing(including apktool), it gave me no good at all. at the end of every line it says "No enum constant org.jf.dexlib.AnnotationVisibility.RUNTIME"
I have latest version of jdk, windows 8 x64.
matgras said:
Wrong thread bro
sony xperia ray
ics 4.0.4 rooted
stock rom
Click to expand...
Click to collapse
Yeah I realised that in September last year .... xD
SammiSaysHello said:
Yeah I realised that in September last year .... xD
Click to expand...
Click to collapse
Haha, now i see it, i should watch dates more closely.
sony xperia ray
ics 4.0.4 rooted
stock rom
federico rotundi said:
decompile ok, editing files ok, but everytime i try to compile classes.dex or framework.jar it gives me the same error. not only on this one, i used 4-5 tools to compile framework.jar after editing(including apktool), it gave me no good at all. at the end of every line it says "No enum constant org.jf.dexlib.AnnotationVisibility.RUNTIME"
I have latest version of jdk, windows 8 x64.
Click to expand...
Click to collapse
window 8 has a lot of issue I can't really solve myself, try to use another computer with window 7 or below to do it, meanwhile I try to check out the problem for you.
solved it.
simplyjustkids said:
This is my first contribution here
(NOTE,Tested on my stock ICS 4.0.3, I'm not sure if GB or other rom may work.)
At your own risk that your phone may blow up!, just kidding
This will teach you how to enable 30 step volume and a smoother scrolling
1. first, download this and install it.
http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html
2. if your framework.jar is odex, you will need to deodex it, download this
http://www.droidforums.net/forum/xeudoxus/47283-release-xultimate.html
3. you will need root explorer to extract your framework.jar
4. you will need this, smali/baksmali tool, download it here
http://forum.xda-developers.com/showthread.php?t=1582468
5. you need 7z, just google it and get it.
Now let's get started.
-Increase volume steps
1. Extract all the files of the smali/baksmali tool into one folder and put your framework.jar into that folder
2. Left click on 1.bat and edit it to this
java -jar baksmali.jar -x framework.jar -o classout
3. run 1.bat and wait... ones you have decompile the framework.jar, go to classout\android\media\AudioService.smali
4. open it with notepad, Ctrl plus F and type max_, click next 2 times
5. after that, dele away max_ and type array_1f6, click next 1 times
6. you will see this
:array_1f6
.array-data 0x4
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1ft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1ft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data
7. Edit it to this.
:array_1f6
.array-data 0x4
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data
8. save it! And you're done!
-smoother scrolling
1. go to classout\android\widget\AbsListView.smali
2. open it with notepad
3. Ctrl plus F and type ScrollingCache, click next 10 times
4. you should see this
.method private createScrollingCache()V
.registers 3
.prologue
const/4 v1, 0x1
5. edit it to this
.method private createScrollingCache()V
.registers 3
.prologue
const/4 v1, 0x0
6. Next Seach private initAbsListView and click next 1 time
7. you should see this
method private initAbsListView()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
.line 786
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setClickable(Z)V
.line 787
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setFocusableInTouchMode(Z)V
.line 788
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setWillNotDraw(Z)V
.line 789
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setAlwaysDrawnWithCacheEnabled(Z)V
.line 790
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
8. edit it to this
method private initAbsListView()V
.registers 4
.prologue
const/4 v2, 0x0
const/4 v1, 0x1
.line 786
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setClickable(Z)V
.line 787
invoke-virtual {p0, v1}, Landroid/widget/AbsListView;->setFocusableInTouchMode(Z)V
.line 788
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setWillNotDraw(Z)V
.line 789
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setAlwaysDrawnWithCacheEnabled(Z)V
.line 790
invoke-virtual {p0, v2}, Landroid/widget/AbsListView;->setScrollingCacheEnabled(Z)V
9. Ctrl plus F again and type setScrollingCacheEnabled, click next 1 times
10. you should see this
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "enabled"
11. edit it to this
.method public setScrollingCacheEnabled(Z)V
.registers 3
.parameter "disabled"
12. save it! And you're done!
-compile
1. open up Command Prompt.bat
2. type 2 and wait, ones it's done, you should have classes.dex in your folder.
3. open your framework.jar using 7z, and drag the newly created classes.dex into your framework.jar.
4. Copy your framework.jar onto your SD Card and put it back into your system\framework.
5. set permission to rw-r--r, overwrite it and reboot.
6. ENJOY YOUR DONE!
Give me a thanks if i had help you
thanks to the Original which was from (AndroidON) but i had gone through it and make it more simple for xperia arc ics user.
http://forum.xda-developers.com/showthread.php?t=1411317
Click to expand...
Click to collapse
what is working in CM 10.1 ??
Hi everyone,
Just want to know if anyone have experience doing the volume increment/steps modification on their Nexus 5 yet.
I have followed this method that I found here :http://forum.xda-developers.com/showthread.php?p=28795209
everything went smooth.
I got the framework.jar using BakSmali
edited the AudioService.smali file
generated classes.dex
merge classes.dex with framework.jar using 7-zip
push new framework.jar to my nexus5
change permission on framework.jar
I change the AudioService.smali so i can have 30 steps instead of the default 15 steps.
The following is what i have after modifications.
.line 205
:array_2c
.array-data 0x4
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1Et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x1Et 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
.end array-data
Note that 0x1Et should give me 30 steps but my nexus 5 still only give me 15 steps on Music/Bluetooth.
Results:
I am still getting 15 steps while listening to music on both headphone jacks and Bluetooth devices.
I double check the total number of steps with some apps and confirmed that the original 15 was not changed.
I also double check if my framework.jar are pushed correctly by re-pulling the framework.jar and looking into the AudioServices file
and they are all the newly modded values.
at this point any input will be greatly appreciated
PS. I am not sure if this should be in the developer thread but since i am not allowed to post/reply there i thought this might be the right place.
Just to confirm that the hack is still working for nexus5but only Under ART
Ok, I thought I'd at least try out CM12 for a bit, though I may not stay until it goes more stable with monthlies and such. Anyway, one thing that immediately is bothering me is I can no longer fix the crappy volume controls. It was always a bit of a messy hack (at least without Xposed Modules) but the framework has changed significantly it seems. Basically the old trick with 4.x was to "Baksmali" the framework.jar, open the AudioService.smali file in ./framework/android/media/, search for 0xft (the default values for most of the volumes which luckily nothing else uses or searching would be a lot harder) and then replace the pre-defined numbers of steps with new ones (my own personal preference being 14,14,14,64,7,7,14,7,f,f but not everyone would like that 64 in particular. It needed to be a heck of a lot more than the default f though!) After that one simply used "Smali" to repack the modified data, put the classes.dex in the framework.jar and put it back in the system. (Which, sadly, counts as an "upgrade" forcing it to reoptimize everything -- I usually tried to do this in advance during flashing.) This is an ugly hack, but no one will fix Android to let users use better volume controls, so it's this or disable ART and use Xposed modules (which basically just do this on the fly anyway. Still a messy hack IMO.)
Anyway, with 5.0 there is no longer even a ./framework/android/media/ at all. No AudioService.smali anywhere. I'm guessing the number of volume steps has shifted to some other portion of the system? If it helps, as far as searching goes, here are the default values from at least as far back as CM7 up to CM11:
Code:
private int[] MAX_STREAM_VOLUME = new int[] {
5, // STREAM_VOICE_CALL
7, // STREAM_SYSTEM
7, // STREAM_RING
15, //STREAM_MUSIC
7, // STREAM_ALARM
7, // STREAM_NOTIFICATION
15, //STREAM_BLUETOOTH_SCO
7, // STREAM_SYSTEM_ENFORCED
15, //STREAM_DTMF
15, //STREAM_TTS
15 // STREAM_FM
}
So it would look something like this in Smali form:
Code:
0x5t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0x7t 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
0xft 0x0t 0x0t 0x0t
I'm no developer myself I will admit, so I'm hoping these values have simply shifted to a new location. If it's going to require more fundamental modifications I think I'm basically going to have to give up hope on fixing the volume anymore with 5.x.
I saw an apk get flagged by Avast anti virus and decided to take a look at it. After decompiling it and following some random string paths i found some instructions that i dont understand. What is this code are they instructions or encryption?
direct methods
.method static constructor <clinit>()V
.locals 1
const/16 v0, 0x2004
new-array v0, v0, [B
fill-array-data v0, :array_0
sput-object v0, Lcom/lqouxhfp/hdoapeng/qpaxuuya;->a:[B
return-void
:array_0
.array-data 1
0x4t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
0x0t
-0x80t
0x3at
0x9t
The array continues....