Library (libc++.so) porting/modifying for bringing back Soundcamp, possible? - Android Software/Hacking General [Developers Only]

I'm tinkering around with the discontinued Soundcamp by Samsung to see whether if will be able to make it work on my Galaxy A52 running A13 Pixel Experience. I have imported samsung libraries, permissions and etc, including the APKs cooperating with Soundcamp such as SapaMonitor/Professional Audio.
Here's the thing, I have successfully installed all of these apps however when I launch Soundcamp, it immediately crashes (surprise surprise).
The following error is from Logcat: "SdlLibrary: samsung flag is not found. What I assume is that it is trying to determine whether if the device is a Samsung device or not by checking the SDL (Simple DirectMedia Layer) Library, which should be libc++ (under system/lib).
Now, I seem to have 3 possible options.
One is that I remove the library usage by editing AndroidManifest.xml however, I'm not sure which one requests libc++ and might break app functionality.
Second option is that importing libc++ from A52's stock firmware file by extracting system.img, which I'm not sure if changing .lib came with PE to Samsung's lib breaks the whole lib functionality or not.
Adding "the Samsung flag" by editing the libc++.so file came with PE, which I have no idea how to.
Any suggestion would be appreciated.

Related

[Q] Custom Device driver / KernelLibrary

Good day,
I am new to the forum so please forgive me if this is not the right place to ask.
I have been reading through some of the threads on the forum and is curious to know if there is a way to load custom kernel libraries or device drivers onto the phone.
If there is a way, is there a correct procedure? For example to load a custom device driver / kernel library, do I also have to have an entry in the registry? Does the dll file have to be in /Windows?
Thanks in advance.
Good questions. There's been only a little research on this so far. I can tell you waht I've found, though:
For a stock ROM, nobody has managed it yet, but it might be possible. You'll need to have your DLL signed, and the certificate added to the Code Integrity store on the phone (just mailing yourself the .cer is insufficient! That will put it in the wrong store). You'll probalby want the DLL to be in \Windows, although I'm not sure it's needed. You almost certainly will need to add registry entries; the current drivers seem to have them.
Good day,
thanks for your reply. And thanks for all the good research you have done.
So at the moment, the software approach is not working but for custom roms, is it possible to include custom device drivers / kernel libraries in them?
Thank you.
mousefish321 said:
Good day,
thanks for your reply. And thanks for all the good research you have done.
So at the moment, the software approach is not working but for custom roms, is it possible to include custom device drivers / kernel libraries in them?
Thank you.
Click to expand...
Click to collapse
Well, it's possible. The HD2 Multitouch driver is an example that its somehow possible. Should be the same for the other devices (espacially HTC first gens)...
But don't know what you're getting at? Why would you need a custom driver?
Good day,
well, I just think that having a driver that acts like HTCUtility would make things convenient.
As for file operations, besides the application that Heathcliff has created (WP7RootTool), are there other applications that can do write operations to the /Windows folder?
What are the things that needs to be done before we can write to that folder?
Thank you.
Any app with Elevated or TCB privileges can write to \Windows, I think. Using HtcRoot project or WP7 Root Tools works (both elevate apps to TCB permissions, though using different methods). Also, using an OEM driver, such as HtcProvisionDrv or HtcFileUtility, works (although those two particular drivers were crippled in the 4.x firmware).
Good day,
thanks for the information. I tried the HtcRoot tool and it works. Thanks for the tool and the source that allows me to know how it works.
Can I assume that I would be able to have write access to the Certificate and Code Integrity store also?
I am also curious as to the workings of HTCFileUtility. A quick search on this turns up little information on its workings.
Furthermore, is there a guide to inserting custom certificates to the root Certificate and Code Integrity store? I have tried downloading the Certificates.zip file in http://forum.xda-developers.com/showthread.php?t=1236027 and test rom files in http://forum.xda-developers.com/showthread.php?t=1248799 hoping that they will shed some light but is unable to download them.
Any help is appreciated. Thank you.
Yes, installing your own cert into Code Integrity is possible (in several ways, actually, but I did it using HtcRoot just as an exercise). The certificates are actually stored in the registry, so any tool that can write to HKLM can add them. I believe that WP7 Root Tools will also let you choose the store for adding a certificate if you "open" the cert from the Root Tools filebrowser.
Although I don't know exactly how HtcFileUtility works, here's the basics. It's a software driver that exposes an interface - probably an IOCTL - which apps can use to perform filesystem operations. Since it runs with TCB permissions (it's probably kernel mode, though I haven't actually checked, but it's definitely in TCB) it can perform any operation that the filesystem supports. Of course, that doesn't mean that it exposes all those operations through the IOCTL... but it exposes enough of them for a pretty solid filebrowser implementation (that's how TouchXplorer and Advanced Explorer worked, although they used an OEM COM DLL that called into the driver rather than doing the IOCTL themselves).
The new version of it has very limited operations permitted; it will only list files in a few folders and so forth. It does still "work" within those limitations - Connection Setup, for example, uses it to check the folder that we use for interop-unlock on HTC - but it isn't useful for a general-purpose browser anymore.
It would be great to even figure out how to roll back the OEM drivers to earlier versions. For example, I've got WP7 Root Tools installed on my HD7, but I don't want to install HTC updates because they'll break my drivers such that if something ever goes wrong I won't be able to re-install Root Tools, or if a new hack is found (or developed; I'm working on some stuff with HtcRoot still) I won't be able to run it on my phone. Being able to use the advantages of the new firmware (Internet Sharing, compass in managed apps, hopefully an end to the damn music player freezing between songs...) while still having hackable OEM drivers would be reallllly nice...
Good day,
thanks for the information.
I noticed in the HTCRoot project thread where you mentioned that "It is not a true handle (no handle table, no handle data) but everything that checks for tokens also checks for this const value, and appears to pretty much skip all remaining permissions checks if it finds it".
Would you mind sharing some of the function names so that I could take a look at the code where the checking occurs?
Thanks.

dlopen failure when running OpenCL

I am porting an opencl application onto a Huawei honor8 phone, which comes with opencl. Also it is not rooted
When I ran my app, I got the error:
/system/vendor/lib64/egl/libGLES_mali.so" ("/vendor/lib64/egl/libGLES_mali.so") needed or dlopened by "/data/app/com.numericcal.ocl_peak-1/lib/arm64/libOpenCL.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.numericcal.ocl_peak-1/lib/arm64:/data/app/com.numericcal.ocl_peak-1/base.apk!/lib/arm64-v8a:/....
and the app crashes.
I actually have libGLES_mali.so placed under src/main/jniLibs/arm64-v8a along side whole bunch of other shared libs that libOpenCL.so depends on, I don't understand why this error pops up. (all the shared libs are pulled from the phone -- either from /vendor or /system directory)
Anyone have seen this before? Any good guess what I can do to fix it?
Thank you!
S Cheng
Same here. Honor 8 has the .so files, but trying to load them crashes. Likely because in Android N and Google blocked loading non-NDR runtimes in Android N. Very frustrating. Was looking forward to experimenting with it. I guess they want to force people to use Vulkan.

Is there any way to update wpa_supplicant conf in Android 9

Hi All,
My first post here, I am not sure I am posting in the correct section.
I need to update the wpa_supplicant conf of my Andorid 9 phone (an Asus Zenfore Max Pro M1) in order to allow it to connect to a MFP (managed frame protected) network.
I managed to configure my home linux machines to do so but with my Android phone it is a disaster.
From what I know the device needs to be rooted...for this I am just proceding with the proper steps but...I am not sure that the wpa_supplicant.conf to be modified is the one settled in the /etc directory as I ve read that on Android the conf file for the wpa_supplicant service may be different.
Is there any way to understand which configuration files a binary executable is bound with?
What I am trying to do is to set the pmf option in the correct wpa_supplicant.conf file in orded to let the device connect to a MFP network.
Any help will be so much appreciated.
Thanks!
Well...it is nice to discover that Android 9 is not using wpa_supplicant any more and that it will be a nightmare to crosscompile it and configure it as a daemon
This is my last android shxt phone.
A quick search reveals that WifiConfigStore.xml should be the file you want. requirePMF might help, from source for WifiConfiguration.java. I can't find any more documentation than that (opening source files kills my phone browser) but that should be a good start.
Thanks Efreak2004 but have tried that way as well.
Have modified the WifiConfigStore.xml by setting to true the requirePMF option but it did nothing.
My suspect is that the java wrapping useless stuff is not doing anything more than trying to "steer/drive" the native processes preposed to do the job. It has always be this way since the invention of java which was wrapping lib C in any aspect.
I am almost convinced that without the wap_supplicant binary/daemon there is no way to let the java fancy wifi manager do the job by its own.

What is this 'Chamber' folder that cannot be deleted?

I have enabled Work Profile on my Samsung phone using Shelter app.
Recently, I noticed that there is a folder called Chamber (see attachment) in the Work Profile, and I'm unable to delete it. I have tried deleting it in Safe Mode too, but it refuses to get deleted.
I can't delete it from my PC because this is inside the Work Profile, which is inaccessible using a PC.
I don't have this folder on my other devices where I have enabled Work Profile using the same Shelter app.
Does anyone know which app this folder is associated with and how to force delete it?
TheMystic said:
I have enabled Work Profile on my Samsung phone using Shelter app.
Recently, I noticed that there is a folder called Chamber (see attachment) in the Work Profile, and I'm unable to delete it. I have tried deleting it in Safe Mode too, but it refuses to get deleted.
I can't delete it from my PC because this is inside the Work Profile, which is inaccessible using a PC.
I don't have this folder on my other devices where I have enabled Work Profile using the same Shelter app.
Does anyone know which app this folder is associated with and how to force delete it?
Click to expand...
Click to collapse
If it is associated to an app, deleting the folder is pointless unless you uninstall/disable the app that it is associated to, otherwise, it will just keep recreating the folder.
Droidriven said:
If it is associated to an app, deleting the folder is pointless unless you uninstall/disable the app that it is associated to, otherwise, it will just keep recreating the folder.
Click to expand...
Click to collapse
That's true. But it doesn't seem to be associated with any app, or let's say I haven't figured it out yet. I have uninstalled many of the suspected apps in Work Profile, but it continues to remain intact. The folder seems to have been created around the time I installed the Work Profile, and most of the apps that are currently installed were installed much later.
TheMystic said:
That's true. But it doesn't seem to be associated with any app, or let's say I haven't figured it out yet. I have uninstalled many of the suspected apps in Work Profile, but it continues to remain intact. The folder seems to have been created around the time I installed the Work Profile, and most of the apps that are currently installed were installed much later.
Click to expand...
Click to collapse
The it might be part of Work Profile itself.
Droidriven said:
The it might be part of Work Profile itself.
Click to expand...
Click to collapse
No, it is not. I have Work Profile enabled in two other phones (both running on Android 13), and this folder isn't present in those devices.
TheMystic said:
No, it is not. I have Work Profile enabled in two other phones (both running on Android 13), and this folder isn't present in those devices.
Click to expand...
Click to collapse
If it isn't part of Work Profile and isn't associated to the apps installed in work profile, that only leaves the possibility that it is part of something not installed in Work Profile. You seem to have eliminated all other options, that is all that remains.
The other devices may have the same Android version installed but that doesn't necessarily mean that they are all equal, different devices do different things, even with the same Android version because each manufacturer and carrier puts their own stuff on top of stock android, yeilding different results from one device to the next. It could be something device specific that caused the folder to be created when Work Profile was installed/enabled. Something device specific that doesn't apply to the other devices, if those devices are different than the device you are dealing with.
Droidriven said:
If it isn't part of Work Profile and isn't associated to the apps installed in work profile, that only leaves the possibility that it is part of something not installed in Work Profile. You seem to have eliminated all other options, that is all that remains.
The other devices may have the same Android version installed but that doesn't necessarily mean that they are all equal, different devices do different things, even with the same Android version because each manufacturer and carrier puts their own stuff on top of stock android, yeilding different results from one device to the next. It could be something device specific that caused the folder to be created when Work Profile was installed/enabled. Something device specific that doesn't apply to the other devices, if those devices are different than the device you are dealing with.
Click to expand...
Click to collapse
I don't have another Samsung phone (with Work Profile enabled) to confirm. The other two devices are OnePlus and iQOO. It is not there on Redmi K50i either.
The name of the folder is quite unique. Let's hope someone can confirm if this is indeed a Samsung OneUI thing.
TheMystic said:
I don't have another Samsung phone (with Work Profile enabled) to confirm. The other two devices are OnePlus and iQOO. It is not there on Redmi K50i either.
The name of the folder is quite unique. Let's hope someone can confirm if this is indeed a Samsung OneUI thing.
Click to expand...
Click to collapse
I did various searches pertaining to "chamber" folder, I didn't find a single search result that even mentions a folder by that name or what app or stock feature it may or may not be associated to.
It might be some kind of Samsung security feature to create a separate, secure partition when you installed/enabled Work Profile. Or it may be because of how Samsung handles that kind of app. I could very easily be completely wrong, without familiarity with Work Profile and without finding definitive information or having the device in my own hands to investigate deeper, I can only guess or go with gut instincts tugging at the back of my mind of potential causes
Droidriven said:
I did various searches pertaining to "chamber" folder, I didn't find a single search result that even mentions a folder by that name or what app or stock feature it may or may not be associated to.
It might be some kind of Samsung security feature to create a separate, secure partition when you installed/enabled Work Profile. Or it may be because of how Samsung handles that kind of app. I could very easily be completely wrong, without familiarity with Work Profile and without finding definitive information or having the device in my own hands to investigate deeper, I can only guess or go with gut instincts tugging at the back of my mind of potential causes
Click to expand...
Click to collapse
There is no such folder in the Main Profile, so one can safely rule out an association with any system app that automatically got installed in the Work Profile.
There is no such folder inside the Secure Folder too, which is actually very secure. So a security related aspect can be ruled out in my opinion.
.
There is no system app by that name either. At this point, it is a dead end to tracing the source of this (empty) folder.
TheMystic said:
There is no such folder in the Main Profile, so one can safely rule out an association with any system app that automatically got installed in the Work Profile.
There is no such folder inside the Secure Folder too, which is actually very secure. So a security related aspect can be ruled out in my opinion.
.
There is no system app by that name either. At this point, it is a dead end to tracing the source of this (empty) folder.
Click to expand...
Click to collapse
I don't know, this still feels like it has something to do with Samsung's secure folder feature, whether in the secure folder or not or maybe Knox. Without giving anything away, what is in your secure folder. The fact that it is doing this on your Samsung but not the others is speaking to me. It just feels like something Samsung would do
Droidriven said:
I don't know, this still feels like it has something to do with Samsung's secure folder feature, whether in the secure folder or not or maybe Knox. Without giving anything away, what is in your secure folder. The fact that it is doing this on your Samsung but not the others is speaking to me. It just feels like something Samsung would do
Click to expand...
Click to collapse
The Secure Folder on Samsung Galaxy devices is basically a separate user profile (multiple users) with advanced Knox security. I have my banking apps, password manager, authenticators, and other apps installed in it. It is also where I save some important/ private files.
The benefit of Secure Folder (on Samsung Galaxy devices) and Work Profile (on all devices) over other 'multiple users' is the ease of accessing apps in them. Secure Folder and Work Profile are just a special type of multiuser whose apps can be easily launched from the main profile itself. Notifications for apps in these profiles are accessible from the main profile too.
But with all other multiusers, one has to 'exit' the main profile to get into the mulitiuser environment, which takes a few extra seconds. Notifications from the main profile are not accessible in multiuser, and vice-versa.
The Work Profile is a very convenient 'multiuser', which is why I enable it on all my devices. Samsung OneUI has disabled the 'multiuser' feature of Android, so this is another reason why I enabled the Work Profile. On stock Android and also most OEM Android versions, user can setup a maximum of 5 multiusers, in addition to the main profile.
But on Samsung Galaxy devices, user can only have the main profile, Secure Folder and Work Profile (max 3 users). Not sure why Samsung has removed this useful feature. They allowed multiusers in Samsung OneUI 5 Beta, but removed it from the Stable builds for some unknown reasons.

How to get custom One UI S-Pen writing sounds working? (ROOT)

I noticed the S23 Ultra adds in new sound effects for when you write with the pen in the Notes app. These are stored in system/media/audio/pensounds
The problem however is that they are just normal .wav files, when the older ones are in a proprietary .dat format. After some checking it turns out these .dat files are just uncompressed audio files, which can be imported into audacity by using the Raw Data option.
I tried taking the new .wav files and just pasted them over the old .dat files, and to some extent they work, but they are sped up and glitchy, so obviously not usable.
I also tried removing the RIFF headers from the files, and also making them 44KHz instead of their usual 22KHz, but that also didnt seem to fix it.
I am testing this by making it into a Magisk module, and installing it that way, so maybe something is screwing up there, because I even took the sounds and slowed them down, so that when they play sped up they play normally, but nope, still the same fast speed.
Has anyone ever gotten these .dat files figured out? If so, can you tell me how you got it working?
My device is a Samsung Note 9, with Noble ROM 3.0 Tropea.
Note: Cant use TWRP due to display issues, thats why I am using the Magisk module method rn.

Categories

Resources