Surely This Wouldn't Work, Right?? - Security Discussion

Hello fellow forum go-ers of the Security section!!!!
This is my favorite area on this site & always makes me start thinking outside the box so to speak.
So i was thinking about Ubuntu & the ability to run a SU shell within it (not sudo but an actual SU shell by typing 'su' & providing your set password)
Would I be able to launch ADB commands from this SU shell & in turn run commands as any form of top tier user on my unrooted Android device???
Any responses appreciated!!! I really would like some input here on why this would or wouldn't be possible & how well the translated binary performs.
Thanks

No; but Yes. To some extent. This is why, in the *very* early days on Android, many XDA'ers had Terminal Emulator installed on our G1s. We could do build prop edits, push apps to install as system apps, "pull" backups, etc, etc.
These days I'm not sure, since I haven't experimented. However, I've got Kali on my tablet & a terminal app that lets me open either a Kali or Android command line either as a regular user, or as su.
I'm not sure if I helped here... Or if I just muddied the waters even more.

equi_design said:
No; but Yes. To some extent. This is why, in the *very* early days on Android, many XDA'ers had Terminal Emulator installed on our G1s. We could do build prop edits, push apps to install as system apps, "pull" backups, etc, etc.
These days I'm not sure, since I haven't experimented. However, I've got Kali on my tablet & a terminal app that lets me open either a Kali or Android command line either as a regular user, or as su.
I'm not sure if I helped here... Or if I just muddied the waters even more.
Click to expand...
Click to collapse
Little bit of both but that's fine as Kali is a small download! lol, thank you by the way, as my first device was an s2 skyrocket & I remember when it was literally almost all Unix/Linux & much more simple . More or less it killed me by falling out of the computer changes in tech while I caught up on the mobile side.
Again thank you!! as now im closer to certain that i haven't been wasting my time.

LilAnt530 said:
Hello fellow forum go-ers of the Security section!!!!
So i was thinking about Ubuntu & the ability to run a SU shell within it (not sudo but an actual SU shell by typing 'su' & providing your set password)
Would I be able to launch ADB commands from this SU shell & in turn run commands as any form of top tier user on my unrooted Android device???
Click to expand...
Click to collapse
Your android device has an operating system, which gets to make the rules about root. So does your computer. So, being root on your computer is not going to make you root on any other device -- that is, not unless the operating system on the other device is set up to really trust your computer a whole lot (or screws up).
So we might ask: why isn't it configured this way? Well, by way of analogy, imagine if anybody could get into your car and drive away, so long as they had the keys to some car! Or, to make that a slightly more fair analogy: imagine that your car would automatically assume that anyone who drives up in some other car, should be trusted and allowed to drive yours. Sounds like a bad policy, right?
As you may have noticed, some locks -- quite a lot of them, really -- actually do work that way: anybody with any key can unlock them. But those are not the kind of locks you want protecting your valuables while you're away

anonywimp said:
Your android device has an operating system, which gets to make the rules about root. So does your computer. So, being root on your computer is not going to make you root on any other computer -- that is, not unless the operating system on the other computer decides that it really trusts your computer a whole lot (or screws up).
We might ask: why isn't it configured to trust you? Well, by way of analogy, imagine if anybody could get into your car and drive away, so long as they had the keys to some car! Or, to make that a slightly more fair analogy: imagine that your car would automatically assume that anyone who drives up in some other car, should be trusted and allowed to drive yours. Sounds like a bad policy, right?
As you may have noticed, some locks -- quite a lot of them, really -- actually do work that way -- anybody with any key can unlock them. But those are not the kind of locks you want protecting your valuables while you're away
Click to expand...
Click to collapse
But theoretically in the real world i would just pop your cars hood, link up a NAPA BlueFuel On Board Diagnostics Tool (costs about $80 on Amazon) to your cars CPU, then proceed to unlock the doors with a button or simple OBDT terminal command. Then I could Jump Start your vehicle (after i stuck any similar models key into your ignition) & proceed to drive your car wherever i wanted just as if it were my own.....
What enabled me to do this? Having a similar models keys & some in depth administrative authority over your vehicle
For the sake of comparison those keys (Linux Kernel) and the Administrative Authority (The OS used to build the phones platform) should give me the same results (in my mind)

LilAnt530 said:
But theoretically in the real world i would just pop your cars hood, link up a NAPA BlueFuel On Board Diagnostics Tool (costs about $80 on Amazon) to your cars CPU, then proceed to unlock the doors with a button or simple OBDT terminal command. Then I could Jump Start your vehicle (after i stuck any similar models key into your ignition) & proceed to drive your car wherever i wanted just as if it were my own.....
What enabled me to do this? Having a similar models keys & some in depth administrative authority over your vehicle
For the sake of comparison those keys (Linux Kernel) and the Administrative Authority (The OS used to build the phones platform) should give me the same results (in my mind)
Click to expand...
Click to collapse
Actually, this is very often how Windows Domains work. Just "run as Administrator" and you have rooted your whole organization. Obviously that's not how it's intended to work and this would represent a mis-configuration of your Domain if your IT department intended to maintain administrative control. But, for whatever reason, this really does happen; it's not even all that rare.

anonywimp said:
Actually, this is very often how Windows Domains work. Just "run as Administrator" and you have rooted your whole organization. Obviously that's not how it's intended to work and this would represent a mis-configuration of your Domain if your IT department intended to maintain administrative control. But, for whatever reason, this really does happen; it's not even all that rare.
Click to expand...
Click to collapse
Okay Windows is not based on the Linux Kernel, you have no SuperUser capabilities as described on Ubuntu,
The main points of this disccusion were to point out the similarities in platforms & then again in the SU Binaries used on each specifically, thus (hopefully) creating a gap we could bridge, allowing for previous "unrootable" devices to gain root .

