0

I'm a beginning Android Developer trying to learn the file system, etc. I'm hoping to eventually delve into Home Automation and traffic analysis using phones/GPS, but I'm in the beginning arc of this learning curve. My background is mostly C/C++, though I've done some work in Java. I'm not so great with Linux, but semi-familiar. Ditto with security. I have a Computer Science degree and have been programming for years. Currently I have been trying to figure out what goes where in Android and have been running into a lot of permissions issues when trying to list directories using the "ls" command in an adb shell window and trying to access the SQLite databases. I currently have four Android phones. One is my actual phone and the others I am using to experiment with, ping each other, etc. I'm self-teaching myself

I write the above paragraph so folks understand my background. I'm not someone who is going to accidentally wipe out my filesystem with a mindless recursive "rm" command or give important files non-root access for others to exploit. At the same time, I'm not very knowledgeable about hacking phones, exploits, etc. I need to "root" my phones in order to get the elevated permissions to experiment around, fine-tune a few things, but most of it I am going to leave alone. I've been browsing the web and there are a bunch of articles warning me not to do it, but I don't think they're really aimed at developers like me. It appears that most of the solutions involve backing up the system, then "flashing" it or replacing the ROM or something that seems overly extreme to me. I either need to pay money to get a "one click" solution and/or I have to download some executable file that does it all for me and simply trust the author of this software. Over and over again I'm told that I'll probably screw it up and turn my phone into a brick.

Has anyone done this before? I try not to run other people's executables on my phone or laptop if I can help it and I have no idea whether the source is reliable. I figured there'd be a superuser option under Developer Options on my phone, but alas, there is not. Anyway, again, I'm no expert, but I'm not a complete newbie either. Is this something I can do myself or should I plan on paying forty bucks for some online solution that may or may not infect me with malware or brick my phone. I don't need a one-click solution, but at the same time I don't want to have to invest hundreds of hours of time into this thing since I just want to be able to explore the filesystem like I can with regular Linux. Any guidance is appreciated. Thanks.

2
Contributors
7
Replies
35
Views
1 Year
Discussion Span
Last Post by rproffitt
0

You covered a lot of area in your post so next time try to keep the topic to one topic.

  1. Exploring the file system has lots of priors like https://www.google.com/#q=exploring+the+android+file+system

  2. It's not Linux as you had before so when you get past that you may make some real headway.

That said, not one app I've written so far needs to know the file system. I do have a good friend that after 2 years is still exploring Android. He's trying to understand it from top to bottom and may be doing that for years to come.

That said, I think the other approach is to stand on top of these OSes and write our apps. We know that we have OS services and such so it's rare I need to dive into how the OS in question delivered the service. This is however incompatible with my close friend. He wants to trace the life and death of the thread all the way through. Well, that's one way to spend your days.

Make your choices as to what level you need to dive to and the deeper you go the longer it will take to get there.

0

I'm definitely not like your friend in that I have neither the need nor the desire to fully understand the Operating System and I'm definitely not looking to spend years doing it. What I AM looking to do is understand some of the base programs like "Contacts" and "Messaging" and perhaps write my own small version. To do that, I've been experimenting, trying to push and pull the SQLite databases through adb to see what happens when I add a contact or a message or whatever, plus taking a look at what's in the Android Manifests of those programs, what files change when I change the settings, stuff like that. I've borrowed an already rooted phone and found some of my answers, but I can't keep it. Quick and dirty superuser log-in, change a few permissions temporarily so I can pull/push the files and view them/experiment with them, then return to the original permissions. Roaming around the directories seeing what files get updated when. That kind of thing. I can't grab the contacts2.db database on my own phone to see what's in it because it's not rooted. I have no desire to tweak the Operating System, just trying to figure out what's going on.

0

Ah, good point! Didn't register in my brain that the code would be online for the public, but it makes sense. Thanks for the link! This will be useful.

0

Just my thoughts here. Your approach is what we use when there is no source. Android has a lot of its basic apps open for perusal.

This way you can work on the white box approach rather than a black box. (Sorry if I use terminology that is new or rare. Just ask if you must.)

I do believe there are open source apps to read the databases you are poking around in too.

0

I never thought of it in terms of white box versus black box, but that's a good point. One of my learning strategies since I was a little kid has been 1) do something 2) see what changed 3) repeat 1 and 2 till you think you know what's going on. Sometimes it works well, sometimes it's a bit inefficient. It's not the only tool in my toolbox, but I do like having it. And frankly, there are so many files and things going on in an app like Messaging or Contacts that, at least at my current level, it's a black box even though I have the code. C++ was like that for me initially too.

I'm going to register your opinion as, roughly, "Don't root unless you have to, and you don't have to" and "Don't root if you're only rooting to avoid learning the right way". I see wisdom in both of these (assuming that I'm summing up your opinion accurately). Curiosity got the better of me last night, though, and I downloaded and executed the free program Root Genius and gave it a try on one of my spare phones and spare laptops, knowing full well the risks involved. Worked like a charm! And as far as I can tell, no malware installed and my phone wasn't bricked. Wouldn't have taken the risk if I only had one phone and one laptop.

Anyway, as mentioned, I'm not going to be tweaking the operating system, but just maneuvering around and typing "ls -l" and temporarily changing a few permissions and manifests have increased my knowledge. I'm carefully keeping track of what I'm changing so I can revert.

I'll keep this open in case anyone else chimes in. Thank you for your responses.

0

I think you'll do fine given the back and forth here.

About rooting. About the only time I was about to root was a rather cr***y Sprint phone with apps that had to go away. About the time I was going to do that, I told Sprint goodbye and moved to an unlocked GSM phone. Much better.

Now I can install my apps once I enable third party sources and never looked into rooting again.

A parting tip. Use good USB cables. I had some trouble with cheap USB cables during debugging and while these cables would sync they would drop connection during Android Studio debug sessions. Not cool and learned what cables I have were good and not so good.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.