Write File in /sys dir on a "not rooted" device - Android Software/Hacking General [Developers Only]

Is it possible to write a new file in a /sys.. directory by a .sh file on a not rooted device?
Thank you

Not possible brother

will I lose the guaranty if I root the device?

daniel93 said:
will I lose the guaranty if I root the device?
Click to expand...
Click to collapse
Yes u will lose warranty
But if u own MIUI THAN U WONT LOSE WARRANTY

The Hard Gamer said:
Yes u will lose warranty
But if u own MIUI THAN U WONT LOSE WARRANTY
Click to expand...
Click to collapse
Since it's a Tv Box it's not possible to root the device.
I'm trying to edit the Firmware. I extracted the "system.new.dat" but I can't find a way to add a file to a directory that is not there.
When I hard reset the Tv box I find many folders:
-one of them is /sys/... where I have to put my file
- another one is /system/... witch I'm looking now that I've extracted the Firmware.
Any Ideas?

What file would you have to push to your /sys folder???
Alternatively, have you tried turning it on, running adb su push or adb shell? Once you have a shell im pretty sure u can pop in adb shell sh ****.sh & run an exploit for temp root at least....

I'd either search for forums discussing your specific t.v. or explain what the file does for you to see if we can come up with a non-root alternative

Related

[Q] Getting rid of Fota File

Hello guys,
I been trying in the little time I have to get rid of Fota file by using ADB but have not successfully been able to delete those files. I am not quite sure what is the process to do it but this is what I have been trying.
Open CMD
1- go to platform-tools folder on CMD
2- Type adb push c:\directory\fota_delta_dp1\ \data\fota\
3- repeat for second fota file.
It says that failed to copy c:\directory\file\ \data\fota\ since is read-only
How do I make it "writable" or what am I doing wrong,
I wanted to mention as well that my phone is rooted.
Find Root Explorer. Install it.
Change the file system to R/W.
Then, navigate to \data\fota and delete the files.
-Steve
sgyee said:
Find Root Explorer. Install it.
Change the file system to R/W.
Then, navigate to \data\fota and delete the files.
-Steve
Click to expand...
Click to collapse
Need to be rooted to use this method
Sent from my DAMN Galaxy 4G¡!
Success100 said:
Need to be rooted to use this method
Sent from my DAMN Galaxy 4G¡!
Click to expand...
Click to collapse
The OP said his phone was rooted.
-Steve
However you want to get root shell and do:
# cat /dev/null > /data/fota/fota_delta_dp1
# cat /dev/null > /data/fota/fota_delta_dp2
Well thank you for your advises. I ended up using "Super Manager" checked in setting "Use root function" went to the folder were i had the files alreadt unzipped and copy them over to /data/fota which replacea both of the fota files. Rebooted the phone and had 280mb of available storage.
When i get home i'll make a tutorial using Super Manager.
Sent from SGS4G

simple question (adb)

If I want to copy and replace a file in system folder via adb, do I need to root my phone or does adb temporarily root my phone when connected?
i don't know. the only way it would work is if you mount system as read/write first. try that and see what it says. i assume you need to be rooted though since you need superuser permissions. check the adb website for proper commands cuz you might have to open up a shell and such first blah blah blah lol.
Thanks for reply, any else have an idea?
root is a MUST !
You must have root/superuser permissions to have read/write access to your phones system folder.
Sent from my Hero that never dies! ;D

[Q] Anyway that I can recover my phone???

