Safe Android for a child
I suspect that many of the readers of this publication did not carry a mobile phone with them in their childhood, or began to carry it only in high school - oddly enough, everyday mobiles that appeared to date appeared not so long ago. And even after their appearance for a long time, mobile phones were huge and expensive, and only serious guys could afford them. But in the courtyard of the year 2018, and junior students with might and main use smartphones.
Of course, children are different, and everyone has different problems in this regard. Someone has no problems at all, and I can only be glad for these people. Best of all, if it turns out to agree with the child about the reasonable use of the phone - but we will not consider this case as fairly obvious (agreed - well done). We will consider the case when you need to give the child a smartphone, but at the same time technically limit its use.

Surely, many will immediately have a logical sentence: “Give your child an old push-button telephone,” or “Just don't turn on the Internet for him”. Again, this can be a great solution for someone, but for me it doesn't work for the following reasons:
I will proceed further from the above prerequisites: that the child needs a standard inexpensive smartphone, where telegrams and geolocation service will work. Now we list that the child does not need:
If you are only interested in the technical part, feel free to rewind to the next heading. Here are the arguments about the correctness of the task.
It may seem that I am some kind of beast with delusions of control, so I’ll clarify that the child has a tablet and a computer at home. And after the lessons are done, you can watch cartoons, read Wikipedia, play toys, or write your own toys. Before they are made, you can also relax - but without using devices.
In general, we recognize honestly: the need to resolve an organizational issue with technical means is already a file. For example, if a pass system is set up in a company, employee traffic is monitored, open applications and mouse clicks are active, this means that something has gone wrong much. It is unlikely that the productivity of employees will grow from the fact that they will stick in the wheel. Adults and conscious people, at least out of a sense of contradiction, will begin to circumvent the prohibitions.
With the child the same thing - the main problem is that the child is absolutely not interested in doing homework. And looking at the tasks, I understand why. And even if you pick up the phone, the child will always find something else to entertain: to play with cars, dolls, or just sit and dream. So the real solution to the problem is rather a change of school, or home schooling. But this is a topic for another publication and other resources.
On the other hand, I have a suspicion that all these new technologies “at their fingertips” are too attractive for a child, and he simply cannot physically resist temptation (the Apple logo is remembered right away, right?). So perhaps the best solution is simply not to tempt. At least for a while. Then you will still need to slowly enter into the adult information sphere. Otherwise, everything can end badly when a child suddenly gets access to everything in the world, and from your greenhouse world pink ponies will plunge headlong into the Internet with toys, MMORPGs, applications, social networks, naked people, strange vocabulary, and so on. No kidding - I know quite a few guys who flew out of universities, because total control was established over them at home. And, once in the hostel, they completely went into toys or communication, which they lacked so much. I would like to avoid this.
On the third hand, maybe I'm just getting old and starting to grumble against natural technical progress? Although, is the smartphone under the table so different from the book and the flashlight under the covers?
With the fourth - I myself am a second-generation developer, and I remember how I was limited to using a computer. And I remember that if I could somehow get around the prohibitions (oh, how much I learned in the process), then after that it was very difficult for me to control myself. Maybe it was the effect of the “forbidden fruit”. Or not ... If you can play a modem with a friend in DOOM, then what the hell do something else? So, I do not think that the absence of restrictions on using a computer as a child would give me something good. For example, I would definitely not start making first web projects for the money of 14 years to buy my own computer ...
I can not draw unambiguous conclusions, so I choose the old reliable method - the trial and error method. I try to limit the phone to the child and see what comes of it. Probably, in a year I will return everything to its original state, and see if the child can cope with it.
First you need to choose a platform and a piece of hardware on which we will make a children's phone. My choice fell on Android - for the simple reason that I worked with it, and I can flash it, write Java software or something native at the Linux level. The piece of iron is not so principled, and I already had a cheap phone that I bought earlier (so that it would not be a pity, if anything, and that the children would not measure themselves “at someone cooler”). It doesn't matter what to take, but if I did it now from scratch, then the requirements would be:
First, I’ll tell you what I’ve watched and tried:
After it became clear that I would not get off with a little blood, I began to think that it was easier to cut my native firmware, or install an alternative one. With anguish, I looked at an insane amount of noise, whistles and other bloatware at home. Then I looked that on the alternative, supposedly, everything works. The Android version on both firmwares was the same. And I decided that I would be faster to finish the alternative than to cut my own.

