Made a ROM. Now what... - Android

I built a rom for my device based on lineage oreo. So far it looks good. I want to do the following things and not sure how to achieve this, will keep working on it, but any tips are appreciated.
1. change the name etc of the ROM. Different generated name for the rom zip file. different name in settings->About phone after the install.
2. Add an existing apk to the code base so that its automatically installed. How do I make it removable (pre installed app, can be removed) or not-removable (pre installed app, can't be deleted.
3. Add sources for an apk to the code base so that it gets compiled and installed. Same question with removable/non-removable. I tried this with f-droid sources. Added a line for this to the local manifests. Sources get downloaded, but dont get compiled. I added a line for this to the PRODUCT_PACKAGES in common.mk (for the vendor tree) but I dont see anything related to f-droid in the build log or the out folder related to f-droid. App does not get installed on the phone.
4. Change settings for an app. i guess this would require modifying the contents of some file where the settings are stored. Is there a concept of a post install script where it can be taken care of.
Thats all I can think of now, more later. Thanx guys..

Related

[Q] apk decompiled, recompiled, signed won't install

Hello,
I'm trying to hack an apk.
My first step was to use apk multi tool, and to just decompile and recompile it.
This is what i've done:
decompiling
recompiling (without any mod)
signing
No error appears during those steps.
But this new apk won't install on my phone !
If I check difference between the two apk:
all xml files are differents
.RSA and .SF have not the same name
classes.dex, resources.arsc and manifest.mf are differents
I don't understand those difference. can somebody help me to understand that and how to recomile a proper version ?
PS: This app is a french app that shows speed cameras on the road. However this app is now only showing a big zone and not the exact location for france. But it stills show precise location for other countries, so obfuscation is done at the apk level, and I already found where it is in the code, so i'd like to bypass it and recompile a "special' version
Thanx
Just a few quick questions. Is you phone set to install from sources than Droid market? You do know the newly compiled and signed project will be located in the "place_package _here_ for_Modding" folder and is named "Signed(yourappnamehere).apk?
Sent from my SAMSUNG-SGH-I727 using xda premium
Hi,
yes, i took the newly compiled apk in this directory, and yes my phone is set accept unknown sources.
When i install the apk, i first have the
- liste of phones serviesc that will be used
- then the install progress bar
- then the message "application not installed"
I guess there is some kind of protection in the sources...
I also noticed that the two apk - original, and resigned one - don't have same size.
The only difference is actually in the META-INF directory : the .RSA and the .SF files.
In the original application they are:
- IFOX_.RSA
- IFOX_.SF
But when recompiling, those files are:
- CERT.RSA
- CERT.SF
I'm shure the problem comes from here, but i'm too noob to analyse that...
So my proble can be sum-up by:
Why the recompilation doesn not give me the same RSA and SF file ??
Beware there are some modifications that you cant do on decs, expecially the packagename.
also beware to disable the "non-market" tag on the phone.
Yes, but for the moment i didn't make any modification:
Just decompiling, recompiling and resigning.
Maybe you want to tell that the apk name must stay the same ? (sorry my english is not perfect )
GOT IT WORKED !!!
You must first uninstall the previous application !
I was trying to install my new one over the old one, but the signatures are not the same !!!
Thanx everybody, and hope this will help somebody !
APK edit error 103
Ok im having a similar issue.
I know the file size is mismatched but ive never had this issue
as a test i only modded 1 thing but 4 files
changed a link in an html / changed an image and its name and the html included the link to the new name
when this failed i changed the manifest and the .sf to match the change i made with name but not the sha :"no clue here"
Tried...
APK multi tool ... and 7zip to make the mods
Tried... Bothsigned and unsigned.
Tried copying the sig from old apk to new with names corrected "notsha" fail still
Tried....
Origional APK installs no issue
Uninstall orig apk rebooted
Allow out side apps yes and no.both
using file manager explorer and root browser and es file manager
Copying directly to /system/app fail
copying to data/data/app/copy fail " yes it wont even copy to there"
Tried.. Multiple phones
I then tried a hex editor on the apk. And after changes install still fail.
I modded several other apk's even my framework but this is the first app that ha given me so many issues
This is an app to help elderly users access internet and the devs are AWOL and the project abandoned
Code:
https drive google com/folderview?id=0B5PggxVy7c8meDhrcjNJOGs5cFk&usp=sharing
Code:
www eldy eu/en/software/eldy-tablet/‎
"edited for posting "
The goal here is to make it more U.S. friendly its English base is geared to English UK and this does not help my family as we are in the U.S.
All i can get from logcat is error 103
Logcat shows package it.vegans.eldy has no certificate at entry AndroidManifest.xml ignoring
Knstallation error code 103
I tried apk multitool certify thing
i tried copying the certs from old to new apk
i tried modding the cert to correct names
So maybe im mentally challenged but i just cant figure this one out
---
Edit .
I attached a zip with original and modified apk's
All i want to do is simple html edits xml link edits and img changes since mostly the app is a series of pages.

How to develop an application already included in the ROM

Hi all,
I'd like to modify the Gallery3D application , which is already included in my current rom (CM7 nightly), using eclipse and adb. However when trying to install the version I compiled, it fails.
There are two conflicts at least : the package name, and the providers.
I tried to freeze the ROM version with titanium backup, but it doesn't change anything.
The package name, I could change it in the source code (using sed utility, since eclipse was generating an exception with the Android tool to rename the package -_-)
But the providers, this is really annoying to have to change their names as well, it's a much more complicated operation, and I'd prefer to be able to use the source code as is.
So is there a simpler solution ?
I suppose I could try to remove Gallery3D from the ROM, but not sure how to do that. Or other possibilities ?
Ok found the solution : I simply had to remove the Gallery.apk file from /system/app

[Q] Proper way to remove a package from source?

Hello all,
I am working on a custom CyanogenMod ROM (10.2) for my own use. I've managed to accomplish most of my goals. One thing remains: removing packages that I don't want/need from the build. Technically, I am able to do so already by modifying the Android.mk file of the package so that it produces errors during the build procedure, skips building the package, but doesn't stop the entire build process. However, that is just a lousy hack.
Can anyone point me to the correct .mk/.sh/.whatever files in the repository I would need to edit (there are probably several) so that I can skip building the packages I don't want included in my ROM? I want to avoid using a "kitchen" if I can. I won't actually learn anything if I use a kitchen.
Files to look at
After laboriously looking through the repository, I came accross several files/directories you may need to look through/edit to remove packages from the build:
This directory (replace cm102 with your path to your Cyanogen repo):
/cm102/vendor/cm/config
This file:
/cm102/android/cm-10.2-M1.xml (<- This is a long file, dig through it. I edited this to help me remove some prepackaged live wallpapers, but there is a lot more in here.)
Device specific CM makefile that may specify additional packages to include (replace the all caps with whatever seems logical in your directory at each step):
/cm102/device/YOUR_MANUFACTURER/CODENAME-COMMON/CODENAME-COMMON.mk

How to install new headers?

I have installed the ROM resurrection remix (7.1 nougat), I would like to know how to install or put a custom image in the header, already comes with some images and some apps add others, but not to add my own image, thank you who help!
I have the same question.
This is the starting point : https://github.com/omnirom/android_packages_apps_OmniStyle
This is being used to provide custom headers. There are apps to extend the list or you can try to add your own, but it's not like putting it into a folder and done. You need to add them to some xmls and what else...

[Treble][RIL] Qualcomm device and in-call audio not working? Check this out

Hello,
After a few weeks of having Project Treble GISs running in my Razer Phone, I had one big issue to solve, and that was the in-call audio. I stumbled upon a few people in #phh-treble Telegram group that suggested me to use ZUK (MSM8996) patches to get it to work, but unfortunately they weren't fully working... because of a missing apk from my device's stock image (which I didn't know until 2 or 3 days ago). Starting from there, I worked on it quite a lot of time until almost giving up, to then finally getting it to work just now.
Steps I followed:
1. Pull from your device's stock image the following files (they may not be in /system and instead be located in /vendor, depends on your OEM's Treble implementation)
- app/QtiSystemService
- app/QtiTelephonyService
- framework/qcrilhook.jar
- framework/QtiTelephonyServicelibrary.jar
- etc/permissions/privapp-permissions-qti.xml
- etc/permissions/qcrilhook.xml
- etc/permissions/qti_permissions.xml
- etc/permissions/telephonyservice.xml
- priv-app/qcrilmsgtunnel
2. Fortunately, those APKs will contain a .dex inside of them, but in case they didn't, you'd need to first deodex your rom based on the vdex files located in /system/framework/oat. However, the jars will definitely and for sure won't have the inner .dex classes. You'll need to use a tool such as vdexExtractor to get the final .dex files for qcrilhook.jar and QtiTelephonyServicelibrary.jar. Then, open the metioned .jar's as zip files, embed the .dex inside and done.
3. The tricky part comes now: With a tool such as APKTool, decompile the qcrilmsgtunnel.apk file you've extracted from your Stock ROM image. I'm not going to go throught the steps to perform that. Now, open up the AndroidManifest.xml and find the line:
Code:
<uses-library android:name="[email protected]" />
and replace it with
Code:
<uses-library android:name="[email protected]" android:required="false" />
Recompile the apk and, without signing it yet, put it in a safe place.
4. Open up the other APKs and remove the META-INF folders from inside of them (the signatures). Now, download a copy of SignAPK and sign every apk (including the ones we've removed the signature from, plus the modded version of qcrilmsgtunnel.apk with the platform keys (platform.*) from Android AOSP.
You can do so by using the following command:
Code:
java -jar /path/to/signapk.jar /path/to/platform.x509.pem /path/to/platform.pk8 NameOfTheApk.apk NameOfTheApk_signed.apk
5. Open up the files qcrilhook.xml and telephonyservice.xml and ensure that the file="" path points to /vendor. i.e:
Code:
file="/vendor/framework/qcrilhook.jar"
6. Move the files to your device according to this table:
- app/QtiSystemService -> /system_root/system/app/QtiSystemService (replace)
- app/QtiTelephonyService -> /system_root/system/app/QtiTelephonyService (replace)
- framework/qcrilhook.jar -> /vendor/framework/qcrilhook.jar (delete the original file wherever you found it)
- framework/QtiTelephonyServicelibrary.jar -> /vendor/framework/QtiTelephonyServicelibrary.jar (delete the original file wherever you found it)
- etc/permissions/privapp-permissions-qti.xml -> /system_root/system/etc/permissions/privapp-permissions-qti.xml (delete the original file wherever you found it)
- etc/permissions/qcrilhook.xml -> /system_root/system/etc/permissions/qcrilhook.xml (delete the original file wherever you found it)
- etc/permissions/qti_permissions.xml -> /system_root/system/etc/permissions/qti_permissions.xml (delete the original file wherever you found it)
- etc/permissions/telephonyservice.xml -> /system_root/system/etc/permissions/telephonyservice.xml (delete the original file wherever you found it)
- priv-app/qcrilmsgtunnel -> /system_root/system/priv-app/qcrilmsgtunnel (replace)
Reboot and profit.
Nice job now maybe the devs can add it to their rom.a little lengthy and out of my league to try
Of course this is not a final solution @gillim74.
But if the mentioned Qcomm apks or jar libs aren't present in the device's vendor partition (which I bet they aren't), the steps of decompiling them, and placing them into vendor is still needed, even for GSI's that include the patch.
What ZUK patch? I got a ZUK Z2 with treble rom and calling is not working.
Where can i get the patches?
andreas951207 said:
What ZUK patch? I got a ZUK Z2 with treble rom and calling is not working.
Where can i get the patches?
Click to expand...
Click to collapse
https://github.com/zuk-devs/android_vendor_zuk/commit/9ab51560c8d5632a08bdb949bd433909b8db5752
great explanation
linuxct said:
Hello,
After a few weeks of having Project Treble GISs running in my Razer Phone, I had one big issue to solve, and that was the in-call audio. I stumbled upon a few people in #phh-treble Telegram group that suggested me to use ZUK (MSM8996) patches to get it to work, but unfortunately they weren't fully working... because of a missing apk from my device's stock image (which I didn't know until 2 or 3 days ago). Starting from there, I worked on it quite a lot of time until almost giving up, to then finally getting it to work just now.
Steps I followed:
1. Pull from your device's stock image the following files (they may not be in /system and instead be located in /vendor, depends on your OEM's Treble implementation)
- app/QtiSystemService
- app/QtiTelephonyService
- framework/qcrilhook.jar
- framework/QtiTelephonyServicelibrary.jar
- etc/permissions/privapp-permissions-qti.xml
- etc/permissions/qcrilhook.xml
- etc/permissions/qti_permissions.xml
- etc/permissions/telephonyservice.xml
- priv-app/qcrilmsgtunnel
2. Fortunately, those APKs will contain a .dex inside of them, but in case they didn't, you'd need to first deodex your rom based on the vdex files located in /system/framework/oat. However, the jars will definitely and for sure won't have the inner .dex classes. You'll need to use a tool such as vdexExtractor to get the final .dex files for qcrilhook.jar and QtiTelephonyServicelibrary.jar. Then, open the metioned .jar's as zip files, embed the .dex inside and done.
3. The tricky part comes now: With a tool such as APKTool, decompile the qcrilmsgtunnel.apk file you've extracted from your Stock ROM image. I'm not going to go throught the steps to perform that. Now, open up the AndroidManifest.xml and find the line:
Code:
<uses-library android:name="[email protected]" />
and replace it with
Code:
<uses-library android:name="[email protected]" android:required="false" />
Recompile the apk and, without signing it yet, put it in a safe place.
4. Open up the other APKs and remove the META-INF folders from inside of them (the signatures). Now, download a copy of SignAPK and sign every apk (including the ones we've removed the signature from, plus the modded version of qcrilmsgtunnel.apk with the platform keys (platform.*) from Android AOSP.
You can do so by using the following command:
Code:
java -jar /path/to/signapk.jar /path/to/platform.x509.pem /path/to/platform.pk8 NameOfTheApk.apk NameOfTheApk_signed.apk
5. Open up the files qcrilhook.xml and telephonyservice.xml and ensure that the file="" path points to /vendor. i.e:
Code:
file="/vendor/framework/qcrilhook.jar"
6. Move the files to your device according to this table:
- app/QtiSystemService -> /system_root/system/app/QtiSystemService (replace)
- app/QtiTelephonyService -> /system_root/system/app/QtiTelephonyService (replace)
- framework/qcrilhook.jar -> /vendor/framework/qcrilhook.jar (delete the original file wherever you found it)
- framework/QtiTelephonyServicelibrary.jar -> /vendor/framework/QtiTelephonyServicelibrary.jar (delete the original file wherever you found it)
- etc/permissions/privapp-permissions-qti.xml -> /system_root/system/etc/permissions/privapp-permissions-qti.xml (delete the original file wherever you found it)
- etc/permissions/qcrilhook.xml -> /system_root/system/etc/permissions/qcrilhook.xml (delete the original file wherever you found it)
- etc/permissions/qti_permissions.xml -> /system_root/system/etc/permissions/qti_permissions.xml (delete the original file wherever you found it)
- etc/permissions/telephonyservice.xml -> /system_root/system/etc/permissions/telephonyservice.xml (delete the original file wherever you found it)
- priv-app/qcrilmsgtunnel -> /system_root/system/priv-app/qcrilmsgtunnel (replace)
Reboot and profit.
Click to expand...
Click to collapse
Hi
It seems to be a great work.
For me in resurrection remix 8.1 in call audio is working, but music sound over Bluetooth isn't working. Do you've got any ideas?
Please could you share your modified files for in call fix?
Thanks in advance
Thread dead?
No more updates?
Laptapper said:
No more updates?
Click to expand...
Click to collapse
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.
linuxct said:
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.
Click to expand...
Click to collapse
Thanks, but even as before there are problems with Bluetooth in call and/or audio as before on a couple of devices....
Does somebody know if this fix has been included in some ROM? I don't know which ROM to try as GSI on my Razer Phone
guillermohs9 said:
Does somebody know if this fix has been included in some ROM? I don't know which ROM to try as GSI on my Razer Phone
Click to expand...
Click to collapse
I said it literally 2 posts ago.
linuxct said:
This has already been implemented into phh's gsi repo. I have no clue what you expect from this thread anymore.
Click to expand...
Click to collapse
IT IS implemented in all new, recently built GSIs. Just try any.
linuxct said:
I said it literally 2 posts ago.
IT IS implemented in all new, recently built GSIs. Just try any.
Click to expand...
Click to collapse
damn, my bluetooth calling still doesn't work on any GSI i try.
knives of ice said:
damn, my bluetooth calling still doesn't work on any GSI i try.
Click to expand...
Click to collapse
Yeah bluetooth calling on Qualcomm devices is still a no-go.
There is a bounty for it: https://github.com/phhusson/treble_experimentations/issues/374
phhusson said:
Yeah bluetooth calling on Qualcomm devices is still a no-go.
There is a bounty for it: https://github.com/phhusson/treble_experimentations/issues/374
Click to expand...
Click to collapse
ok, I'm glad I'm not alone. AndroPlus posted in your bounty thread on github as well and he maintains the GSI based build for my device the mi mix 3. for most people bluetooth calling does work with his fix, but for me it does not. i will contribute to the bounty as well.
nice work bro but can you make a video to explain the way?
I have this problem in the Qualcomm j4 core msm8917
So I have a Qualcomm device(SD845 in an AGM X3), in-call audio and bluetooth calling work great but main audio does not work at all. I can force sound to route through the in-call speaker, but not really viable.
Any chance following this guide would help? Are there other files I should include since my issue is not in-app calling.
My device will not boot past v123, so if this has been resolved in newer releases unfortunately I can't install.
I tried building an overlay. I followed the method in the guide from phh as well as from a post on XDA. First few attempts broke boot but when I finally got an overlay build to boot it did not resolve problem.
So, would trying this route be worth a shot?
9.0 otherwise runs flawlessly on this device. Sound and MTP are the only things broken. Fingerprint reader is detected as volume down, but I don't use it anyway. It's very stable.

Categories

Resources