Related

OpenSource Android / Closed Door G1.

I have Purchased the G1 Thinking the overall architecture of Open Source Application, Android API, Equality of Application bla bla.
But after see the Handset i think it only Open for Source Code
neither we can create own on Modified Images nor we can change the Device at Root level. Its same f*cking thing like Apple iPhone Jailed and no Root Access.
We got some Android SDK but whats the use we can Create same Application for iPhone and Windows Mobile also. Infact in WinMob we have thousand of Software running nicely.
I am very Disappointed the way G1 is Locked with the Open Source OS.
i think in the name of Openess G1 device have locked everybuddy to f**k around with T-Mobile and Google only Service. Android Market have very Little apps which can Surprise me after all that hype of Software Availability. Infact 1st Generation iPhone had more Application which Developers have Developed without help of any SDK from Apple. G1 really sucks.
Well, i regret that fact too, but in fairness they never said the device would be open. What they said was "You can make your own device and use Android on it".
It's sad that T-Mo didn't get the "open" part but in all case my hopes are with chinese device manufacturer who don't care for 5 minutes what you do with their hardware as long as you buy it. Or maybe OpenMoko but their design is really ugly
Okay, being able to type commands on the keyboard and have them executed as root from anywhere on the device IS NOT SAFE.
What happens when someone tells you to type rm -rf / and hit enter? Brick? YES from anywhere on the device. Even from the lock screen.
They are not locking down the phone again, they are fixing a MAJOR bug. The phone is not "Jailed."
its said when god closes doors he opens new ones
Since the door is closed, how to put your own native lib to the system? Is there any way to use native lib?
sadly i find both Android and iPhone OS as restrictive.
because nope of Future Manufacturer is gonna allow us the Flash the Customised Android to Phone unless we know the Private Key of that Manufacturer. There is nore of Legal way to do much powerfull Developements in Kernal , drivers or boot loader of Android etc. What we got is that Ugly ADB thing which itself is so much Restrictive. I feel like am developing the software again as what we have done in Java on Mobile for Sony Ericson etc.
Google could have offered us a Safe but Power full access to hardware for Customized OS. and they could also have safeguarded device from Possibly bricking by bad flashing.
I think Phone OS should more like Installing Linux / Windows into Computer rather then Boot loader and so on.
hetaldp said:
I have Purchased the G1 Thinking the overall architecture of Open Source Application, Android API, Equality of Application bla bla.
But after see the Handset i think it only Open for Source Code
neither we can create own on Modified Images nor we can change the Device at Root level. Its same f*cking thing like Apple iPhone Jailed and no Root Access.
We got some Android SDK but whats the use we can Create same Application for iPhone and Windows Mobile also. Infact in WinMob we have thousand of Software running nicely.
I am very Disappointed the way G1 is Locked with the Open Source OS.
i think in the name of Openess G1 device have locked everybuddy to f**k around with T-Mobile and Google only Service. Android Market have very Little apps which can Surprise me after all that hype of Software Availability. Infact 1st Generation iPhone had more Application which Developers have Developed without help of any SDK from Apple. G1 really sucks.
Click to expand...
Click to collapse
Well, I also miss a lot of stuff in G1 at least. System is so powerful, but closed, only thing in G1 is you can change batter if necessary and put bigger size transflash. I miss SIP, for every text entry I have to type using keyboard everytime. The other major issue, which Kaiser (Tilt) addressed very well, is removing battery cover to change SIM card. I have good number of Windows Mobile phones and iPhone before G1. I take different phone, whatever matches my belt or whatever I feel like, and changing SIM card is pain except for Kaiser and iPhone. G1 taking out the battery cover is so bad, it is like having older Dell desktop lying under the table and plugging a usb device. For older dell lattitudes, you have to knee down and push your usb cable angularly, otherwise it would either screw the usb port or you could push it for good time. The same goes to G1, you have open the keyboard, push the latch little and push your battery cover slowly to righside. Not a good idea, if you change phones daily like me.
Like the other one said, if you have root privileges, you could brick your device, if you don't have one, you don't know what you are doing. TMob and HTC screwed Google big time on this. I don't know how much control Google has on device makers and carriers. I see same pattern that Microsoft is struggling with WinMo devices here. At least in the case of Microsoft, we can easily play around devices without bricking like writing apps is easy, finding apps is easy and hacking device without bricking easy, at least if somebody doesn't have time to hack, they could easily look at our forum (XDA) and be creative.
my 2 cents.
--Ram--
I hate to say it but 99.9% of the customers T-Mobile is marketing don't care about having root access or installing operating systems on their phone or having easy access to their SIM card. I'm a programmer and I don't even care about that kind of stuff for my phone. The difference between this and something like the iphone is that you can write an app to replace pretty much anything you see on any screen on the phone and post it in the marketplace. Even with things like an on-screen keyboard there's no reason why it can't be done, there's just nobody who's made one yet. Hell, we already see apps that won't ever exist for non-hacked iphones(the 3 or 4 video players out there, tunewiki and other audio players, AndNav and things like the app that turns on your screen when you get an SMS message). If you really care about that stuff, return your G1 and get a OpenMoko or something similar.
I'm interested to see what the future holds for factory unlocked Android devices. Maybe T-Mobile decided the G1 cant be offered unless they have control over the firmware. When the handset manufacturer isn't tied down to these restrictions, it is possible that will grant root access by default.
As far as the possibility of bricking the phone, that is a stupid argument IMO. First of all, its my phone which I paid for which should give me the right to do what I want with it. Second of all, it should be brick proof to begin with. If I completely corrupt the filesystem, I should be able to go into the bootloader and and flash a new image to the device.