As an alternative, I put Cyanogen. It is clear that it is no longer supported, but there were no alternatives, except for those who were obviously not working. Yes, and I was not very worried about the update - according to the plan, the phone should live in peace for a few more years on the set of software that I am installing now.
I will not describe the firmware process myself - there are kilometer topics on a known resource for this. I can only say that for the first time it took me about 5 hours - but rather because of inattention. I can repeat it now in half an hour. There were no problems - the firmware got up, everything works, quickly took down the built-in browser and calculator. But then it turned out to be interesting - not a single family geolocation service did not want to work without Google Play on the phone. I do not know what amazing reasons this is due, but true. I suppressed the impulse to quickly write my geolocation service (the task is simple, I already did such, but it was an obvious “fatal flaw”), and resigned to the fact that Google Apps needed to be installed, and then somehow deal with them. Put as a result of Open GApps in the pico version - only there was no Google Now in it, which essentially opens the search box anywhere. After that, I got geolocation services. I struggled with the problem of accessibility of Google Play for quite a long time, not understanding why the seemingly simple thing was not described anywhere - a complete ban on installing applications. Actually, I spent 5 hours and another night on this.
There should have been a description of the solution dictated to me by nighttime despair and lack of sleep - how I set up crowns so that it constantly kills the google play process. But I slept and realized that it is enough to write a simple script in /etc/init.d
Explanation - when installing a new application, a separate directory is created for it. We remove the rights to the record - after downloading the application can not be installed. At the same time, this solves the problem with installing third-party apk.
Once this is not enough - the android itself corrects the rights to the folder, so the script is placed in autoload in init.d. I do it twice for reliability - is it not enough when a correction of rights takes place there?
I don’t think my solution is perfect, and I’m looking forward to how the child can circumvent the restrictions. I remember how in my childhood I began to intuitively understand combinatorics, estimating the number of possible password combinations of 4 characters. How to learn to reset the password in the BIOS. How to use the software that could give me this password. How I learned minimum time management so that a warm lamp monitor can cool down to the arrival of parents. As I finally realized that it was most profitable to do my homework quickly and well, and then quietly play ...
Honestly, I don’t understand why there is no such popular product on the market as a fully-managed children's mobile OS, or an add-on that allows you to make it (well, except for the mentioned option from LC). If suddenly there is, it is strange that I was unable to find him. It would have been five years ago - I would have immediately set about trying to write such a firmware myself. But not now. Although I would support the initiative at leisure.
In general, I very much hope that I missed some well-known solution, which you will tell me in the comments.
UPD. The comments suggested a huge amount of interesting things, both in terms of technical solutions and organizational ones. The very case when I got a lot of use from comments on the article. I also recommend you to read.
Of course, children are different, and everyone has different problems in this regard. Someone has no problems at all, and I can only be glad for these people. Best of all, if it turns out to agree with the child about the reasonable use of the phone - but we will not consider this case as fairly obvious (agreed - well done). We will consider the case when you need to give the child a smartphone, but at the same time technically limit its use.

