Sorry in advance if I'm missing something simple but I'm at my wits' end here...
For a while now I've been slowly researching and learning how a possible root exploit could work, and finally I managed to come up with an attack plan and set up a build toolchain, only to find that I can't even run a simple Hello World!
Now I'm only a bit familiar with linux environments and even less so with android ones, but I'm pretty sure something's not right here. Trying to run anything I put on the phone just spits back "not found". Also, any command that actually can't be found gives me "permission denied", from my searching online I couldn't find out whether this is the correct behavior.
Code:
$ ./hello
./hello
./hello: not found
$ hello
hello
hello: permission denied
$ ls -l
ls -l
drwxrwxrwx shell shell 2011-08-09 21:21 bin
drwxrwx--x mot_tcmd shell 2011-06-29 08:50 12m
-rwxrwxrwx shell shell 5585 2011-08-09 21:10 hello
drwxrwx--x mot_tcmd shell 2011-06-29 16:38 tmp
(Had to strip down the commands for the overzealous spam filter, this is running from /data/local)
From what I've seen in the other threads in this forum people have been able to run busybox and such from this location, so does anyone have a clue what's going on here?
Alternately, if there's anyone that's very familiar with native-code android development or the android kernel, particularly regarding network capabilities, please let me know here or via PM/e-mail so maybe I can figure out if my exploit is even possible.
/data/local ? I didn't realize adb had access there. I run busybox from /tmp there's about 2mb of space there for us to use.
Good luck to you.
Well, I went and found a prebuilt busybox and that works, so I'm assuming there's something wrong with the binaries I'm making.
Right now I'm using the Code Sourcery GNU/Linux ARM toolchain as recommended by various sources online, since it seemed like the easiest option for someone with minimal experience with the GNU build tools. But unless I can get it working, seems like my only other option (without learning all the details of GNU development) is some "agcc" script somebody made a few years ago, which may not even work anymore, and would require me to do a full build of the android source in a linux VM.
So, anyone have any insights or experience on building native binaries fairly painlessly?
Try changing the permissions of the file.
chmod 755 /data/local/filename
Sent from my ADR6400L using Tapatalk
im pretty sure u are building a binary for another arch than arm...
Related
Question: Where can I acquire statically-linked binaries for use on the G1?
Explanation: I'm looking to use dircolors with the bash port already provided, in order to enable ls --colors=auto. I'm willing to cross-compile if there are relatively simple ways to set up an environment to do so, if that's what it takes, though I have no experience doing so.
Background: I've looked throughout Q&A, Developers, and Programs, as well as a generic google search -- but my Google-Fu must be failing me, because I can't find any sources that seem to show me how to locate statically-linked ARM binaries. I tried dropping in a binary of dircolors, compiled for ARM, from the debian repos -- but I couldn't make it work. Maybe I'm just too much of a noob. I'd really like that functionality but I've never created it from scratch. I have been using Ubuntu Linux for almost three years now, so "./configure; make; make install" doesn't 'scare' me.
Any help from the peanut gallery would be /immensely/ appreciated.
Anyone? Bueller? Bueller?
I also am encountering the same issue. I've pulled the coreutils rpm for an ARM Debian distro, and, after some work to uncompress it (from within Windows), I have sourced the dircolors file, and copied it to my sdcard, then into path at /system/bin by using install /sdcard/dircolors /system/bin. I've then chmod 755 the file, and tried executing the file, no go, says not found... Even when I input the full path, still not found. I'm at a loss here, and would really appreciate any help, as ls colors would be nice while running under the bash shell.
Sorry... newb question... can not figure out this deal...
Trying to copy the jupiter files to my phone... can not.
I dont have permissions... how can I get permissions opened up?
Below is some of what I am getting in regards to errors -
C:\Documents and Settings\Kevin\My Documents\Downloads\android-sdk_r07-windows\a
ndroid-sdk-windows\tools>adb push jupiter.xml /system/etc/jupiter.xml
failed to copy 'jupiter.xml' to '/system/etc/jupiter.xml': Permission denied
C:\Documents and Settings\Kevin\My Documents\Downloads\android-sdk_r07-windows\a
ndroid-sdk-windows\tools>adb push jupiter.xml /sdcard/jupiter.xml
failed to copy 'jupiter.xml' to '/sdcard/jupiter.xml': Permission denied
C:\Documents and Settings\Kevin\My Documents\Downloads\android-sdk_r07-windows\a
ndroid-sdk-windows\tools>adb shell
$ su
su
Permission denied
$
Note - this is a samsung captivate phone with a fresh cognition 2.36b rom and I used one click root on it to root the phone after the build..... (but I think the rom was rooted to start with??
Sorry ... just need a way to get access to this phone - trying adb.... also is there a windows file manager that would browse/edit the contents of this phone?
thanks in advance Kevin
PLEASE DIVERT ALL QUESTIONS TO Q&A FORUM NEXT TIME.
IF you're on Froyo.. for some reason froyo does not allow pushing to /system .. at least for me that's the case (someone correct me)
root your phone:
1. adb push /sdcard/jupiter.xml
2. adb shell
3. su
4. cp /sdcard/jupiter.xml /system/gps/jupiter.xml (or wherever you need to put it)
5. do the same for the rest of the files.. but tbh
THERE'S NO FIXING GPS YET
darkamikaze said:
PLEASE DIVERT ALL QUESTIONS TO Q&A FORUM NEXT TIME.
THERE'S NO FIXING GPS YET
Click to expand...
Click to collapse
What he said.
If froyo didn't fix your gps then you are sol. But don't be so sure its still broke, it can take some time on the first lock. Once it gets a lock within 5-10 meters it should work decent afterwards with the occasional hiccup usually when its not used every day. But some are reporting poor performance still with froyo.
A factory reset can fix some bugs I have seen on jf7 and ji6 on my phone causing the gps to turn off. Jj4 doesn't seem to have that bug on my phone. Cog2.3b6 is jj4 based
Some claim to have performance degrade over time, I think that's all placebo but others have completely different experiences with gps than I do. I notice it having to occasionally need to get new gps data causing a delay in the initial lock but it seems more random than progressive and I never fail to get a lock.
If you are trying to use the jupiter.xml file in the gps solution thread from clshortfuse our what ever his name is, you will likely see an no improvement to a slight improvement. It gets faster locks on eclair roms but on froyo the jupiter file already resembles his and the major difference being that his forces the google server for gps data.
Sent from my SAMSUNG-SGH-I897
OK thanks for all the help so far -
I had a n82 phone, like 2-3 years ago, it was awesome.... google maps and all... blue dot was where the phone was... I could watch me walk around my house... it would show me getting the mail walking down the drive way to the mail box and back....
I have an iphone 3gs....works fine.... maybe not quite as good as the n82 did, but works ok, locks quick and will the blue dot with in a few feet of me IN MY HOUSE.
While I dont get this whole GPS problem on this phone I hear you about not trying to fix it.
I have some limited unix experience... used vi and other stuff, was able to move,copy, edit and replace files... change permissions and other standard stuff.
So if the cognition rom is rooted as is, and I was rooted before the rom, I assume I still am rooted....
Why wont the commands I tried work?
I did not try the other commands noted in this thread, yet, I will soon.
So is it my phone? or do I have the commands/syntax wrong?
If I am going to stick it out with the phone I need to figure out how to fix it.
thanks again for your help.
Kevin
Any ideas or reasons why this command would not work?
C:\Documents and Settings\Kevin\My Documents\Downloads\android-sdk_r07-windows\android-sdk-windows\tools>adb push jupiter.xml /sdcard/jupiter.xml
failed to copy 'jupiter.xml' to '/sdcard/jupiter.xml': Permission denied
My file on my PC is in the folder I am working from ....\tools and I assume I should have permissions to the sdcard folder?
Any help would be appreciated.
thanks Kevin
Have you made sure to grant superuser permission on the phone?
I had that issue the first time I tried it and found that I hadn't granted superuser access.
Also to the OP, if you switch to Perception, DG includes the Jupiter fix in the ROM.
You can't push to /system in FROYO.
you have to push it to /sdcard first
adb shell
su
cp /sdcard/jupiter.xml /<LOCATION>
and chmod it
and chown it.
thanks for the help... to make sure I have the right permissions I need to use the chmod and chown commands -
Do I need to mount the system first? Something like -
Code:
adb shell
$ su
# mount -o rw,remount /dev/stl9 /system
# chmod 777 /system/etc/*
thanks again, Kevin
haeffnkr said:
thanks for the help... to make sure I have the right permissions I need to use the chmod and chown commands -
Do I need to mount the system first? Something like -
Code:
adb shell
$ su
# mount -o rw,remount /dev/stl9 /system
# chmod 777 /system/etc/*
thanks again, Kevin
Click to expand...
Click to collapse
I would never do 777 on any file. Jupiter.xml should be 644 and user and group root.
Sent from my SAMSUNG-SGH-I897 using XDA App
Hi,
it's my first post here and I'm aware that I'm going to ask a typical newbie question... But after quite a long period of browsing the internet and this forum I concluded that I need help So I hope that I don't annoy anyone...
My intention is to prepare my Nexus One to use Cyanogenmod. To do that, I want to use a Linux PC instead of a Windows PC. I bought my Nexus from Vodefone in Germany. All current OTAs are installed. Some more specific information: Android 2.2.1, Build FRG83D.
I understood, that at first I have to root my Nexus and need to unlock my boot loader. But I'm a bit confused by the number of different approaches to root/unlock the Nexus One which can be found in this forum and via google. The most of the guides require a Windows PC. To me it was not possible to decide which approach I should follow in order to safely unlock and root my Nexus.
So far I've tried to root my device with the tool "ANDroot", but it won't work... I assume, that I need to follow a more complex approach via a USB-connected PC. I'm a quite experienced Linux (Ubuntu) user and want to use linux for rooting and unlocking my device.
I don't ask for someone to explain to me in detail how to do it! But it would be great if someone cold tell me whether it is easily possible to root and unlock my device from Linux and if so where I might find some comprehensive explanations.
Many thanks in advance and regards from Germany!
try here
http://ilikemygooglephone.com/2010/...-and-root-google-nexus-one-mac-windows-linux/
Look here, under root: http://forum.xda-developers.com/wiki/index.php?title=Nexus_One
I say forget the one-button root and go the OG way, but I guess it just comes down to how comfortable you are with the process.
The process doesn't change very much regardless of what OS you are running.
All of the SDK adb commands are exactly the same - it's just ./adb rather than adb.exe.
Follow the instructions on the Android SDK download page for setting up the SDK on your system, and then follow instructions here for unlocking/rooting/flashing your device.
Just because you use Linux doesn't make you "special"
Thanks a lot for your replies!
Actually I just needed to realize that the Android SDK runs on Linux as well, and that with even less issues than on Win (no need for fancy USB drivers).
Very good for an overall overview: theunlockrDOTcom/2010/01/02/how-to-root-the-nexus-one/
One just has to realize that e.g. "fastboot-windows" has to be replaced by "fastboot_linux"...
A showstopper was the annoying "install-recovery.sh" script which kept me from loading into the new installed recovery image. But after consulting google the following saved me from freaking out:
Code:
./adb shell
$ su
# rm /system/etc/install-recovery.sh
rm failed for /system/etc/install-recovery.sh, Read-only file system
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# rm /system/etc/install-recovery.sh
# exit
$ exit
After that is was straightforward to install CyanogenMod by following their specific update guide:
wiki.cyanogenmodDOTcom/index.php?title=Nexus_One:_Full_Update_Guide
And now I'm happily enjoying even a FM radio which I did not expect while thinking of installing CyanogenMod...!
shouldn't adb oem unlock do the trick?
Bloodflame said:
shouldn't adb oem unlock do the trick?
Click to expand...
Click to collapse
It's fastboot oem unlock ... but potato-patato.
To the OP...
I know you probably thought of this already but add
Code:
export PATH=~/android/tools/:$PATH
to your bash .rc script so you don't have to put up with ./adb each time you want to use the adb command.
sassafras
whoops. i should stop posting when tired
don't pay attention to me
Verizon's third 4G Android smartphone is out today. I think that it is worth having a separate for development here, eh?
I second this request
I agree. This is a solid phone.
I also agree to it's own forum
agreed, especially with the fact that it's rooted now, def needs an area here!
stetsonaw said:
agreed, especially with the fact that it's rooted now, def needs an area here!
Click to expand...
Click to collapse
How hard was it to root? Was the bootloader unlocked or just an easy unlock?
I was trying to decide between the Thunderbolt and the Revolution(not a samsung fan).
LG doesn't seem or want to lock anything down! Hurrah!
How is the battery life on that phone compared to the thunderbolt? Better, worse, or indistinguishable?
This device was so easily rooted. Time for the custom ROM's for this device...
Sent from my Droid using XDA App
Windows ADB Root Method
Speaking of easily rooted...
Remember, I am not at fault if you brick your phone, now, proceed.
I updated the Rootzwiki page with the same info found below for rooting via Windows... see the rootzwiki for the Linux steps.
Busybox actually comes installed by LG on the Revo, how awesome is that??
Download the rageagainstthecage binary
Download the SU binary
Move these files to the same directory your adb.exe is in.
Open Command prompt (either use the Windows Key+R and type cmd or start/run, then type cmd)
32-bit users: >cd c:\program files\android\android-sdk\platform-tools
64-bit users: >cd c:\program files (x86)\android\android-sdk\platform-tools
Or >cd (whatever directory adb is in)
>adb devices (verifies you are connected)
>adb push rageagainstthecage-arm5.bin /data/local/temp/rage
(if the above command fails due to read-only, type 'adb user' then 'adb root' to validate root status, then 'adb devices' again to verify connection)
>adb push su /data/local/temp/rage
>adb shell chmod 777 /data/local/temp/rage
>adb shell ./data/local/temp/rage
>adb shell
#mount -o remount,rw -t ext3 /dev/mmcblk0p12 /system
#busybox cp /data/local/temp/su /system/bin/su
#chmod 6755 /system/bin/su
Verify the file is in place w/correct permissions
#cd /system/bin
#ls -l *su
-rwsr-sr-x root root 26248 2011-05-29 01:09 su
(permissions name access filesize date time filename)
At this point, you may way to remove the files you put in /data/local/temp (optional):
#rm /data/local/temp/su
#rm /data/local/temp/rage
continue with commands
#reboot
Download and install SuperUser from the Market
Thanks Zennmaster, _mrbirdman_ for finding the linux routes and birdman for helping me out!
One the Revo gets its own section, I'll post this there.
qipengart said:
Verizon's third 4G Android smartphone is out today. I think that it is worth having a separate for development here, eh?
Click to expand...
Click to collapse
I totally agree
Does SuperOneClick rootig method work on this particular device?
Sent from my DROID2 using XDA App
From what i've been told, yes it does... newest version using the gingerbreak exploit. (gingerbreak app does not work)
Or you can do it the long way...
LG Revolution Root the Windows ADB way
Played with this device and actually thinking about procuring it. After all, since rooting is so easy, wifi tethering should be easy to procure and with 4G blazing fast.
An answer would do me great justice....thanks!
We want a section for the lg revolutionaires!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!yeah!!!!!!!!!!!!!!!!!!!!!!!:d:d:d:d:d
Revolution section likely coming soon. It's "likely" and not "definite" because we're still trying to determine whether there's enough interest towards this device.
svetius said:
Revolution section likely coming soon. It's "likely" and not "definite" because we're still trying to determine whether there's enough interest towards this device.
Click to expand...
Click to collapse
That's good to hear! I will voice my support for a Revolution forum. I'm loving the device so far - it's a solid phone that seems to be more than the sum of it's specs, and honestly I like the hardware build more than my OG Droid.
not sure if where allowed to post links, but androidcentral has a little community going already. The root thread has over 2k views alone. Seems like that should be good enough sign for a thread started here.
http://forum.androidcentral.com/lg-revolution/
Its definitley a solid device.
I upgraded from the Droid1 to this, and this phone is great! Loving it so far. I don't know if I want to go the custom rom route with this phone, but it would be nice to have some developer interest and some options down the road. I sure hope the Rev picks up interest because it really is a good device. With that said, I think the Rev having its own section can only help to increase awareness and interest in this phone.
svetius said:
Revolution section likely coming soon. It's "likely" and not "definite" because we're still trying to determine whether there's enough interest towards this device.
Click to expand...
Click to collapse
I went from a G2x to the Charge and finally settled on a Revolution. I guess I was just spoiled by those phones having their own forums... I am totally lost now... no home. Anyways, yes there is interest.
I'm trying to help the Replicant project (see redmine[dot]replicant[dot]us for more information) by porting their system to the Optimus Black, and I've just secured myself a P970g, but I'm having trouble installing CyanogenMod 10.0 (a prerequisite). For example, fastboot and adb don't seem to detect the phone; ./fastboot devices doesn't show anything.
The Replicant project is rather picky about the flashing tools they use; they need to be executable on GNU/Linux (which I'm using) and they need to be free software (licensed under the GNU General Public License, or any license that gives the freedoms of use for any purpose, distribution, and/or modification). I have the SDK installed; that's free software. Any software I run on the phone is fine, as long as it's either free and open-source, or the phone can be changed without proprietary software once the process is complete.
So, is there a way to install ClockworkMod on the P970g from my GNU/Linux computer without running proprietary software on it? All of the installation instructions I've seen so far appear to require it.
first, p970 has not been designed to work with fasboot. it works only in flash mode. for adb side, it needs to boot. second, I don't really understand your request because both twrp and cwm are open source so you can compile them from source. from my side, I made a cwm and a twrp flasher package as well for installing one of them easily. The compiler I've used is NSIS (open source too).
my question is, what's the problem ?
I made a cwm and a twrp flasher package as well for installing one of them easily. The compiler I've used is NSIS (open source too).
Click to expand...
Click to collapse
This may be useful. But are the packages themselves free software? If you don't explicitly license them under a free software license (http colon slash slash www dot gnu dot org slash licenses slash license-list dot html) and release the source code, then the Replicant project can't use them. If you have done this, I would appreciate it if you could point me to the download link for these packages.
you know, I don't have much knowledge about licensing, but in that case I don't think it needs any license. What I've made are simple containers with basic instructions. There is no any commercial purpose, restriction or anything else like that, because it's all about contributing freely. I mean, without any kind of charge. You can use or redistribute them, rightly because it's totally free. The source code of my work will be useless here, except if you plan to recompile for your needs. Everything can be done manually or in other ways. Note that the packages are for Windows. 7zip can be used to explore their containing.
http://forum.xda-developers.com/showthread.php?t=1111771
if you want, I can provide you the commands for flashing correctly
I actually do hope to recompile this program for my needs and would very much like to see the source code. You see, the Replicant project prefers that flashing tools support GNU/Linux. If you released the source code under an appropriate license, we could perform the porting and work from there.
You say you don't know so much about licensing? It's actually rather simple: if you decide to release the source code, just put this text as a LICENSE.txt file into the top directory of the repository:
Code:
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
okay, I'll be glad to help your project, but know that NSIS is script based, it's not really coding so I'm not sure if simple script based instructions could be considered as a true source code... you won't be able to recompile as it simply won't work under any linux environment. Although NSIS can be compiled for POSIX platforms, it's still in order to build Windows packages. This is why I proposed to share the commands (they are available around internet though). The main tasks of my packages is to apply known Windows commands with just a few clicks. In other terms, these are setup packages (like Inno etc..).
Just extract an img recovery file and apply proper commands for flashing, simple as that.
Never mind that; our problem is actually semi-solved. Are you the developer of BlackJack? Because that's where we need the source code noq.
yes but the exploit isn't from me. blackjack is obsolete for gingerbread and over, and I'm not a developer
Made in ZR
You see, we've figured out a way to install ClockworkMod using only free and open-source tools. But the device needs to be rooted for it to work. Of course there's a rootkit available for Gingerbread, but our users may be running Froyo, as my phone is. So, we'd still be very happy to see its source code. But it complicates things if you're not the author of the exploit. Do you know who did create it, so we can contact them?
sure, it's written by Scott Wlaker. His twitter and mail (he doesn't seem being registered on xda so I couldn't find him here)
I'm confused. It seems if you install ClockworkMod on a stock phone that you'll get a security error. See thread number 2094640.
Anyways, let me rephrase: I'm looking for a way to install CyanogenMod on a P970g running Froyo that doesn't use proprietary software. (You said you were the developer of Blackjack; even if you could just point me to the front-end code that'd be great.)
Who is the creator of SmartFlash? That could be even more useful if we could obtain its source code.
Roller_REP said:
I'm confused. It seems if you install ClockworkMod on a stock phone that you'll get a security error. See thread number 2094640.
Anyways, let me rephrase: I'm looking for a way to install CyanogenMod on a P970g running Froyo that doesn't use proprietary software. (You said you were the developer of Blackjack; even if you could just point me to the front-end code that'd be great.)
Who is the creator of SmartFlash? That could be even more useful if we could obtain its source code.
Click to expand...
Click to collapse
You get a security error if you install CWM recovery over LG's official Ice Cream Sandwish ROM, as it has a locked bootloader. This is not a problem for both Froyo and Gingerbread stock ROMS, as they have unlocked bootloader.
About SmartFlash, I don't know. I always thought it was a LG tool.
For ICS (not for Froyo/Gingerbread), this might help:
http://forum.xda-developers.com/showthread.php?t=2160394
Roller_REP said:
I'm confused. It seems if you install ClockworkMod on a stock phone that you'll get a security error. See thread number 2094640.
Anyways, let me rephrase: I'm looking for a way to install CyanogenMod on a P970g running Froyo that doesn't use proprietary software. (You said you were the developer of Blackjack; even if you could just point me to the front-end code that'd be great.)
Who is the creator of SmartFlash? That could be even more useful if we could obtain its source code.
Click to expand...
Click to collapse
As said before, you probably bricked your device after having missed something.
And you're still wrong. I'm not a developer, and never claimed it anywhere. I repeat, my packages are script-based so useless for linux. Smartflash originally needs 3 files to run, but I packed it into an autonomous exe (this version is only available in UPK). This tool is a leak from LG and wasn't destined to the public. It's of course, copyrighted, and there si actually NO other way for unbricking a hard bricked device.
What's required for running the exploit :
ADB
Superuser.apk
su (binary)
bysybox (binary)
sqlite3 (binary)
psneuter exploit (binary)
Superuser from Clockworkmod is open source (not used in blackjack).
Here are the Windows batch cmds for running the exploit properly :
Code:
Reseting server
---------------
adb kill-server
adb start-server
Waiting for device
------------------
adb wait-for-device
Pushing files
-------------
adb push files\busybox /tmp/
adb push files\psneuter /tmp/
adb push files\sqlite3 /tmp/
adb push files\su /tmp/
adb push files\Superuser.apk /tmp/
Running exploit
---------------
adb shell "chmod 0755 /tmp/psneuter"
adb shell "chmod 4755 /tmp/psneuter"
adb shell "/tmp/./psneuter"
[COLOR="Red"]# AT THIS POINT AN EXTERNAL INTERVENTION IS NEEDED FOR RESTARTING ADB (IT'S BASICALLY DESIGNED FOR HTC DEVICES)[/COLOR]
Mounting system
---------------
adb shell "mount -orw,remount -t ext3 /dev/block/mmcblk0p8 /system"
Applying root privileges
------------------------
adb shell "cat /tmp/busybox > /system/bin/busybox"
adb shell "cat /tmp/sqlite3 > /system/bin/sqlite3"
adb shell "cat /tmp/su > /system/bin/su"
adb shell "cat /tmp/Superuser.apk > /system/app/Superuser.apk"
adb shell "chmod 4755 /system/bin/su"
adb shell "chmod 4755 /system/bin/busybox"
adb shell "chmod 4755 /system/bin/sqlite3"
Rebooting
---------
adb reboot
Killing server
--------------
adb kill-server
Remember that this works only for Froyo.
I asked you "Are you the developer of BlackJack?" And you said "yes but the exploit isn't from me."
But thank you very much! As soon as I can find those files, that solves my problem. However, I can't see them in your upgrade kit...
Ilko said:
yes but... I'm not a developer
Click to expand...
Click to collapse
good luck
Made in ZR