Need stock param.bin for SM-P580 Please - Samsung Galaxy Tab A series Themes, Apps, and Mods

I soft bricked my tablet trying to change the boot splash on the tablet. I need the stock param.bin to flash back onto the tablet to get it to boot again. I can only get into download mode at this point.
To do this, first we have to find where the param.bin file resides, so fire up a terminal:
Code:
su #gain root
cd /dev/block/platform #this will take us to the folder we need the name of to run the dd command later
ls #copy the output of this command and cd in the next command
cd *pastethefolder* #the folder copied from previous command
cd by-name # change into by-name dir
ls #you will see PARAM in the output of ls
pwd #the output of this command will give us the absolute path of the param file
#copy the output of pwd
#now we can run the command to pull the param.bin file with the path copied from previous pwd command
dd if=/dev/block/platform/********/by-name/PARAM of=/sdcard/param.bin bs=4096
#this will give you a copy of the stock param.bin.
I really appreciate anyone who would possibly take the time to do this and get it to me sometime soon.

Is this what you're after?

Yes and it's now fixed you are awesome

Related

[Q] adb shell in batch

Hi,
I'm making a batch file (*.bat) for myself to try make some things easier file where I enter commands with adb.exe.
The problem is, any code after 'adb shell' is not executed in the batch.
So if I had a batch with the following:
Code:
adb shell
su
'su' will not be executed and stays at '$'.
It seems like it's too deep for a batch file to enter codes.
I also tried pushing a sh with the same script and run it from adb but then all I get it permission denied.
I have also tried 'adb shell su' without any luck.
Anyone with a solution?
Anyone? Or how about a .rc file that gets su and runs commands...
Sent from my HTC
To execute a script, you can always push your script and then execute it:
Code:
adb push script /sdcard/script
adb shell sh /sdcard/script
As for the commands you have shown, keep in mind that su doesn't simply change the running shell's permissions or the like but creates a new child environment within its own shell. You leave your script and after the new shell has finished, you're back in your old environment and the script continues.
mizch said:
To execute a script, you can always push your script and then execute it:
Code:
adb push script /sdcard/script
adb shell sh /sdcard/script
As for the commands you have shown, keep in mind that su doesn't simply change the running shell's permissions or the like but creates a new child environment within its own shell. You leave your script and after the new shell has finished, you're back in your old environment and the script continues.
Click to expand...
Click to collapse
yes, is there any way to automate the script inside the shell and use exit to finally go back to the batch script.
Can you provide me with an example of what you want to achieve?
To execute shell commands from a batch, it doesn't matter if I have to push a script and execute it. It's so that I get su and automate commands after that. Like flash_image, remount, chmod etc..
you will need to use the 'adb shell command' ad 'sh' files
I am trying to create a unix script file that copies files from /dbdata/databases to another folder as a backup.
When I try running the script in adb shell as SU, I get
cd: can't cd to /dbdata/databases
This is on a rooted Captivate. Any help would be greatly appreciated!
Hi,
su -c "command" should do the job for you. You will need to enclose the whole of the command in quotes however, otherwise su will be expecting the command to execute, doing nothing.
Example: adb shell "su -c 'sqlite3 /data/data/my.db/databases/mydb.db < /sdcard/dump.sql'" (run from a Unix or Windows(?) shell). Notice the use of "" and ''.
(in this case dump.sql contains .dump, for instance)
Of course the sqlite3 command could be placed within another script on the android device.
Hope that helps.
I looked around a bit and found the answer.
The simple answer is, wrap the command
Code:
cp "source" "destination"
in double quotes!
Thank you grindingbob for the adb shell "su -c 'sh /mnt/sdcard/tmp/2.sh'" command.
No probs I was more referring to executing commands as a su without interacting with adb shell.
As a side-note, cp might not be a good idea, unless you're sure no db accessing is taking place at the same time.
I am pretty sure well as sure as a novice can be! The files I am backing up are log files, call history and text message history.
The results from running a unix script which contains
Code:
cp "/dbdata/databases/com.android.providers.contacts/contacts2.db" "/mnt/sdcard/tmp4/contacts2.db"
cp "/dbdata/databases/com.android.providers.telephony/mmssms.db" "/mnt/sdcard/tmp4/mmssms.db"
cp "/dbdata/databases/com.sec.android.provider.logsprovider/logs.db" "/mnt/sdcard/tmp4/logs.db"
are only the logs.db file is copied, the other two are not.
grindingbob said:
No probs I was more referring to executing commands as a su without interacting with adb shell.
As a side-note, cp might not be a good idea, unless you're sure no db accessing is taking place at the same time.
Click to expand...
Click to collapse
Permission issues for *.sh files from ADB
Dear All,
I have a 3.2 device with Root permissions & Busybox.
I created a sample *.sh file, Pushed to SDcard, and gave '777' Permissions. When i Try to run it from ADB shell its not working Any help...
CMD prompt Traces:
Step -1: Created a sh file
cat TAB.sh
#!/bin/sh
cd /data/data/com.android.gallery/shared_prefs
Step -2 Pushed the file to SDcard
# ls -l *.sh
ls -l *.sh
-rw-rw-r-- root sdcard_rw 56 2012-03-13 15:06 SP.sh
-rw-rw-r-- root sdcard_rw 62 2012-03-13 15:05 TAB.sh
Step -3 Gave 777 permission for *.sh files
# chmod 777 *.sh
chmod 777 *.sh
# ls -l
ls -l
-rw-rw-r-- root sdcard_rw 56 2012-03-13 15:06 SP.sh
-rw-rw-r-- root sdcard_rw 62 2012-03-13 15:05 TAB.sh
Execute permission not applied
Tried other operations, dint workout
Step 4 other options:
# chmod +X *.sh
chmod +X *.sh
Bad mode
# chmod +x *.sh
chmod +x *.sh
Bad mode
# chmod u+x *.sh
chmod u+x *.sh
Bad mode
Any Help?