Hello,
I have LG Optimus Elite Android 2.3.7...it was rooted...
I accidentally deleted /system/bin/sh...gee..oh my god..
The problem is that I am not even able to adb to my phone now..
If I do adb to that phone, it is complained about /system/bin/sh doesn't exist something...
Gee...........
Obviously, factory reset didn't help cuz it didn't restore the sh...
What would be my option ??
When I just reboot my phone, it is just stay "Welcome to" screen...Even though I touched the begin, it won't go next..I think because..
my /system/bin/sh file is deleted..so my phone can't execute anything from the phone shell..
What would be my option to recover my phone?
Please help
Thanks,
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
I would follow his advice. Good luck!
Thanks for your suggestion.
BTW, nandroid backup -> I don't think I can use it because I don't have original backup rom?
Odin -> does this also work for LG phone?
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
goforandroid said:
Thanks for your suggestion.
BTW, nandroid backup -> I don't think I can use it because I don't have original backup rom?
Odin -> does this also work for LG phone?
Click to expand...
Click to collapse
No, you can't use nandroid backup. A nandroid is an image file of your system partitions. PC users typically know this as ghosting or cloning. To linux users, it's just a dd. You create the image yourself from a working copy. You don't need the original ROM. You can make a backup of your /system partition (nandroid) any time you have a working copy.
PS I'm an idiot. LG was literally the first thing u said. And you are correct. You need to use LG Flash Tool.
See 1942836
Unfortunately, 1942836 is not the same model I have.
I don't think I can use that instruction.
It really makes me crazy since I can't use adb at all....
I tried creating update.zip and put it in sd card to install..however, as you may know, signature verification failed.
if I could get key file to create signed zip file other than test one, that may work.
Is there anyway I can bypass the signature verification??????
Thanks,
anotherguy19 said:
No, you can't use nandroid backup. A nandroid is an image file of your system partitions. PC users typically know this as ghosting or cloning. To linux users, it's just a dd. You create the image yourself from a working copy. You don't need the original ROM. You can make a backup of your /system partition (nandroid) any time you have a working copy.
PS I'm an idiot. LG was literally the first thing u said. And you are correct. You need to use LG Flash Tool.
See 1942836
Click to expand...
Click to collapse
Can't you reflash your system?
I think you need /bin/bash for adb to start, so without it, you can't push anything from your computer to your phone i guess..
What bootloader do you use?
1bymany said:
Can't you reflash your system?
I think you need /bin/bash for adb to start, so without it, you can't push anything from your computer to your phone i guess..
What bootloader do you use?
Click to expand...
Click to collapse
Obviously, before happening this issue, I was able to use adb...
And..now..if I issue adb, then nothing shows up in the list of devices attached section...I guess because it can't communicate somehow with /system/bin/sh I just accidentally deleted.
I know that I can use Odin to install CWM for Samsung phone....I just found that there is LG Flash tool program on the internet does simialr thing like Odin for LG phone..however, I am not sure where I can find the dll that I can use from LG Flash tool program.
Any idea?
Thanks,
goforandroid said:
Obviously, before happening this issue, I was able to use adb...
And..now..if I issue adb, then nothing shows up in the list of devices attached section...I guess because it can't communicate somehow with /system/bin/sh I just accidentally deleted.
I know that I can use Odin to install CWM for Samsung phone....I just found that there is LG Flash tool program on the internet does simialr thing like Odin for LG phone..however, I am not sure where I can find the dll that I can use from LG Flash tool program.
Any idea?
Thanks,
Click to expand...
Click to collapse
You will indeed have to reflash your device, as you don't have any other way of putting the bash binairy back.
I guess, as you are rooted, you know how to reflash your device. If you don't, search the forum
grtz
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
perfect

[Q] Modify files in /sys folder

Hello:
My sk17 touch screen is bricked because i flash a wrong ROM y tryed every fix posted here but no one work, so after days of research i find i have a missing file in /sys/devices/platform/spi_qsd.0/spi0.0 folder i want to add it but android prohibited.
I try it in ES File Explorer with root and R/W enabled and with ADB commands but still no luck
Is there i way to modify files in /sys folder?
Is the phone rooted? If you can get a custom rom onto it like cwm or twrp then you should be able to use adb as root and put the file there. If you want to try this just ask me how.

Quick way of accessing screen to broken devices.