seems like a whole lot of intense hacking for 'opensource'

Being a fan of Linux, and an Ubuntu user, I guess I thought Android was going to be a lot more openly tweakable, but from looking over these threads it looks like it's actually not that easy to do things that I would have assumed would be easily accessible tweaks... like theme/appearance/fonts/icons, etc... In fact it looks like some pretty intense hacking is going on with slow progress in bypassing , etc...
Maybe I'm not understanding correctly. I don't have the G1, but my girlfriend does and I've been enjoying it from over her shoulder... I guess I just expected something more 'open' along the lines of what I've become used to with Ubuntu.
I kind thought Android would be to iPhone, what Linux OS is to Apple OS, but it definitely doesn't seem like that's the case. It seems like Android is just as locked down as iPhone but with fewer apps and not-as-slick interface for the same price as an iPhone.
I had been thinking about getting this phone... maybe I just need to wait for more apps to come out?
Any thoughts?
As of right now we do have a little more opensource than anything else. And like all new software it will take time to learn what to do. Obviously people didn't get Mac OS 3 and immediatly know how to hack it so they could do things they weren't meant to do. And of course same goes with mobile phones. When WM5 came out they had to learn about the new OS and it takes awhile.
So far the freedom we have already surpasses that of any other. We have internet sharing (for those with root) that is far better than the old USB or BluetoothPAN method(which btw is going to be a new profile, it is in the source)
I am willing to bet that as soon as it hits 1.0 that we will see it go entirely open with the ability to flash the rom and all.
That makes sense... I just have to be patient Thanks for the reply!
Open source != open system.
Open source means just that... you can see the source code. That's it. It doesn't imply or confer any other right of access, and with most open source licenses the licensor (Google & HTC) is free to build closed systems just as locked down as one based on proprietary code. Many commercial systems (Android included) are underpinned by open source code for cost savings or stability/security reasons.
Edit:
what Linux OS is to Apple OS
Click to expand...
Click to collapse
That's comparing apples to oranges. Linux is not an operating system; it is an open source kernel on which an operating system can be built.
Fact of the matter is, OS X's Mach kernel is partially descendant from BSD, so you could say the center of OS X is open source as well. More info at wikipedia's Darwin entry. For being a "fan of Linux" you don't seem to understand some of the core principles.
If I am not mistaken Mac's are unix based right? many the kernel is similar to linux... which is why the filesystem structure is similar as well.
But you are correct open source means you can see the source... but usually when someone can see the source they find a way to get around security holes that lock down the system.
With open source and developers an open system is possible. And we already know we can do it because we have modified the updates that are sent which change the system files. so all you need to do is put a new boot.img and a new recovery.img and replace the root system directory... before you know it you can have this running any version of android and/or anything else that will run on an ARM6 device.
Don't make it so complex. It's meaningless to play the words game.
To make it simple:
As a developer, on G1, we are not able to do what we can do on a linux PC, and that was my understanding about the open source smartphone OS.
To be practical, for the same project I ported for Android, Windows Mobile and iPhone, I would say: Windows Mobile is the most open one (friendly) for developer. You can even make your own driver on it. So I would say Windows Mobile = smart version of Windows Desktop. But I cannot say Android = smart version of linux.
I really hope Google can push a little bit to the carriers to open the root for us. Android really needs to be more developer friendly. Otherwise, it is hard to compete with iPhone, since the key part of Andorid was "openess".
jashsu said:
Open source != open system.
Open source means just that... you can see the source code. That's it. It doesn't imply or confer any other right of access, and with most open source licenses the licensor (Google & HTC) is free to build closed systems just as locked down as one based on proprietary code. Many commercial systems (Android included) are underpinned by open source code for cost savings or stability/security reasons.
Edit: That's comparing apples to oranges. Linux is not an operating system; it is an open source kernel on which an operating system can be built.
Fact of the matter is, OS X's Mach kernel is partially descendant from BSD, so you could say the center of OS X is open source as well. More info at wikipedia's Darwin entry. For being a "fan of Linux" you don't seem to understand some of the core principles.
Click to expand...
Click to collapse
As a developer, on G1, we are not able to do what we can do on a linux PC, and that was my understanding about the open source smartphone OS.
Click to expand...
Click to collapse
It's like you've never even heard of embedded linux before. Show me where on the G1 advertising or packaging it claims to be a Linux PC.
To be practical, for the same project I ported for Android, Windows Mobile and iPhone, I would say: Windows Mobile is the most open one (friendly) for developer. You can even make your own driver on it. So I would say Windows Mobile = smart version of Windows Desktop. But I cannot say Android = smart version of linux.
Click to expand...
Click to collapse
WM gives the developer deeper system access. That's awesome for developers maybe, but calling it a "smart" is probably going a bit too far.
I really hope Google can push a little bit to the carriers to open the root for us. Android really needs to be more developer friendly. Otherwise, it is hard to compete with iPhone, since the key part of Andorid was "openess".
Click to expand...
Click to collapse
Android's security framework design is solely Google's responsibility. Tmo doesn't even remotely factor into it. If you don't like the default Android system lockdown then download the codebase and compile it yourself without the security settings. Security is there to prevent neophytes from opening shell and f__king their phones up.
jashsu said:
Android's security framework design is solely Google's responsibility. Tmo doesn't even remotely factor into it. If you don't like the default Android system lockdown then download the codebase and compile it yourself without the security settings. Security is there to prevent neophytes from opening shell and f__king their phones up.
Click to expand...
Click to collapse
And run it, how?
From my understanding, the only way to get a firmware onto the phone ATM is from the recovery menu, which will only install signed updates from Google. Yes, we've got a way around that for now, but it requires root access.
How would you install a self compiled version of Android onto the G1 on the official RC30?
Gary13579 said:
And run it, how?
From my understanding, the only way to get a firmware onto the phone ATM is from the recovery menu, which will only install signed updates from Google. Yes, we've got a way around that for now, but it requires root access.
How would you install a self compiled version of Android onto the G1 on the official RC30?
Click to expand...
Click to collapse
No clue. I'd probably do it with a Freerunner or something that is specifically designed as an open system. The recovery menu is not the only way to write to internal memory; i'm sure the HTC bootloader has some provision for usb access.
You have all of the Android operating system at your disposal in the form of source code (provided you agree to the license). If you want to write/port low level drivers for it go right ahead. You just can't run it on the G1. They chose to lock down the Android implementation on G1 and you're dissatisfied with that. That's like being dissatisfied that a house has locks on it when the architect gave away the blueprints and floor plans for free.
jashsu said:
That's like being dissatisfied that a house has locks on it when the architect gave away the blueprints and floor plans for free.
Click to expand...
Click to collapse
Except when you buy a house, they generally give you the keys.
Gary13579 said:
Except when you buy a house, they generally give you the keys.
Click to expand...
Click to collapse
Yeah I know, it's a flawed analogy.
If you want to have free reign over your Android, I suggest you get a Neo Freerunner to play with. I say play because the open source portion of Android is missing a lot of closed source Google added value apps (Maps, Gmail, etc) that define the G1. Also the porting process is still ongoing.
Android's security framework design is solely Google's responsibility. Tmo doesn't even remotely factor into it. If you don't like the default Android system lockdown then download the codebase and compile it yourself without the security settings. Security is there to prevent neophytes from opening shell and f__king their phones up.[/QUOTE said:
Stop playing the work game and understand the simple Thing that Developers want full Access to device in order to build Software Beyond Generalised Application, like bluetooth drivers, codecs, themes, different home shell the way we do in Windows Mobile
You said take OpenSource and Customise the OS by bypassing some security for shell access. Now Lets understand 98 % device get automatically f**ked with RC30 and there is no Reversal!!! If you can build any Customised Android Package which can bypasss Security for shell access and also Bypass Signature checking just do it for me so i can Revert to Shell Access from f**king RC30.
Click to expand...
Click to collapse
hetaldp said:
Stop playing the work game and understand the simple Thing that Developers want full Access to device in order to build Software Beyond Generalised Application, like bluetooth drivers, codecs, themes, different home shell the way we do in Windows Mobile
You said take OpenSource and Customise the OS by bypassing some security for shell access. Now Lets understand 98 % device get automatically f**ked with RC30 and there is no Reversal!!! If you can build any Customised Android Package which can bypasss Security for shell access and also Bypass Signature checking just do it for me so i can Revert to Shell Access from f**king RC30.
Click to expand...
Click to collapse
98% of G1s might get derooted with RC30, but guess what? 99% of users don't need root or don't care. Tmo and HTC didn't build the G1 as a device for devs to hack and play with. That's why its a subsidized $179 phone and your unlimited dataplan is $25.
99% Percent people dont want it but if we develop some Application which is beyond the SDK thing we must have to have root access to all device in order to Install it.
Adobe is releasing Flash Plugins for Browser lets see they can do it by just releasing APK Package in Market or a Pushed OTA Update. If Adobe requires OTA Update then Smaller Company and Developers see hard time to develop such Extension without Googles Permission.
Just make your Science clear before commenting it
hetaldp said:
99% Percent people dont want it but if we develop some Application which is beyond the SDK thing we must have to have root access to all device in order to Install it.
Click to expand...
Click to collapse
Of course. I am just saying that there is a sense among some people that they are entitled to root access simply because G1 is built on Linux. You are not entitled to anything of the sort. If root is important to you then sell your G1 to someone who doesn't care about root (there are a lot of these people) and buy a Freerunner.
Every OpenMoko phone I have seen looks like they are competing for ugliest phone ever. I know the G1 isn't that pretty, but oh my god, I would be embarassed to carry that in my pocket.
I already own more then 6 Smartphone. And i don't use G1 also becuase of Microsoft Exchange things. I dont have any Complaint for Exchange Connectivity.
Here the Question is how can i develop some more powerful Application / extension / core Part and Distribute it across all G1 users the way we do it in Windows.
This means my core Application can run in free Runner (OpenMoko) but it will not be available in G1 user group. There will be handfull user who may use free Runner but its not my Market. I require bigger community to sell the Software buddy.
Here the Question is how can i develop some more powerful Application / extension / core Part and Distribute it across all G1 users the way we do it in Windows.
Click to expand...
Click to collapse
If you need to get below the VM on stock ota G1 then most likely your product will need to become a part of the Android platform (meaning open sourcing). The integrity of the os and user data is one of the main reasons the Android sdk only supports the VM.
I'll be interested to see how Adobe's flash implementation for G1 works. Flash is closed source, and Google has explicitly stated that the entire Android platform is open source. My guess is they will patch the Browser to accept signed binary plugins. Perhaps Google's signature will require a peek at the source. I'm only speculating though...
Yeah using SDK we can only Develop Application which run itself in the Sandbox cna they can communication with other Application using intents, you can share Data using content Provider, share the Setting using Preference. We can develop some services in apps to handle Asynchronous process.
We we ca not do is recompile the Whole Modded Source, replace or test drivers, codec, low level binaries.
The SDK is fairly powerful out off the Box for Standalone things. !
Thats why i have made a different demand to google in this thread
http://forum.xda-developers.com/showthread.php?t=444893
The only thing tmobile is worried is tethering, as they give unlock code after every 90% day Subsidized Handset unlocking is not a big worry for them.
Just think If you want to develop On Screen keyboard it require more powerful access to core system and its beyond Google Sandbox approach.
jashsu said:
It's like you've never even heard of embedded linux before. Show me where on the G1 advertising or packaging it claims to be a Linux PC..
Click to expand...
Click to collapse
Show me where did I say Android = a linux pc. Same, I didn't say Windows Mobile = Windows XP/Vista.
I hate to play the word game.
jashsu said:
WM gives the developer deeper system access. That's awesome for developers maybe, but calling it a "smart" is probably going a bit too far..
Click to expand...
Click to collapse
That's why I thought very high with Android. But the limited development access makes it worse than WM.
jashsu said:
Android's security framework design is solely Google's responsibility. Tmo doesn't even remotely factor into it. If you don't like the default Android system lockdown then download the codebase and compile it yourself without the security settings. Security is there to prevent neophytes from opening shell and f__king their phones up.
Click to expand...
Click to collapse
Could you please show us how to get the root from the f__king rc30?
Do you rebuild the whole linux on your pc if you just want to make a simple application?

Jesusfreke. Can you or another programmer please consider this.

In the next update on the recovery console, would it be possible to add a script that when you type /? like in old dos commands, that you will get a list of bash commands? Or does such an animal already exist.
I have a copy of about 5 sheets of paper listing all linux bash commands (similar to dos but without all the syntax).
While updating one day, I messed up and started from that point on trying to learn the linux commands that copy files, rename files, remount /sdcard and so on. Its fairly simple, but it would be nice to do for example remount/? and give you the proper usage of remount and so on. I know most of you all are not DOS fans, but I need a ground zero to start from if i wanna learn the way this runs, without carrying around a stack of papers with me .
--help works eg. ls --help
dont have a g1 yet so cant try it out, but what if you try remount --help or maybe its just one -
i will try that
I didn't see it in the list.
i dont think that wud the greatest thing becuz wat if ur typing a message anything you type in can damage your phone
kay11224 said:
i dont think that wud the greatest thing becuz wat if ur typing a message anything you type in can damage your phone
Click to expand...
Click to collapse
Huh? Wah?
Well I tried --help
This only helps if you happen to know the bash command. It is a step in the right direction.
What I am referring to is a list of /? help files.
It is a list of commands to include such commands as ls, cp, rm, remount, cd .. and so on. The reason why I say it is because with a small description of the bash commands people that have a working knowledge of computers, but not neccessarily of linux would be able to use it.
I know eventually I will probably remember the commands or at least the ones most important to me. I only ask because it took me about 1.5 hours to figure out a simple delete filename X.zip (rm update.zip), Copy filename X.zip to /sdcard (cp blahblah.zip /sdcard), mv blahblah.zip update.zip.
It took me using another computer to figure out those simple commands. I know it seems like I am asking something very redundant and simple, but I don't understand why linux command line doesn't have a help list of terms.
It wasn't until I read these bash commands that it dawned on me that recovery.sh was the recovery script to be executed from the command line. I couldn't have used it anyways, because by then I had already messed that up too.
Suffice to say I got my phone up and running and I am feeling a little proud of figuring it out on my own.
Brutal-Force said:
This only helps if you happen to know the bash command. It is a step in the right direction.
What I am referring to is a list of /? help files.
It is a list of commands to include such commands as ls, cp, rm, remount, cd .. and so on. The reason why I say it is because with a small description of the bash commands people that have a working knowledge of computers, but not neccessarily of linux would be able to use it.
I know eventually I will probably remember the commands or at least the ones most important to me. I only ask because it took me about 1.5 hours to figure out a simple delete filename X.zip (rm update.zip), Copy filename X.zip to /sdcard (cp blahblah.zip /sdcard), mv blahblah.zip update.zip.
It took me using another computer to figure out those simple commands. I know it seems like I am asking something very redundant and simple, but I don't understand why linux command line doesn't have a help list of terms.
It wasn't until I read these bash commands that it dawned on me that recovery.sh was the recovery script to be executed from the command line. I couldn't have used it anyways, because by then I had already messed that up too.
Suffice to say I got my phone up and running and I am feeling a little proud of figuring it out on my own.
Click to expand...
Click to collapse
"bash comes with help for all built-in commands. To see a list of all built-in commands, type help. To obtain help on a specific command, type help command, where command is the command you need help on. Here's an example:
bash> help alias
...some help text...
Obviously, you can obtain detailed help on the bash shell by typing man bash at your command prompt at any time."
The shell on the G1 doesn't seem to support it though...you would be better off getting comfortable in a real Distro and then apply the knowledge on the much less robust G1
This isn't quite so simple on Android.
First, you're not using bash. You're using either the android shell which is pretty limited or you're using the busybox shell (reachable with "busybox sh") which, I believe, is bourne shell compatible, but lacks some new features of bash.
Busybox is an single executible that implements a bunch of the common linux command line utilities. You're intended to symlink a bunch of command names back to busybox, but last I checked, this wasn't done so as to avoid stomping on the native android commands. You may need to type "busybox <command>" to run the right one.
To get a list of supported commands, run busybox with no arguments. Some commands have a --help option, but that won't be helpful for much of them unless you're already familiar with them.
The full documentation for any command is available as a "man" page (manual) on most linux systems, but you're not going to see it on an embedded system like android. But if you do a google search for "man <command>", you can easily find them. Many of the less basic options listed in the man page may not be available in the busybox version.
To get a list of busybox commands just type 'busybox'
If it flies off the top of the screen, type 'busybox | more'
I hope that helps.
Thanx everyone for the replies.
I had already printed out a command list which I googled. I will definitely try the busybox command. Although computers are not new to me, linux is. I am just having a slow time getting started, especially since busybox really isn't linux.
Why developers won't implement this request:
Brutal-Force: It's good that you got an answer by printing out a reference. That definitely will help you. Most of the utilities in JF's images support the standard GNU format of --help instead of /? so you're most of the way there.
Now, here are some reasons you won't get your actual request.
1) ? in the sh style shells is a protected character. To get remount /? you would actually have to type remount /\? or remount '/?'
2) All of the applications themselves would the have to be changed. Their relevant "getopts" or self-implemented methods of reading cmdline options would have to have the /? added to them. There's not a common point to change there. A quick count shows me over 150 different applications that would have to be changed.
3) It's ridiculous to cater to such a small crowd for something that is so labor intensive and can be done better with a simple documentation search.
Now go forth and RTFM. You'll be a better hacker for it.
note: JF likes notes. So do I.
note: A "hacker" is somebody like JF who makes hackable things do what hacker wants. Those other malicious @$$holes are called crackers. We don't like them.
whoa whoa whoa
First and most importantly,
BASH != DOS
Ever. Period. Don't even compare the two.
That said, learn how to google. BASH is very complicated with tons of command, keywords, etc. It is a scripting language after all.
Now, I do not see how it took you 1.5 hours (!) to figure out cp, as the first result of 'bash + how to copy files' in google gives you a link to all you could want to know.
For a complete list of command, type 'man busybox' in google and you are all set. Infact 'man YYY' will give you the manual for any command in Linux. Bash is not for those who do not want to learn, but, if one does learn it, there is no turning back from its goodness
Ok, Please take it easy on me.
This was not a "compare dos with linux" thread.
It was not a make my work a little easier thread.
I was updating 1.41 RC33 themes "AS USUAL". One of the theme designers made a boo boo. My phone went into loop while I was at work. The only computer I have access too does not have a USB port and is a Network computer that does not allow me access to this site. That being said, the only reference I had was to google linux commands. From the printout I had to figure out what does what. cp does not equal copy even though it shares two of the same letters. mv does in no way resemble rename so how on earth was I supposed to equate the two.
The problem with most people who already know linux is that they are not as helpful as a Dos or Windows "?" If they were I am sure there would be alot more people willing to give it a try. This is not really a rant, but I was asking for help, not begging to be tortured.
A few of the answers i.e. busybox helped. I did not know this, and at the time I could not look on the forum for help. I do not know about these other commands as well. Despite all that I was able to figure it out from a printout, I was just saying that knowing the list of Android based unix commands with a small one or two word description would go a long way.
P.S.
Thanx Just, Tiber and Boogie for helping me and not flaming me.
Bagkawilo
"Now, I do not see how it took you 1.5 hours (!) to figure out cp, as the first result of 'bash + how to copy files' in google gives you a link to all you could want to know."
See here is where you let your mightier then thou attitude get in your own way. For the record, that was exactly the pages I have printed out. Additionally, those pages give you way to much information to perform a specific task such as copy. Now, if i had gone to cp (Which again by the way does not mean copy to me, yes I might have figured it out quicker) but to me cp might as well have been cd.
Before I even got to that command I first had to figure out how to even access my sdcard. Next because this IS NOT DOS changing directories is, while similar, NOT THE SAME. What you have been practicing for quite some time may seem quite trivial to you, but for others its like learning a new language. I could perform the same functions in Dos or Paschal (The programmers language I learned in 15 years ago), BUT I am trying to learn YOUR language.
Seriously, I hope you never have kids who ask you how to do homework.
Just a thought
Brutal - I hope you don't think I was flaming you (you didn't mention me), because I certainly wasn't. It does come to my attention, though, that perhaps having root access on a bleeding edge image on a Linux based phone without any Linux experience is maybe like learning to pilot the Death Star before you figure out how to change the batteries in your light saber. It's good that you're learning along with the rest of us, hang in there. My recommendation: go download a copy of Slackware Linux and install it in a VirtualBox machine. Break it. Fix it. Learn how you fixed it. Break it some more.
/Just sayin...
ccosby said:
It does come to my attention, though, that perhaps having root access on a bleeding edge image on a Linux based phone without any Linux experience is maybe like learning to pilot the Death Star before you figure out how to change the batteries in your light saber.
Click to expand...
Click to collapse
As much as I enjoy a good Star Wars reference, this is a little off. I think it's more like learning to pilot a Speeder Bike before you figure out how to change the batteries in your light saber. We all know an Ewok can do it but just like the furball it's easy to go flying into a tree!
ccosby said:
go download a copy of Slackware Linux and install it in a VirtualBox machine. Break it. Fix it. Learn how you fixed it. Break it some more.
Click to expand...
Click to collapse
I'm not denying that is not a great way to learn, but unless you have a goal you're trying to accomplish it usually doesn't accomplish much. In my case I'd played with a copy of red hat years ago but without purpose so I didn't gain much. Recently I purchased a new router and loaded on a copy of DD-WRT. I had read about using it directly as a server (ftp/web/dlna) and even a bit torrent client. I wanted to use these features, so it took me a week of learning linux to get them installed. I broke the new features alot, but I didn't break my router.
So where am I going with this? I think perhaps instead of telling people to go out and learn it somewhere else, providing the answer and pitfalls to avoid would be more productive.
Like Benmeyers said.
I have had a couple different linux os's on my machine over the years, but they were only installed a very short while. I didn't see the "necessity" over windows.
Like Benmeyers said now I have a need for it. As many have pointed out, the busybox is not actually linux. What I need is to learn all of the busybox commands, which many have given me useful tips. Installing a while distribution of linux on my computer might just be overkill, and with root, I can do it just as well, after all.. it is like installing debian on my phone.
While I lived in Germany for 8 years, I HAD to learn to speak German, I went to a German Trade School because there were no American ones, and people at the one I went to did not speak English. My point is out of neccessity I had to learn it, and there were Germans who were proud that I was taking the time to learn THEIR language. I became very fluent because people took the time to help me. The ones that just laughed at me are the same ones that complained that the stinking Americans and other foreigners never bother to learn their language.
Anyway, thanx for all the help.