[DUMP] Sidekick 4G Partition + Kernel Source (Bootloader, Recovery, etc)

Credit to sofauxboho for performing dumps.
Partition Dump
http://gititbit.ch/sk4g2 - partition dump
Code:
bml1 256 KB contains boot.bin (262144 bytes), Primary Boot Loader (low-level hardware initialization)
bml2 256 KB contains PIT file first 512 bytes
bml3 10240 KB /dev/block/stl3 /efs
bml4 1280 KB contains Sbl.bin (1310720 bytes) Secondary Boot Loader (loads the Linux kernel and passes the necessary arguments)
bml5 1280 KB contains Secondary Boot Loader (for recovery, ect)
bml6 5120 KB param.lfs /mnt/.lfs j4fs
bml7 7680 KB contains zImage and initramfs
bml8 7680 KB empty - on Epic 4G and Fascinate, contains recovery.bin
bml9 293376 KB factoryfs.rfs ( /system RFS Partition) /dev/block/stl9
bml10 137216 KB dbdata.rfs ( /dbdata RFS Partition) /dev/block/stl10
bml11 35840 KB cache.rfs ( /cache RFS Partition) /dev/block/stl11
bml12 12800 KB modem.bin
EDIT: It has come to my attention that the Super One Click works, no need for a script.
More Mirrors
http://gititbit.ch/sk41 - Sidekick 4G system dump
http://gititbit.ch/sk4g1 - Sidekick 4G Info Dump
dev.txt
devblock.txt
efs.txt
mount.txt
partitions.txt
proc.txt
Kernel + Platform Source
http://gititbit.ch/sk4g5 - SGH-T839_OpenSource.zip
Now for custom roms...
SK4G development chat can be found at irc.freenode.net #sk4g
hey, sorry i'm not super code-savvy.... do i simply place the .rar file on my sd card, or open it with say, 7zip, and copy the autoroot folder over? i'm getting 'unable to chmod, operation not permitted' the second way, and 'not found, no such directory, etc' when i place the .rar file on my sd card. both of these are appearing after the first line with chmod 755 etc.
Use winrar to extract the .rar then place the extracted folder onto the sdcard.
dasmoover said:
Use winrar to extract the .rar then place the extracted folder onto the sdcard.
Click to expand...
Click to collapse
ok, think i did that, but am still getting 'operation not permitted'..... perhaps i'll hold off and see if someone else has success with it?
Hmm...
Should line 14 specify the su file rather than the containing directory?
It currently reads:
Code:
cp su /system/xbin/ && chmod 4755 /system/xbin/
But perhaps it should read:
Code:
cp su /system/xbin/ && chmod 4755 /system/xbin/su
Updated the script in the main download.
yogi2010 said:
hey, sorry i'm not super code-savvy.... do i simply place the .rar file on my sd card, or open it with say, 7zip, and copy the autoroot folder over? i'm getting 'unable to chmod, operation not permitted' the second way, and 'not found, no such directory, etc' when i place the .rar file on my sd card. both of these are appearing after the first line with chmod 755 etc.
Click to expand...
Click to collapse
Im getting this when I try the lines too.
When I copied the autoroot folder to my SK4G, the contents of the folder were already set to 775, so there should be no need to chmod (though I also get the permission error when trying to chmod them).
The bigger issue is that my device doesn't have the cp command. I'd assume it would be in /system/bin along with things like ls and mv, but it's not.
Huh. That's odd. You guys are using the newer download, right?
Do you have any idea which chmod command is erroring out? I'm wondering if it's the chmod on the rage...bin in line 9 or the chmod on su in line 14.
Unfortunately I can't test without wiping my SK4G back to unrooted, which I would rather not do as it's my primary handset.
If you don't know which line is causing the trouble, could you try copying the kit but then entering each line manually?
sofauxboho said:
Huh. That's odd. You guys are using the newer download, right?
Do you have any idea which chmod command is erroring out? I'm wondering if it's the chmod on the rage...bin in line 9 or the chmod on su in line 14.
Unfortunately I can't test without wiping my SK4G back to unrooted, which I would rather not do as it's my primary handset.
If you don't know which line is causing the trouble, could you try copying the kit but then entering each line manually?
Click to expand...
Click to collapse
No I was usin the old link didn't try new one yet. Still says same thing on new version
Sent From SK4G
sofauxboho said:
Huh. That's odd. You guys are using the newer download, right?
Do you have any idea which chmod command is erroring out? I'm wondering if it's the chmod on the rage...bin in line 9 or the chmod on su in line 14.
Unfortunately I can't test without wiping my SK4G back to unrooted, which I would rather not do as it's my primary handset.
If you don't know which line is causing the trouble, could you try copying the kit but then entering each line manually?
Click to expand...
Click to collapse
I tried the newer download. All of the chmods error because my user doesn't own those files or already have write permissions for any of them. I don't have read, write, or execute permissions for /data/local/tmp either, so I can't list or copy to that location. But, separate from that, there is no cp command, so I can't copy anything anywhere.
jarrodlombardo said:
When I copied the autoroot folder to my SK4G, the contents of the folder were already set to 775, so there should be no need to chmod (though I also get the permission error when trying to chmod them).
The bigger issue is that my device doesn't have the cp command. I'd assume it would be in /system/bin along with things like ls and mv, but it's not.
Click to expand...
Click to collapse
Ah, right! That's why I used cat instead of cp when I rooted mine.
Try this:
Code:
#!/bin/sh
#autoroot script for sidekick v0.1
#chmod 755 autoroot.sh
echo "Copying binaries to /data/local/tmp/"
cat su > /data/local/tmp/su
cat Superuser.apk > /data/local/tmp/Superuser.apk
cat rageagainstthecage-arm5.bin > /data/local/tmp/rageagainstthecage-arm5.bin
cd /data/local/tmp/
echo "I'm about to chmod rageagainstthecage-arm5.bin"
chmod 755 rageagainstthecage-arm5.bin
echo "Executing exploit, please wait"
./rageagainstthecage-arm5.bin
sleep 20
echo "Attempting to spawn root shell"
sh
whoami
echo "Attempting to mount /system read-write"
mount -o remount,rw /dev/block/stl9 /system
echo "Attempting to copy and chmod su"
cat /data/local/tmp/su > /system/xbin/su && chmod 4755 /system/xbin/su
echo "Attempting to copy Superuser.apk"
cat /data/local/tmp/Superuser.apk > /system/app/Superuser.apk
sleep 5
mount -o remount,ro /dev/block/stl9 /system
#add root entry to passwd and group
echo "root::0:0:root:/data/local:/system/bin/sh" > /etc/passwd
echo "root::0:" > /etc/group
echo "autoroot completed succesfully."
I've also added a bunch of echoed comments to help us track where things go wrong if it doesn't work.
sofauxboho said:
Ah, right! That's why I used cat instead of cp when I rooted mine.
Try this:
Code:
#!/bin/sh
#autoroot script for sidekick v0.1
#chmod 755 autoroot.sh
echo "Copying binaries to /data/local/tmp/"
cat su > /data/local/tmp/su
cat Superuser.apk > /data/local/tmp/Superuser.apk
cat rageagainstthecage-arm5.bin > /data/local/tmp/rageagainstthecage-arm5.bin
cd /data/local/tmp/
echo "I'm about to chmod rageagainstthecage-arm5.bin"
chmod 755 rageagainstthecage-arm5.bin
echo "Executing exploit, please wait"
./rageagainstthecage-arm5.bin
sleep 20
echo "Attempting to spawn root shell"
sh
whoami
echo "Attempting to mount /system read-write"
mount -o remount,rw /dev/block/stl9 /system
echo "Attempting to copy and chmod su"
cat /data/local/tmp/su > /system/xbin/su && chmod 4755 /system/xbin/su
echo "Attempting to copy Superuser.apk"
cat /data/local/tmp/Superuser.apk > /system/app/Superuser.apk
sleep 5
mount -o remount,ro /dev/block/stl9 /system
#add root entry to passwd and group
echo "root::0:0:root:/data/local:/system/bin/sh" > /etc/passwd
echo "root::0:" > /etc/group
echo "autoroot completed succesfully."
I've also added a bunch of echoed comments to help us track where things go wrong if it doesn't work.
Click to expand...
Click to collapse
Type this into terminal right?
Actually, I whipped up a modified version of dasmoover's tool with my changes:
http://notfine.com/android/sk4g/autoroot-V01b-sfb.zip
Unzip that and copy the "autoroot" folder to your SD card.
Next, eject your SK, turn off USB Storage mode, and unplug it from your computer.
Then follow dasmoover's instructions (I've cleaned them up slightlly):
1. Place autoroot folder on sdcard
2. Install the Terminal Emulator app from the Marketplace
3. Open the Terminal Emulator app and type the following commands exactly, one at a time, hitting enter at the end of the line:
Code:
chmod 755 /sdcard/autoroot/autoroot.sh
./sdcard/autoroot/autoroot.sh
If the sdcard is mounted as noexec, follow these steps:
1. Place autoroot folder on sdcard
2. Install the Terminal Emulator app from the Marketplace
3. Open the Terminal Emulator app and type the following commands exactly, one at a time, hitting enter at the end of the line:
Code:
cat > /sdcard/autoroot/autoroot.sh /data/local/tmp/autoroot.sh
chmod 755 /data/local/tmp/autoroot.sh
cd /sdcard/autoroot/
./data/local/tmp/autoroot.sh
Click to expand...
Click to collapse
All credit to dasmoover, btw! Thanks, and I hope you don't mind me modifying and repackaging your tool. Just trying to help get it working.
BTW, here are some good goodies on how this root exploit works for the technical and curious:
I'd read this one first: http://intrepidusgroup.com/insight/2010/09/android-root-source-code-looking-at-the-c-skills/
And this one second:
http://dtors.org/2010/08/25/reversing-latest-exploid-release/
How did you get rid of the $ sign and get a # ? When I type the first line with the ca it sayd directory can't be found.
Sent From SK4G
I copied the new cat version onto my device and did the following:
$ chmod 755 /sdcard/autoroot/autoroot.sh
Unable to chmod /sdcard/autoroot/autoroot.sh: Operation not permitted
$ cat /sdcard/autoroot/autoroot.sh > /data/local/tmp/autoroot.sh
Cannot create /data/local/tmp/autoroot.sh: permission denied
So, I'm still stuck since /data/local/tmp isn't writable. (Also, you'll note I fixed the small error in the cat line I used.)
Ace42 said:
How did you get rid of the $ sign and get a # ? When I type the first line with the ca it sayd directory can't be found.
Sent From SK4G
Click to expand...
Click to collapse
So, the # means root. The $ means not root. The whole point of this is to get the #, which indicates a root prompt.
If it says the directory can't be found then either the command was typed incorrectly or the files are in the wrong place. The files have to be in the exact right places with the exact right names.
Download my modified version:
http://notfine.com/android/sk4g/autoroot-V01b-sfb.zip
Unzip it, and it should give you a folder called "autoroot". Inside that should be four files:
autoroot.sh
rageagainstthecage-arm5.bin
su
Superuser.apk
Make sure there is only a folder named "autoroot" with those four files inside. If there is another directory inside it won't work. If the names are at all different it won't work.
Copy this "autoroot" folder to the top level of your SD card. There should be other folders there like Music, DCIM, Playlists, and Android. Maybe some others. Make sure it's at the very top level, along with these other directories.
Here, take a look at my directory structure:
{
"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"
}
(Yes, I'm on a Mac, but your SK and Android don't care. File locations work the same on Windows or Linux or whatever. Also, I may have some folders you don't have. That's ok.)
Next, eject your SK, turn off USB Storage mode, and unplug it from your computer. **I forgot this part earlier! It's important.**
Then open up Terminal Emulator an your SK4G. Type:
Code:
cd /sdcard/autoroot
Then type:
Code:
ls
This should list the same four files above. If it does, you're ready to start the instructions I posted previously.
If it doesn't, type:
Then type:
Code:
ls /sdcard/
Let me know what it says.
jarrodlombardo said:
I copied the new cat version onto my device and did the following:
$ chmod 755 /sdcard/autoroot/autoroot.sh
Unable to chmod /sdcard/autoroot/autoroot.sh: Operation not permitted
$ cat /sdcard/autoroot/autoroot.sh > /data/local/tmp/autoroot.sh
Cannot create /data/local/tmp/autoroot.sh: permission denied
So, I'm still stuck since /data/local/tmp isn't writable. (Also, you'll note I fixed the small error in the cat line I used.)
Click to expand...
Click to collapse
Yeah, I've confirmed this problem.
Folks, this thing won't work right now. We need a location that is both writable and allows execution. Any ideas?
(To confirm, you can still root by using adb to manually put these files at /data/local/tmp/ For some reason, adb has rights to this location. However, the standard Terminal Emulator does not. This is only a hang-up for on-device rooting, not rooting in general.)
sofauxboho said:
Yeah, I've confirmed this problem.
Folks, this thing won't work right now. We need a location that is both writable and allows execution. Any ideas?
Click to expand...
Click to collapse
I've poked around some and not found anywhere yet. :/

[Q] md5 mismatch nandroid restore

well i am on nmv 2.11.30(ics) rom nw, and i went ino recovery to do a nandroid restore of nmv 1.11.30(gb) and im getting this error - MD5 MISMATCH ..
help plz
i did rename tht folder but that cant be the reason rite
if i dnt get it back then ics bcums my daily rom !!! ..
Make a new MD5 hash, from here:
http://forum.xda-developers.com/showthread.php?t=976453
adb shell
# cd /sdcard/clockworkmod/backup/yourbackupfilefolder
# rm nandroid.md5
# md5sum *img > nandroid.md5
Click to expand...
Click to collapse
Greetz
sorry i dint understand how to do it, dnt knw wher to type this _ adb shell
# cd /sdcard/clockworkmod/backup/2010-06-29.20.22.53
# rm nandroid.md5
# md5sum *img > nandroid.md5
Make sure the name of the backup has no spaces and no special characters beside a:
-
rrohanjs said:
sorry i dint understand how to do it, dnt knw wher to type this _ adb shell
# cd /sdcard/clockworkmod/backup/2010-06-29.20.22.53
# rm nandroid.md5
# md5sum *img > nandroid.md5
Click to expand...
Click to collapse
You have to connect your device to your PC and boot into recovery.
Then, open up a Windows command prompt (assuming you use Windows, otherwise a Linux terminal) and navigate to the folder were the adb.exe (or adb for Linux) is stored.
Since you have rooted and unlocked your phone I assume you downloaded the Android SDK. This means that generally the adb.exe will be found in C:/android-sdk/platform-tools (or well, wherever you installed it).
Once you've navigated to the correct folder you can input those commands in the command prompt.
"adb shell' will start a shell running on your Nexus which you can control through your computer. The following commands are Linux commands to:
a) change directory to where your backup is saved
b) rm (remove) the existing .md5 file
c) create a new md5 hash
Good luck,
Greetz

