[Q] Modifying (android ROM || AOSP source code) to run a tablet with only one app - Android Q&A, Help & Troubleshooting

I'm using Lenovo Ideatab A3000-h,
I want to make it to be set to run only one app after booting, not even the home page could run then, it will open at the app and still at it forever, I know it's a common need and this has been asked a lot of times before, So, after searching I discovered that there is three options :
1- Creating my own Custom ROM.
2- Making my application a launcher application using android manifest.
3- run a kiosk mode like surlock.
4- Modifying AOSP source code.
So, after a lot of search, I found that the third option can be easily broken be entering the tablet in safe mode and try to remove app then, or by removing it from accessing the tab by PC, and the second option can be broken by the same way.
So, all I got now is to use either the first option or the forth option, and when taking about the first option, thanks to NeroYoung I already know how to:
setting up android kitchen.
modifying ROM img files and jar files.
modifying build.prop.
generating the resulted Custom ROM.
but I don't know the way to reach my needs by customizing a ROM, so, all I want to know is how to modify the custom/stock ROM to achieve my requirement of booting to only a specific app. also if there is another way by making (System Backup ----> Modify ----> Restore Modified System) it will be great.
and when taking about the forth option, I already downloaded the source code and did know how to access it's resources, but don't know where is the source code that controls the start-up process and how to modify it. thanks in advance for all future contributors.

Related

[Q] [ROM] Resign stock ROM with my own signature key

Hi everybody,
unfortunately I couldn't find a final answer to my question:
I know (or I think I know from your excellent forum):
- I can extract a stock ROM (and modify it)
But:
- can I resign the whole ROM using my own signature key, flash it back on the device and then use this to build an app (and sign/add/install it) running with e.g. android:sharedUserId="android.uid.phone" and androidrocess="com.android.phone" ?
In other words: can I replace the system signature key of a stock ROM with my own one, being able to sign my own apps with it? Or is that only possible by building the whole (custom) ROM myself?
I don't need a detailled description, a 'Give it a try!' or 'Wouldn't work because of...' however would be great!
Thanks,
deep blue
ps: any legal advice or warning is welcome, too, although I only want to dig a little deeper into my own phone.
yes you can
go to /system
and look for the build.prop
open it and
ro.build.display.id= Put Your rom name here
Thanks for your answer, locomain!
Maybe I didn't explain that correctly:
I don't mean the signature you can see when checking the phone-info. I'm thinking about the key, the ROM is signed with. If you sign your app with the same key, you can do much more stuff. As an example, my old HTC Desire came with a hidden app that displayed a lot of low-level radio-stuff (Field-Test-Monitor). This is only possible because this app is signed with the same key as the system itself.
My idea was to take a stock HTC-ROM and resign it with my own key, so I could build an app with extraordinary privileges for my own phone (like the app described above).
BR,
deep blue
Please use the Q&A Forum for questions Thanks
Moving to Q&A
[Q+A] [ROM] Resign stock ROM with my own signature key
For those who are interested:
using a downloaded CyanogenMod-signed-zip it worked, I just removed all signatures (from zip and all included apks) and re-signed everything using my own key. Afterwards I was able to create a small app that is allowed to run in the com.android.phone-process.
So I think it should work with stock-ROMs also, as long as I root them by the way.

[Q] Various android-related queries