[Q] Large Android TV set top box deployment

Hello All,
I originally posted this question in the Android general forum but I didn't get any traction so I'm posting here in the hopes of finding some folks in the community with ideas for this project. I work for a not-for-profit children's hospital. The idea is to create a patient entertainment system (think the LodgeNET style systems in hotel rooms) using less expensive and more open hardware/software. We've purchased a few Android based set top boxes such as the EnjoyTV (I'd post the link but it won't let me) and have managed to get them configured the way we want.
The situation we're struggling with now is managing 200+ of these boxes out in the field. I have a few ideas but no one here really with the Android experience to bounce them off of.
Some thoughts:
- We would like to be able to completely reset the device to 'factory' defaults when patients leave rather than worry about locking down the devices too much.
- We would need the defaults to be our configuration, specific applications installed and perhaps even some hospital branding involved.
- I know I can reconfigure the ADB daemon on the device to listen on the ethernet port as opposed to USB.
- In doing so there is no security but I can handle security in the network layer using ACLs etc.
- I should then be able to use remote ADB commands to reset the device which I can script but what will get reset? Will my cusotmizations/apps go away? Will I have to compile a custom ROM?
- Is there a better direction to go in entirely?
Any help or even just a jab in the right directly would be GREATLY appreciated, both by myself and the kids who will benefit while they're here.
Hi,
I think you need MDM solution.
Ideally you might want to get Device admin rights and then reset it from remote easily.