[GUIDE] How to restore logd to your device/fix adb logcat read failure or empty logs

A few days ago, I flashed a zip onto my phone that set SELinux to permissive. However, there was a problem: it deleted logd, which is essential to adb logcat. Considering I'm an Android developer, that isn't a good thing! It took me a bit to figure out how to get it back, so I'm making this guide to share with you guys to help whatever poor soul has to fix this next.
Note that these steps were designed with Linux in mind, though they might be adaptable to Cygwin/OSX with some effort.
Also, make sure you delete any SELinux permissive scripts from init.d/su.d first!
Prerequisites
The OTA or custom rom zip that your device is currently running
adb
simg2img (available in the Ubuntu software repositories)
sdat2img (available here)
Instructions
Put your OTA/custom ROM zip file in a new folder and unzip it (this example is using the Pure Nexus ZIP):
Code:
mkdir restore_logd
cp pure_nexus_hammerhead-7.0-20161025-HOMEMADE.zip restore_logd
cd restore_logd
unzip pure_nexus_hammerhead-7.0-20161025-HOMEMADE.zip
Now, look for a file named either system.new.dat or system.img.
If you have system.img, then run:
Code:
simg2img system.img system.raw.img
If you have system.new.dat AND system.transfer.list, instead run:
Code:
sdat2img.py system.transfer.list system.new.dat system.raw.img
Either way, you should now have a file named system.raw.img. Next, mount it:
Code:
mkdir system_mnt
sudo mount -t ext4 -o loop system.raw.img system_mnt
This will mount the system image onto the system_mnt folder.
Plug in your device to your computer and make sure USB debugging is enabled, then run:
Code:
adb push system_mnt/bin/logd /sdcard/logd
adb shell
You should now be in a shell connected to your device. Inside, run:
Code:
su
mount -o rw,remount /system
cp /sdcard/logd /system/bin/logd
chmod 755 /system/bin/logd
exit
This will install the logd binary and close the shell.
This next part is very important! Making sure you closed the adb shell and are still inside the directory you created, run:
Code:
ls -Z system_mnt/bin/logd
If the output looks like this:
Code:
? system_mnt/bin/logd
then you have nothing else to do. Otherwise, it might look a bit like this:
Code:
u:object_r:logd_exec:s0 system_mnt/bin/logd
Copy part before the path; in this case, it's:
Code:
u:object_r:logd_exec:s0
Then, run:
Code:
adb shell su root chcon permission /system/bin/logd
replacing permission with the string you copied.
Now you can unplug and restart your device; logd should now be fully working!
Last but not least, run:
Code:
sudo fusermount -u system_mnt
to unmount the system image from your computer.
Enjoy!
Execute command failed while replacing permission
Code:
adb shell su root chcon permission /system/bin/logd
u:object_r:logd_exec:s0
/system/bin/sh: <stdin>[1]: u:object_r:logd_exec:s0: not found

How to pull mmcblk0 or any partition directly to pc?

I have tried following command on ADB to extract partition, but failed.
source:fciotti.com/2017/02/26/clone-android-memory
Code:
chmod +r /dev/block/mmcblk0
returns
Code:
Bad mode
Code:
adb pull /dev/block/mmcblk0 "mmc.img"
returns
Code:
remote permission denied
I have post a question on stack exchange, and found a command working but failed after dumping 4gb on sdcard (not directly to pc) because of file system.
source:android.stackexchange.com/questions/185433/problem-with-coping-mmcblk0-to-pc?noredirect=1#
Code:
adb exec-out "su -c 'cat /dev/block/mmcblk0'" > mmc.img
but it create a 0kb img file.
Please anyone help.

Categories

Resources