I have managed to compile (from source) and install CM7.2 on my HTC dream, but my questions below are related to Android:
1. Is there a way to find out which packages (.apk) were installed on my system and if so, how do I do that?
2. Is there a way to find out each package dependencies (I need to figure out this as I am bent on removing the vast amount of guff installed on the phone - I won't need 90% of this stuff)?
3. Similarly to 2 above - is there a way to look at dependencies of a package not yet installed on my system (i.e. the .apk file)?
4. How do I actually remove a package for good from the system?
5. Similarly to 3 above, how do I actually install a package from within the root system - I know I can do this via adb, but is there a way to do this inside the, say, command line terminal?
6. Is there a way to alter (understand remove) certain program permissions which I could see "granted" to a particular program/package? I know there are various ways to look at these, but I wish to remove permissions I am not happy being granted to that particular program/package.
And one last a bit more advanced query: I would like to build a single package from the source tree and then install the resulting .apk file on my system.
Basically, I will try to upgrade a package with a new revision and add a few patches to the package source of my own before compiling it and building it again.
I usually build the whole lot (all packages + the rootfs image itself) with "mke bacon", but if I want to alter the source and build a single package how do I do that?
I am not very familiar with the Android make system, so I don't want to go heads-first into something and make a real mess of it.
Thanks a lot for any assistance given.

[Q] Issue with installing an app

Hi everyone,
I'm new on xda and I come here because I struggle to install this app on my rooted Galaxy S4 with CyanogenMod 11: "Paiement mobile (pour Orange)" (sorry, I'm new, so I cannot post urls).
In fact, this app has not been declared by the devs (on the Google Play) to be compatible with my phone, despite the fact that I have the specs to run it (NFC payment).
I asked a friend who was able to download the app to upload it on Aptoide, giving me the opportunity to download the apk on my phone (this apk is available in this thread). I tried to install it, but I get the following the error: "app not installed".
I would like to force the installation of the app. I tried many ways, like using apps that use root access on the phone, without success (for example, I tried with "System Apps Installer" on the Google Play, but I get a problem with mounting /system). I also tried to install it with the command line tool, but I get the error "[install_failed_invalid_uri]". I tried to change the permission of the /data/local directory and /data/local/tmp with ES file explorer, but it did not change anything.
In addition to this, I'm not able to enable usb debugging in the developper options (to install the apk with adb), because every time I activate the option, it becomes disabled in the following seconds.
It seems to be a little bit complicated, because I seem to have different problems, but I hope that someone here will be able to help me !
Thanks for your help,
Aquignis.
The issue is most likely Cm. They alter things so some that normally work no longer work
I suceeded to solve the "[install_failed_invalid_uri]" error in the command line tool by also changing the permissions of /data.
After that, I got another error (yes, one more, but the last) that made me discovering what's the real problem in this situation: "install_failed_missing_shared_library". By doing some researches on the web and exploring the apk, I understood that the app use a library called "org.simalliance.openmobileapi" that corresponds to the work of SIMalliance, who developped an API called "Open Mobile API", which notably enables communication with NFC sim cards and must be integrated to the build of the ROM. This system is used by many banks in Europe and has been integrated in the stock ROM of many NFC devices by the important manufacturers, but not by Cyanogenmod devs in the last stable release of CM 11 for the Galaxy S4.
Like you said it, the problem was CM
I asked them if it has been integrated in CM 12, because that is why the app is said to be incompatible with my device by Google Play which automatically checks which libraries are installed on your device (I'm waiting for their answer). The other solution would be to add the library to the CM build by myself, because it seems not to be very complicated, but I'm not qualified enough to do this !
If it is not part of aosp I wouldn't count on it being added to be honest. Not to mention most banking apps refuse to work if the Rom has root as it can cause security issues.
Yes, the root seems to be a problem with some apps according to the work of this man.
On the other hand, I think that this API is important enough to make CM devs pay attention to it, because it is used in many countries (except the USA which use only HCE, I believe). If only I was able to build it myself !

Some Hacking in Yoga Book

Hi folks.
I'm an Android firmware developer (you can see my posts here in xda) that got a yoga book yesterday. For me it works at it should (by now) but my hacker soul speak to me and said: "at least take a look to see what you can get from this device". I don't have many time, so I can't spend time doing roms or fixing things by myself, but I can share with you some info I get and help you with my knowledge if someone is interested in "play" with this device.
First of all, I'm not responsable of anything that you can break following these steps. Almost all of them are tested and with some common sense you will not break anything, and if you break anything I will try to help you to fix it (if you are polite), but this is a work in progress and hacking and the possibility of brick the device is always there.
I only have the Android version without LTE, so I only tested in my Book.
So, here we go:
1) Secret codes:
I get this codes decompiling EngineeringCode.apk with apktool. Be carefull with them:
####0000# - Display version info
####7599# - Display hardware info
####8375# - Display baseband info
####1111# - Factory test
####2222# - Display SN
####7777# - Factory Reset???
####5993# - Display internal frameWork version
####7642# - Cut the power off to reload the PMIC - This command shutdowns the device. Just press the power button to reboot.
####5236# - Display LCD name
####2834# - ES close test
####8899# - open the ums mode default for debug
####3333# - offline log
####3334# - offline modem log
####9527# - Mediaplayer setting
####78646# - RunIn test
####6020# - switch country code
####59930# - Display current country code
####8746# - Enter engineering mode
####4227# - Enter engineer test
####357# - DLP_TEST
To use these codes, open the contacts app, press the search button and enter the code in the search bar.
2) OTA Images
You can get OTA images directly from lenovo servers. Just open your browser and paste this url:
http://fus.lenovomm.com/firmware/3....WW06_BP_ROW&action=querynewfirmware&locale=en
Change device model if needed (LenovoYB1-X90F or LenovoYB1-X90L)
Change curfirmwarever to a valid OLD firmware, this way you will get the next one in age.
Change locale if needed.
With this url you will get a download url at the end of the result page. In this case: http://tabdl.ota.lenovomm.com/dls/v...S000426_1705080316_WW06_BP_ROW_WC80C2A0F2.zip
These images are not full ota images, they are diff versions. This means that we can't use them to mod the image, or recover a bricked device, but this is a first step
3) Custom images
We don't have real sources to build a custom image (the lenovo's open source files are useless), but this doesn't mean that we couldn't modify stock images to take out useless apks or get better performance.
We can get this using an Android Kitchen and a full update image for the device.
As Android kitchen you can use SuperR kitchen (https://forum.xda-developers.com/ap...chen-superr-s-kitchen-v1-1-50-v2-1-6-t3597434)
As full image, I only tested the one here (https://easy-firmware.com/index.php?a=browse&b=category&id=19521) because I can't download any newer one.
I tested uncompressing it, deodexing the apks and doing a new image. But I don't test it in the device because I need to install twrp to flash the new image and I don't have time to test. But this should work, I did it many times so if someone is interested I can give steps to do it and support for testing.
If someone can get the latest full images, send then to me and maybe I can get some time to do some tests.
PD: Probably we could use this as a base to get LineageOS 14.1 working: https://github.com/latte-dev/android_device_xiaomi_latte/tree/cm-14.1
So, if you are interested in some hacking with the Yoga Book, contact me and we could team to get the most of this device.
First of all thank you for your post, it´s really useful
if you could somehow manage to boot windows on this machine it´s by far the greatest war we have right now.
Il promise you a lunch or dinner on Lisbon whenevere you want!
joao1979 said:
First of all thank you for your post, it´s really useful
if you could somehow manage to boot windows on this machine it´s by far the greatest war we have right now.
Il promise you a lunch or dinner on Lisbon whenevere you want!
Click to expand...
Click to collapse
Sorry, my knowledge of Windows is only user level . Install it in personal computer to play games .
But I really don't know why people wants to run Windows there, it will go slowly than Android and its less touch oriented... but I suppose that this is a chat for another thread
corvus said:
Sorry, my knowledge of Windows is only user level . Install it in personal computer to play games .
But I really don't know why people wants to run Windows there, it will go slowly than Android and its less touch oriented... but I suppose that this is a chat for another thread
Click to expand...
Click to collapse
in my particular case, i´l admit that is for football manager the touch version
joao1979 said:
in my particular case, i´l admit that is for football manager the touch version
Click to expand...
Click to collapse
Have you tried running it through Crossover? It may be in its infancy but i have got a few apps running OK with it.
I have the full "YB1-X90F_USR_S000196_1611040312_WW06_BP_ROW" I can upload somewhere if anyone can suggest a good site to do so without signing up? The file is about 2.5gb
It will be great if we could get the latest version, because maybe these older versions have older files that we have updated in our tablets.
Mixing files could give unknown problems
The current TWRP is based on the new Yoga Tab 3
I am starting to think they do not do full roms for this in the same way they do for a lot of their other devices.
We know the otas are available from tabdl.ota.lenovomm.com/dls/v6/ and are named according to the 2 builds that it bridges. As easy-firmware had the december full rom under the file name B1-X90F_USR_S000196_1611040312_WW06_BP_ROW-flashfiles.zip I had hoped that I could work out the file path to pull it down.
There were some interesting ideas here, https://forum.xda-developers.com/android/help/how-download-stock-roms-lenovos-ota-t3109507 but it seems there is a difference between phonedl.ota and tabdl.ota
Queries to full roms that work for phones, don't seem to work for the yoga book.
Anyone with more web knowledge able to pick this up? I am not sure the files are there but I feel they should be.
Good luck
Update: the downloads seem to be hosted via CloudFront. An Amazon service, but I can not find out a way of listing the available files. The latest full rom would be
http://tabdl.ota.lenovomm.com/dls/v6/YB1-X90F_USR_S000426_1705080316_WW06_BP_ROW_WC80C2A0F2.zip
But the Last 8 chars are random and we do not know what they are.
So we have two hopes. First work out the right query to the link from fus.lenovomm.com or two find a way of listing files available in tabdl.ota.lenovomm.com/dls/v6
Not sure I have got much further but ill keep trying when I can.
Hey, I should mention that I have some files that you may find helpful; I got them from the easy firmware website. They're all the .img files for each partition in Android (ie. boot.img, cache.img, config.img, factory.img, recovery.img, system.img) as well as: biosupdate.fv, bootloader, firmware.bin and gpt.bin. However, these of course aren't in the normal "flashable .zip ROM" format. So unless you know how to take apart these .img files they aren't very useful. If you need any more help or have any other questions about how far we've come on our own, feel free to ask. danjac also has great knowledge of our efforts.
Yes, I know how to use them, unpack, modify, etc. But what I want is the latest version, no a old version (I hav these files too). If you have them I can do some changes, debloat, etc.
Anyway, I see little interest in custom roms in this forum ( probably because it's not a device with a lot of users or the users are not the techy kind), so I prefer to help others with info than do a custom rom that only 2 or 3 people will use. Doing custom roms is a time hungry task and probably it doesnt worth the effort. Anyway this device is not full of bloatware like samsung ones, so it useable as it is.
As I said in my first post if anyone is interested I can give some hints and support to modify the full image (but only the latest one).
It's so sad that there are only a few interested owners of this tab - it's such a nice device but i fear the day lenovo decides to end their support for it. There will be no custom roms to switch to and keep the device alive - it will be a soon to be bit of old tech garbage BTW. I still use my Asus Transformer Prime because of the nice community
@NiffStipples I fully agree. This device is so powerful and its a suprise that it is invisible to the "market". In my humple opinion the normal ROMs aren't that bad besides missing updates but I would love to see all the power served through a custom rom. unfortunately programming is not my business
Stefan
Broomfundel said:
Have you tried running it through Crossover? It may be in its infancy but i have got a few apps running OK with it.
Click to expand...
Click to collapse
Interesting - is Crossover good (and does it require factory reset)?
Hi, It works well with some things and not others. Often the why and where are not obvious. It is basically "wine" the layer that allows some windows apps to run on a linux install. Tweeked to work with android. Just an install to put crossover on. Then another install (Within crossover), to put you app on crossover. If it doesn't work out of the box, there windows libraries you can switch out and dependencies you can install. (Eg: directx , .net) Even if your not technical. I would say get on the beta program and give it a try.
Hi! what do you mean by "lenovo's open source files are useless"? do you refer to this packet on lenovo's suppport site? download.lenovo.com/consumer/open_source_code/lenovo_yb1_x90f_l_osc_201608.zip
I've entered the Android YogaBook's BIOS and noticed that VT-X is enabled by default! With Limbo x86 we could get a fully working virtualized Windows or Linux, if it wasn't for... KVM. It seems like it's not enabled in Lenovo's default kernel. Could we get to recompile the kernel with this option on? i'm not a big android/ROM expert but i surfed the open_source_code folder from Lenovo and it seemed, to me, that we could rebuild the Kernel at least.
This could really change things!
morrolinux said:
Hi! what do you mean by "lenovo's open source files are useless"? do you refer to this packet on lenovo's suppport site? download.lenovo.com/consumer/open_source_code/lenovo_yb1_x90f_l_osc_201608.zip
I've entered the Android YogaBook's BIOS and noticed that VT-X is enabled by default! With Limbo x86 we could get a fully working virtualized Windows or Linux, if it wasn't for... KVM. It seems like it's not enabled in Lenovo's default kernel. Could we get to recompile the kernel with this option on? i'm not a big android/ROM expert but i surfed the open_source_code folder from Lenovo and it seemed, to me, that we could rebuild the Kernel at least.
This could really change things!
Click to expand...
Click to collapse
How did you enter the bios? Can you boot from usb?
anyone managed to use swiftkey keyboard?

Exchange platform-signature in custom ROM

Hi there -
short prologue: I am working on my bachelor thesis and must develop a service that keeps a record of how often a user actively uses the application permission settings of Android 6 and above. The main goal is to have a custom ROM which can be deployed on several phones to conduct a survey.
I identified the file where these settings are stored:
Code:
/system/users/0/runtime-permissions.xml
I want to set up a service running a FileObserver to keep track of the changes in this file. The file is not accessible by normal applications (permission -rw-------) but the service has to run without superuser.
So I want to sign my application with the platform key to obtain system permissions. I am totally clear on the purpose of this security concept and I know that I cannot get the original key. The resulting ROM is not going to be public and is used only in a controlled group for research purposes.
My question is how to exchange the signature/key with what the system applications of my actual ROM are signed. So that I sign my own apk with the same key so it has the special permission. I found the answer to this exact question on stackoverflow but it is quite old and I did not succeed with this explanation.
Do you know if there is another, more current approach?
Thanks in advance!
Device is a Xiaomi Redmi 4X running stock MIUI 9 (Android 7.1.2)
Just have the app built as part of the rom. This will make sure they both have the same signature.
zelendel said:
Just have the app built as part of the rom. This will make sure they both have the same signature.
Click to expand...
Click to collapse
What do you mean by "built as part of the rom"? I cannot build the rom from aosp because the device should run the original MIUI firmware. I used SuperR's Kitchen to modify the rom. Is this not suitable?
That will not work no. Maybe you could try using their patch rom setup. As very little is done with miui here, you mugjt be better off asking in n their forums.
zelendel said:
That will not work no. Maybe you could try using their patch rom setup. As very little is done with miui here, you mugjt be better off asking in n their forums.
Click to expand...
Click to collapse
Can you explain, why this wont work? I supposed I just have to exchange all the signed apk files. When I re-sign them with apksigner then they also obtain the self-signed certificate containing the public key. So why is this not enough? Is there another instance in the OS which checks the app signature on boot?
The entire system partition uses the same signature. So I guess you could go through and recompile everything with the new key but I doubt it would work. Many oem system apps won't work without their oem signature.
Like I said. You maybe better off asking over in the miui forums as very little is done here for it.

Categories

Resources