Why so?
Surely, many will immediately have a logical sentence: “Give your child an old push-button telephone,” or “Just don't turn on the Internet for him”. Again, this can be a great solution for someone, but for me it doesn't work for the following reasons:
- Communication with the child goes through telegrams. Because at my work, I do not catch a cellular connection, and through telegrams one can send photos of a textbook with homework questions;
- I want to turn on geolocation. Not in order to constantly monitor the child, but to be able to let him go alone near the house and worry a little less. Who knows what? Of course, the push-button telephone can be tracked through various not-quite-legal services or offers from operators - but the accuracy of geolocation on the towers leaves much to be desired. In addition, if the phone suddenly sat down, was turned off, or, God forbid, thrown away by someone, we need the ability to quickly find its latest location. Alas, I do not know how to solve this problem without a smartphone.
Formulation of the problem
I will proceed further from the above prerequisites: that the child needs a standard inexpensive smartphone, where telegrams and geolocation service will work. Now we list that the child does not need:
- Install toys and other applications;
- Watch cartoons;
- Use the browser or any other integrated search;
- Use the built-in calculator (it would seem a ridiculous problem, but try removing the calculator in your Android).
Small retreat
If you are only interested in the technical part, feel free to rewind to the next heading. Here are the arguments about the correctness of the task.
It may seem that I am some kind of beast with delusions of control, so I’ll clarify that the child has a tablet and a computer at home. And after the lessons are done, you can watch cartoons, read Wikipedia, play toys, or write your own toys. Before they are made, you can also relax - but without using devices.
In general, we recognize honestly: the need to resolve an organizational issue with technical means is already a file. For example, if a pass system is set up in a company, employee traffic is monitored, open applications and mouse clicks are active, this means that something has gone wrong much. It is unlikely that the productivity of employees will grow from the fact that they will stick in the wheel. Adults and conscious people, at least out of a sense of contradiction, will begin to circumvent the prohibitions.
With the child the same thing - the main problem is that the child is absolutely not interested in doing homework. And looking at the tasks, I understand why. And even if you pick up the phone, the child will always find something else to entertain: to play with cars, dolls, or just sit and dream. So the real solution to the problem is rather a change of school, or home schooling. But this is a topic for another publication and other resources.
On the other hand, I have a suspicion that all these new technologies “at their fingertips” are too attractive for a child, and he simply cannot physically resist temptation (the Apple logo is remembered right away, right?). So perhaps the best solution is simply not to tempt. At least for a while. Then you will still need to slowly enter into the adult information sphere. Otherwise, everything can end badly when a child suddenly gets access to everything in the world, and from your greenhouse world pink ponies will plunge headlong into the Internet with toys, MMORPGs, applications, social networks, naked people, strange vocabulary, and so on. No kidding - I know quite a few guys who flew out of universities, because total control was established over them at home. And, once in the hostel, they completely went into toys or communication, which they lacked so much. I would like to avoid this.
On the third hand, maybe I'm just getting old and starting to grumble against natural technical progress? Although, is the smartphone under the table so different from the book and the flashlight under the covers?
With the fourth - I myself am a second-generation developer, and I remember how I was limited to using a computer. And I remember that if I could somehow get around the prohibitions (oh, how much I learned in the process), then after that it was very difficult for me to control myself. Maybe it was the effect of the “forbidden fruit”. Or not ... If you can play a modem with a friend in DOOM, then what the hell do something else? So, I do not think that the absence of restrictions on using a computer as a child would give me something good. For example, I would definitely not start making first web projects for the money of 14 years to buy my own computer ...
I can not draw unambiguous conclusions, so I choose the old reliable method - the trial and error method. I try to limit the phone to the child and see what comes of it. Probably, in a year I will return everything to its original state, and see if the child can cope with it.
Platform and piece of iron
First you need to choose a platform and a piece of hardware on which we will make a children's phone. My choice fell on Android - for the simple reason that I worked with it, and I can flash it, write Java software or something native at the Linux level. The piece of iron is not so principled, and I already had a cheap phone that I bought earlier (so that it would not be a pity, if anything, and that the children would not measure themselves “at someone cooler”). It doesn't matter what to take, but if I did it now from scratch, then the requirements would be:
- You can exactly get root rights;
- There are alternative firmware;
- There is a community of at least some size;
- Looking ahead, I note that quite well, if it is possible to put Lineage OS or at least Cyanogen. And see that the description of the firmware was not wonderful comments like "everything works, except for calls and camera."
Options that don't work
First, I’ll tell you what I’ve watched and tried:
- An alternative lunch in which on the desktop itself only the necessary applications. A failure option - the child instantly goes to the full list;
- Disable all extra applications. Alas, the child quickly understands how to turn them back on;
- Restrict software installation and content viewing by standard means. Alas, here Google let me down - you can limit the applications and cartoons by age, but you can not completely prevent their installation and viewing. It seems like iOS is better in this area, but it’s not exactly;
- Any children's control programs and shells for android. They turned out to be surprisingly few, and for the most part there were negative reviews with the words “protection bypassed a three-year-old child”. Being a little Android developer myself, I readily believe in it. Also, many solutions had completely different views on the problem - for example, in the “child mode” they blocked incoming and outgoing calls, which did not suit me (for example, this is how Kid's Shell works). The only thing that caught my attention was the decision from Kaspersky Lab. They promised protection from launching applications, geolocation, usage monitoring and a whole bunch of other things. And I believe these guys (by the way, they honestly wrote that restrictions on iOS do not work). But not that I felt sorry for 500 rubles - the task simply looked trivial, and I wanted to solve it on my own.
In any incomprehensible situation - DIY
After it became clear that I would not get off with a little blood, I began to think that it was easier to cut my native firmware, or install an alternative one. With anguish, I looked at an insane amount of noise, whistles and other bloatware at home. Then I looked that on the alternative, supposedly, everything works. The Android version on both firmwares was the same. And I decided that I would be faster to finish the alternative than to cut my own.