Development Environment Setup: Hardware?

Asking this question because the attempt to get TWRP on my device is becoming a compound problem as the distance to being able to build it approaches 1. Otherwise known as the law of inverse noobness: Hindsight is always 20/20. Personally, not even half way to 1 in being able to do this, as am fairly new to doing things at the operating system level of programming. Not brand-new though, and knowing how and where to look things up helps, so if you have hints or can point me in the right direction that'd be great. First question is sort of along the lines of "how do you setup your dev environment" if you want to make it modular? More precisely:
So right now, the build page for AOSP concerning my device says to use Ubuntu 14.04 and do all those things to set it up for that. Do I need to do that in order to get TWRP built for my device? To have it set up the same way as the AOSP advises? Having a different computer for each dev environment would be a bit much, but running them in qemu seems even more ridiculous. Perhaps a better idea is to set up a "build environment" on bootable USB sticks that do all the work? That would simply a lot of things, like not having to swap out hard drives, and being able to easily clone a USB drive to "just work" and build AOSP/TWRP at will on any computer.
For reference, it is the Moto G Power (2021) "Sofia" device. They've released sources for it, but not much development going on. So learning how to do this for my device might just unlock TWRP (and with it, probably the Nethunter kernel/chroot environment) for other devices not yet supported.
Help me, help you. Thanks.
(Have other questions, too).
Why not use WSL2?
How to install Linux WSL2 on Windows 10 and Windows 11
The latest version of the Windows Subsystem for Linux is a significant upgrade; for most, it's now easier than ever to install.
www.windowscentral.com
jwoegerbauer said:
Why not use WSL2?
Click to expand...
Click to collapse
I don't use windows.
Bump.
Asking this because it seems that, being new to programming and having no formal training, I'm missing something from tutorials (like the TWRP git page, or some of the tutorials here on this forum that haven't been updated since 2013) and other material that might be thought to be "known" or "implied" and I just can't seem to understand what. Because when I go to build projects or whatever, following tutorials to the letter, still end up with errors and other problems that aren't covered in the tutorial. Part of that problem is installing dependencies, and then having them conflict with other installed things, like having two of python and three versions of java. So having a "build environment" to prevent conflicts is something that wasn't taught, but learned through trial and error, but that isn't the only problem I'm having.
McChadwicke said:
For reference, it is the Moto G Power (2021) "Sofia" device.
Click to expand...
Click to collapse
Hmm. I have the same model, but it's "borneo".
Did you build TWRP for your device? Any pointers or tips?
I usually just modify stock recovery to have rooted, permissive ADB.
I really don't need more than that in a recovery.
I haven't done much with my GP21 since the Firehose loader is restricted.
Renate said:
I usually just modify stock recovery to have rooted, permissive ADB.
I really don't need more than that in a recovery.
I haven't done much with my GP21 since the Firehose loader is restricted.
Click to expand...
Click to collapse
Not sure why the last reply didn't quote you...
Setting up a build environment is an evolving problem. As of this writing it seems the Ubuntu team is switching to a "pro version" system, a paywall, for some services...
Also, AOSP recommends Ubuntu 14 for a build environment. Gave up trying to run it from USBs lol, it is running on a dedicated system. But android-sdk is no longer available in apt, while running Ubuntu 14.04 + latest updates? So went to check why and now AOSP is using its own system for build environment setup and management. Tried running it in Ubuntu 14, but gave errors with the setup script provided.
Seeing now if I can't get the android sdk to run in Mint-XFCE... Will check back. TWRP build page says I need these things to build it (TWRP), right?
Also, how much of the preinstalled vendor crud can be pruned before it breaks?
Thanks.
Edit: reference on the TWRP guide I'm using is https://forum.xda-developers.com/t/...ompile-twrp-from-source-step-by-step.3404024/ (posted 2016)
I think that all build environments are getting more restricted.
"Just do it OUR way" seems to be the new corporate slogan.
I build Android apps without Android Studio, Gradle or an IDE.
Renate said:
I think that all build environments are getting more restricted.
"Just do it OUR way" seems to be the new corporate slogan.
I build Android apps without Android Studio, Gradle or an IDE.
Click to expand...
Click to collapse
Does TWRP have its own build control system? Considering all these changes, should it?
To keep things isolated, clean and manageable on host system, that has no dev tools
or anything extra besides standard desktop stuff. (under main linux distros)
#1 For smallest , fastest deployment of various build/dev environments i use schroot
on devuan/debian , it is a system to manage/automate the use of chrootable containers.
like regular manual chroot but most thigs are automated/preconfigured with
just a few commands and config files.
Basicaly a new root filesystem (userspace) that is independent of hosts root filesystem and just
uses hosts kernel (or as much/little acces to kernel as you give it trough schroot config files)
has its own packages and dependencies and will only see specific sections of hosts filesystem sections you give it access to like say /src/myproject from host. can be a separate /home
or shared with host, all depends on your config.
Using debootstrap to create the filesystems for containers of specific distributions/verions.
Or can just manualy copy an install and rip out the kernel etc...
(Can install ubuntu userspace in debian with debootstrap , if need be.)
(like lineageOS was hard to find all the correct/matching dev tools under devuan, so ubuntu it was)
#2 For something a bit beefier LXC on top of libvirt.
(regular chroot wont run services, or have its own networking , LXCs can , with some extra configuration)
#3 For when you just need an actual full blown VM os installation use KVM/qemu on top of libvirt .
(like installing 15 year old redhat 5.1 in a container wont work, kernels and main libs too far apart)
(or anything that is just too different from current linux kernel , other OS s etc...)
virt-manager is nice for graphicaly managing VMs and LXCs
#1 But schroot is essential and will suffice for more then 90% if not whole 100% of your needs.
if you want a clean host system from being clobbered by constant installing and testing and such . Keeps the environment contained in its own filesystem namespace , have as many as you need .
start fresh,rollback,clone etc.............
Once configured just start another tab in a terminal emulator and schroot in to the container
and your main host system in unaffected, always clean .
#4 Running all of this on top of ZFS takes it a step up, to the next level of effeciency.
zfs helps quite a bit with cloning,branching,snapshots, rollbacks but not essential,
like git versioning for things that are too big for or are not made for git management
(but is another system on to itself to learn, so ignore it if new to linux )
just cloning a 300Mb-1Gb base bootstrap install folder takes no time on regular filesystem on ssds .
With these 3 tools , you can have 10s if not 100s of different environments on a single host
quickly deployable once you get to know the procedures. all usable at the same time without
reboot,
#5 The most important is learning how to hunt for the right version of tools and all of the
dependencies and the correct versions of those , as each project will have their own
and will base it on their own distribution of choice at a specific point in time.
(by being able to install/test/restart in container makes this whole process , easier)
you can test many different ideas at the same time , and merge what works in
to your own dev-build-env for a specific project.
(like hunting down correct tutorial for specific/old/obscure phone and a rom and recovery
and rooting tools associate from a time long past. using wayback machine to source
correct versions of each , as normal web has erased them )
even used schroot to install games for nephew from untrusted sources without hesitation,
and just delete the container when done, but that was a bit more involved as proprietary
nvidia drivers had to be installed on host and partially in containers.
dandudikof said:
To keep things isolated, clean and manageable on host system, that has no dev tools
or anything extra besides standard desktop stuff. (under main linux distros)
#1 For smallest , fastest deployment of various build/dev environments i use schroot
on devuan/debian , it is a system to manage/automate the use of chrootable containers.
like regular manual chroot but most thigs are automated/preconfigured with
just a few commands and config files.
(like hunting down correct tutorial for specific/old/obscure phone and a rom and recovery
and rooting tools associate from a time long past. using wayback machine to source
correct versions of each , as normal web has erased them )
Click to expand...
Click to collapse
neat. schroot looks like a solution. answers a lot of questions, anyway. that last part scares me though. using the wayback machine to source things jeez. there's gotta be a better way, but probably not unless i want to do it myself which will only add time to "the project".
McChadwicke said:
neat. schroot looks like a solution. answers a lot of questions, anyway. that last part scares me though. using the wayback machine to source things jeez. there's gotta be a better way, but probably not unless i want to do it myself which will only add time to "the project".
Click to expand...
Click to collapse
That was just worse case scenario if you get in to very obsolete/old/abandoned stuff (10-20 year old) projects/hardware etc...
dandudikof said:
10-20 year old
Click to expand...
Click to collapse
yeah some of the hardware is in that range. actually upgraded one of the old rigs (because parts are cheap) from an athlon to a phenom lmao thing has 16gb ram, it is stacked now with top of the line things from that era. keeping it around for nostalgia's sake at this point since it still works.
xmrig gets abysmal hash rates, not even worth running on older hardware.

Categories

Resources