[Q] editing .so file - Android Q&A, Help & Troubleshooting

Howdy.
I'm trying to modify a .so file (libflashplayer.so), but have run into a few problems:
I first tried editing the file after it was installed from an .apk. This appears to work at first, but the edited file is quickly replaced with the original.
I then tried editing the file in the .apk package. This causes the package to fail to install (I'm guessing because the md5 in the certificates no longer matches)
Aldo tried moving a folder with the .so files from the .apk (com.adobe.flashplayer-1 which is what is created when the .apk installs correctly) directly into /data/app-lib/.The directory was created successfully but appears to be immediately deleted.
Is there a way to accomplish what I'm trying to do? If so how?
Other possibly relevant info:
My device is rooted
I did not write the code for anything in the .apk, I got it from a link on xda (pretty dubious i know but I couldn't find another option)
I'm using cyanogenmod 10.2 (based on android 4.2 I believe).
I'm editing the file with a hex editor to change a a few characters ("AND" to "WIN")

Related

[Q] What version & how to tell

Hello,
How can I tell what version a *.apk file is before I move it to the phone and open it?
I have many email.apk versions and would like to see, which version it is in Win$ows before I try to open and install it on my Vibrant.
Here is an example from the Vibrant-Droid-Razr 2.1 from Fishman.
Tx,
The_Toggle
Apk files are actually zip files, or something similar. You can see what is inside them using file managers on the phone, or probably unzip on a PC. I took a look at one I had, and found the version number by viewing the AndroidManifest as a text file.

Android file naming convention error. Cannot revert

Greetings.
First details:
T-Mobile Galaxy S3 (T-999)
Android version: 4.0.4
Baseband: T999UVLEM
Kernel: 3.0.8-611599-user
Build Number: IMM76D.T999UVALEM
Problem:
I attempted to utilize the HyperX camera mod (allowing 30fps, and 30Mbit superfine settings etc) which required copying the Camera.apk over to the /system/app folder, (while deleting/renaming the old samsungcamera.apk and samsungcamera.odex files).
Here's where is gets tricky: Using Root Browser Lite I navigated to that system/app folder and renamed the files to *.apk.old" to keep them in case of problems. but, APPARENTLY I accidently renamed the Odex file to what is now shown as "SamsungCamera.odex?old". Upon using the mod I now get a force close on ALL video so I wanted to revert back, but I can't rename it BACK to .odex because of the question mark in the file name... nor can I delete it, etc. I tried to mv the file through ADB but a LV command shows the filename listed on two seperate lines.. as if it sees the "?" as a line break.
It lists it like this:
SamsungCamera.apk.old
SamsungCamera.odex
old
SamsungIME.apk
etc etc
I can't rename it through ADB because i can't figure out how to get the filename syntax correct and I can't rename it in root browser because it can't handle the file period, now.
Anyone know how to fix this? ultimately either a solution to fix it... or undo it would be amazing... I know the XDA group is amazingly intelligent..... Can anyone help me?
Please?
I can't attach files, just get someone to post the file you need. I think that should work. Also, maybe try a different file explorer like ES.
Update: ES File Explorer shows the file listed as "SamsungCamera.odex old" (note the space). Attempts to rename it through ES result in "file operation failed" popup for a second., Root Browser Lite lists it as "SamsungCamera.odex?old" (note the "?") and attempts to rename or change permissions through that program result in a "superuser permission granted" popup, but nothing changes. end result: neither work.
If the file is truly just "corrupted" or named wrong somehow, then the system isn't seeing it at all, correct?!?!? So a replacement stock odex would suffice?
Hopefully? At this point I just want the stock T-Mobile Galaxy S3 camera functionality (HD video) to work, again. Even in 720p.... However that is possible, I'll do it.
PLEASE?!?!?
ANYONE? Bueller? Bueller? ??
No video on a brand new phone isn't exactly fun..
Can anyone shed some light on renaming this file after this?? or provide the GS3 "SamsungCamera.odex" file?
Problem solved (by using another copy of the stock Odex)
For posterity:
Just to follow up.. The problem was solved with help from a member on this forum who provided the "SamsungCamera.odex" file for my T-Mobile GS3 phone, as followed in this thread.
If anyone else has this problem, or simply just needs the odex file... please see this link to this thread for that attachment.
thank you, again.

[SOLVED] Edit .ogg in camera.apk

I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
ImAhNoBoDy said:
I have a rooted Galaxy M Style phone with stock Gingerbread 2.3.4 firmware. I am trying to customize my stock camera app, but am not sure what I'm doing wrong. I plan to replace the autofocus_ok.ogg with a different tune from my phone. I checked the properties of the autofocus_ok.ogg and saw it's a mono, 44100hz, and 96 bitrate file. The tune that I have has the same properties. So this is what I have done so far:
I backed up camera.apk to /system/app/camera.apk.bak and the camera.odex to /system/app/camera.odex.bak. I left a copy of camera.odex in /system/data. I copied the camera.apk to my memory card and placed the file on my computer. I renamed the file to a .rar. I then deleted the autofocus_ok.ogg and placed the tune that I wanted in that directory. Then I renamed it to autofocus_ok.ogg. I renamed the file back to .apk and transferred the file back to the memory card, then over to /system/app. The camera app will not install/not showing up on my phone. I am transferring the files through root explorer on my phone.
I worked with the original apk file again with apktool. I was able to decompile and replaced and renamed the files that I needed again. I compiled the file and transferred the file to /system/app again, but the apk will still not install. I checked the complied apk file and noticed that the file didn't have the META-INF folder, so I copied that over to. Tried to install it again by copying the file to /system/app, but it still won't show up on my phone. Is there anyway for me to change the autofocus_ok.ogg without a custom rom?
Thanks.
Click to expand...
Click to collapse
erm... is the permissions set correctly rw-r--r-- ?
MoonBlade said:
erm... is the permissions set correctly rw-r--r-- ?
Click to expand...
Click to collapse
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
ImAhNoBoDy said:
Yup, permissions were set correctly like rw-r--r--. Owner is root:root. Those are the permission that I set on the apk file like they were on the original file. I just realized that the compiled apk's from apktools doesn't show up on my phone. The apk that I created by opening up winrar and just replacing the .ogg files do show up, but I get the error "The application Camera (process com.sec.android.app.camera) has stopped unexpectedly. Please try again."
Anything else I can try or a thread to refer to?
Click to expand...
Click to collapse
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
MoonBlade said:
why dont you try to push the modified apk manually using root explorer or so instead of pushing via adb ..
after decompiling apk and modifying it, compile it into some folder and then copy it into you sd card then use root explorer and manually push(copy) the apk into system/app .. give proper permissions and then reboot your phone..
Here are some guides to use apktool
http://forum.xda-developers.com/showthread.php?t=1891686
http://forum.xda-developers.com/showthread.php?t=1989533
Click to expand...
Click to collapse
I have been pushing the modified apk through root explorer all this time. I don't even have adb install, haha. The procedure you explained have been the way I have been doing it the whole time, lol. I read the threads you posted and the procedure is the same as I've been doing it, except for the second thread. I can't grab the apktool from 4shared because I don't have an account. I am using the latest apktool 1.5.2. Also, I didn't understand what PulseDroid was talking when he said "We are NOT done just yet, we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk". So I'm suppose to replace the resources.arcs and the .ogg files that I created from the new apk to the old apk? I didn't mess with any xml file.
Anyways, is there anything else I can try?
EDIT: ........I feel so embarrassed. I checked out this thread http://forum.xda-developers.com/showthread.php?t=2378177 and saw this post "Drag your replacement files into WinRAR and (here's the important part) in the Compression Method drop-down choose "Store"." All this time I have been compressing the file as "Normal" in Winrar, instead of "Store".
All in all, I did not need apktool at all. I used the original apk and opened it up in Winrar. I deleted the files that I wanted to replaced and put in the files that I wanted. Each time I put something in the file in Winrar I get a prompt for compression and instead of "Normal" compression just use "Store". It was that simple.
This helped me, thank you!

Help modifying APK files on recovery image

Hello,
I bought a Umi Diamond X and i just found out that it came with adware.
Since i could not find any custom roms for it, i tried editing the recovery image. Manged to remove some APK files, but SystemUI is giving me some problems.
What I did until now:
1) Used simg2img to convert system.img to a mountable image
2) mounted the previously generated image and deleted suspicious folders from system/app and system/priv-app.
3) Use SPFT to flash the edited image to the device.
However, I found that SystemUI.apk is also making dubious requests in the background, so I need to replace it with a stock version. I tried taking SystemUI.apk from different roms of similar phones, with a similar SoC, and copy-paste it into my edited system.img. However, everytime i do this, SystemUI crashes when the phone starts up.
Going into the stock recovery, i have the option to "check root integraty". This appears to scan (among others) all APK files in system/app and system/priv-app. I see it detects the deleted APKs and the 1 modified APK. Could the installer have a signature of the expected APKs and not install if the file doesn't match that signature?
Is there any way I can replace SystemUI.apk with a known good version?
Bump..
Bump again..

How can I modify "ramdisk.img > init" file?

Hi, recently I've dual-booted my computer with Android & Windows 10. But the android rom has shown too much ads so I've deleted the files causing to show the ads from the "system.img" and also "ramdisk.img" (downloaded from internet) and replaced the files with the original ones. Now the ads are not showing but I had built-in root access with SupperSU which I've lost after replacing "ramdisk.img". So I've extracted the original and the downloaded "ramdisk.img" and found an "init" file which doesn't have any file extensions and the "init" file is differing in size between the original & downloaded "ramdisk.img". So I think this file may be the cause to revoke root access. So need to change the file.
Does anyone knows which type of file is the "init" file and how can I edit it?

Categories

Resources