Hi,
So my screen broke yesterday and I needed to check my phone for missed important calls. I know there is lots of solutions out there, but I needed a way access your screen without the installation of any software on your phone. I was lucky because my digitizer still works so I can still use the touch feature and figure out on my screen where to press . I figured i would post it, might save someone someday....
Note: Works on Android 4.0 +
You need to have have developper options enabled so this can work. So first of all, I need to enable ADB from recovery. There is lots of post on the forum and google, so I will not cover this part.
Once I had ADB enabled, I wrote a small batch file that would take a screenshot from my phone, then pull it to my pc, wait 1 sec, then restart. After I used chrome and a auto-refresh extension to refresh the image every second. I will assume that you have ADB installed and all drivers for adb working. Here it goes
1. You will need to create a batch file. Open notepad and paste this into it.
Code:
:start
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
timeout 1
goto start
Save it as ss.txt, or whatever you like. Then go to desktop and rename ss.bat or "whatever you like.bat"
This may vary a bit if you do not have an SDcard, or if your directory is not named the same way, So change SDcard to the name of your storage folder.
Copy it to your adb directory.
2. Open a Command Prompt as Admin change directories to ADB folder. Once you are there, just type ss and the batch should start.
3. Open chrome and install an auto-refresh extension. I used this one:
HTML:
https://chrome.google.com/webstore/detail/easy-auto-refresh/aabcgdmkeabbnleenpncegpcngjpnjkc?hl=en
4.Then open your c:\ drive in chrome (type in the address bar file:///C: ). Navigate to your adb folder and open screen.png.
5. Start auto refresh on screen.png opened in chrome and set to 1 second.
Now you will have a screenshot of your phone being refreshed every second! I agree its slow, but its an easy way to get on your phone and configure other applications such as vnc or other stuff or just to get the phone number of that hot date you had last night.
Other thoughts: I your digitizer is broken, you can always just get a USB on the go adapter and plug-in a mouse and use ADB over wifi.
I guess you can also use an usb micro to hdmi adapter and plug it in to a monitor, they have them at bestbuy for 20$ if you dont want to make your life complicated.
Have Fun!
Need busybox do you not? screencap is not in my /system/xbin nor /system/bin folder
kirito9 said:
Need busybox do you not? screencap is not in my /system/xbin nor /system/bin folder
Click to expand...
Click to collapse
What phone and what rom are you using? What I read is that some vendors do not include screencap in their stock rom. ..
Steph_D said:
What phone and what rom are you using? What I read is that some vendors do not include screencap in their stock rom. ..
Click to expand...
Click to collapse
Using Blu Dash Jr D140a, stock ROM ( Gingerbread 2.3.6)
kirito9 said:
Using Blu Dash Jr D140a, stock ROM ( Gingerbread 2.3.6)
Click to expand...
Click to collapse
Should of mentionned, dosen't work with gingerbread, you need 4.0+ if i recall correctly. Maybe, if your lucky, the manufacturer may have included their version instead of screencap since it did not exist back, i would take a look in the bin folder to try to find an equivalent if not you are out of luck with this method.
Steph_D said:
Should of mentionned, dosen't work with gingerbread, you need 4.0+ if i recall correctly. Maybe, if your lucky, the manufacturer may have included their version instead of screencap since it did not exist back, i would take a look in the bin folder to try to find an equivalent if not you are out of luck with this method.
Click to expand...
Click to collapse
OP should be updated then and here's my bin folder.
kirito9 said:
OP should be updated then and here's my bin folder.
Click to expand...
Click to collapse
Ya, I don't believe it will be possible for you using this method. :/ Sorry Will update original post...
Steph_D said:
Ya, I don't believe it will be possible for you using this method. :/ Sorry Will update original post...
Click to expand...
Click to collapse
No problem, I will try on my 4.2.2 device.
EDIT: It works bro. Nice little guide of doing it manually

Categories

Resources