As an alternative, I put Cyanogen. It is clear that it is no longer supported, but there were no alternatives, except for those who were obviously not working. Yes, and I was not very worried about the update - according to the plan, the phone should live in peace for a few more years on the set of software that I am installing now.
I will not describe the firmware process myself - there are kilometer topics on a known resource for this. I can only say that for the first time it took me about 5 hours - but rather because of inattention. I can repeat it now in half an hour. There were no problems - the firmware got up, everything works, quickly took down the built-in browser and calculator. But then it turned out to be interesting - not a single family geolocation service did not want to work without Google Play on the phone. I do not know what amazing reasons this is due, but true. I suppressed the impulse to quickly write my geolocation service (the task is simple, I already did such, but it was an obvious “fatal flaw”), and resigned to the fact that Google Apps needed to be installed, and then somehow deal with them. Put as a result of Open GApps in the pico version - only there was no Google Now in it, which essentially opens the search box anywhere. After that, I got geolocation services. I struggled with the problem of accessibility of Google Play for quite a long time, not understanding why the seemingly simple thing was not described anywhere - a complete ban on installing applications. Actually, I spent 5 hours and another night on this.
There should have been a description of the solution dictated to me by nighttime despair and lack of sleep - how I set up crowns so that it constantly kills the google play process. But I slept and realized that it is enough to write a simple script in /etc/init.d
chmod 0551 /data/app
sleep 20
chmod 0551 /data/app
Explanation - when installing a new application, a separate directory is created for it. We remove the rights to the record - after downloading the application can not be installed. At the same time, this solves the problem with installing third-party apk.
Once this is not enough - the android itself corrects the rights to the folder, so the script is placed in autoload in init.d. I do it twice for reliability - is it not enough when a correction of rights takes place there?
What happened
pros
- You can install any program through the adb console;
- There is no extra software;
- The lifetime of the phone has increased at least twice, despite the geolocation;
- You can use applications that require Google Apps;
- You can not install applications from Google Play;
- The child had a lot of space on the phone for photos;
- You can put applications in the system partition - for example, the same geolocation;
- You can not put apk from third-party sources;
- The decision turned out conditionally free. Conditionally - because a lot of time was killed for it, which is directly converted into money. And in many cases I pay money to save time. And here I buried a few thousand rubles and a healthy sleep time. Was it worth it? Not sure;
- I am absolutely sure that if something goes wrong, I can finish it myself. In the case of third-party solutions can only accept.
Minuses
- The telegram itself has already become almost a separate marketplace, and there are toys in it, a search for pictures and animations, stickers, calculator bots, and so on. You can fight with this too - somehow I have already collected my telegrams, and, if necessary, I will repeat. Unfortunately, this is not very fast - one more night is required;
- A custom firmware may not have an update, and a custom firmware is difficult to update. But this is not very critical - for the phones of the price category of interest to us, system updates are released about once every time, so alternative firmware may turn out to be more fresh than the native one. Again, a phone without a browser and marketplace is not very vulnerable to vulnerabilities;
- The child, of course, was upset. But it was an extreme measure, which I repeatedly warned.
I don’t think my solution is perfect, and I’m looking forward to how the child can circumvent the restrictions. I remember how in my childhood I began to intuitively understand combinatorics, estimating the number of possible password combinations of 4 characters. How to learn to reset the password in the BIOS. How to use the software that could give me this password. How I learned minimum time management so that a warm lamp monitor can cool down to the arrival of parents. As I finally realized that it was most profitable to do my homework quickly and well, and then quietly play ...
findings
Honestly, I don’t understand why there is no such popular product on the market as a fully-managed children's mobile OS, or an add-on that allows you to make it (well, except for the mentioned option from LC). If suddenly there is, it is strange that I was unable to find him. It would have been five years ago - I would have immediately set about trying to write such a firmware myself. But not now. Although I would support the initiative at leisure.
In general, I very much hope that I missed some well-known solution, which you will tell me in the comments.
UPD. The comments suggested a huge amount of interesting things, both in terms of technical solutions and organizational ones. The very case when I got a lot of use from comments on the article. I also recommend you to read.
Only registered users can participate in the survey. Sign in , please.