[Q] smali: How to add an external library to save settings - Android Q&A, Help & Troubleshooting

I am trying to add a library that will read/write settings in an Android ROM through smali editing.
If compiling from source I just add the library source and edit a couple of Android.mk's but from a non AOSP rom I do not know how to add the library.
So far I have tried using Xposed, but I prefer not requiring Xposed.
Is there a way or alternative approach to have a settings library added?
Thank you

Related

[Q] Editing Android Kernel - HCE/NFC

I'm currently in the process of creating a custom version of AOSP that will edit the functionality of the Host-Card Emulation feature of Android, allowing me to manually set the AID produced when my device goes into emulation mode.
I've downloaded the Android source, and have located the files I think governs HCE functionality.
From the NFC System Service, I've located the following files:
"CardEmulationManager.java" and "HostEmulationManager.java" located in "/aosp/packages/apps/Nfc/src/com/android/nfc/cardemulation/"
And from the Android core framework, for the NFC API I have found:
"CardEmulation.java" located at "/frameworks/base/core/java/android/nfc/cardemulation/CardEmulation.java"
From here, i'm unsure how to get started in editing the code. I'm unsure of the interactions between the files, and how they are called at run (I.e. which functions in the file I should be looking at, how would I go about adding my own code/modifying existing code in the file)
Is there any documentation online about how these files work/are ran? Or how would I go about finding out on my own (Through debugger tools etc.)
I'm currently using Eclipse for Ubuntu, and will be developing for a Nexus 7

[Q] Cyanogenmod Kernel Configuration Option To Specific File Map

Hello,
I am trying to build cyanogenmod kernel for an unsupported device. As I learned, the options for kernel build are in the file cyanogenmod_xxx_defconfig.
In that file you have to specify what config you have to use (for example CCONFIG_ARM=y , CONFIG_HAVE_PWM=y). I am experiencing some build problems because if I enable some options there are other config requirements for that for example CONFIG_BT_HCIUART_H4=y requires CONFIG_BT_HCIUART=y. If you build without that there is no clear way of showing you that you are missing that config option and you have to enable it. Sometimes it does say that something is undefined, so I have to search for that word in the sources, find the missing .h file, figure it out what option does it need in the config file (sometimes unsuccessful).
I belive if a map of the config options is available somewhere will greatly help adapting cyanogenmod for other unsuported devices.
for example
CONFIG_BT_HCIUART=y (uses files from kernel\drivers\bt\.... )
|
|---------- CONFIG_BT_HCIUART_H4=y (uses files from kernel\drivers\bt\....)
If you happen to know some documentation on these files will be greatly appreciated, eventually develop a custom tool for setting those options and dependencies.
Thank you for your time.

Proper way to use and dig into the android library code in eclipse

1- Why I can't open xml files from android library in eclipse? When I double click on it, I got this error:
Android XML Editor cannot process this input.("i.stack.imgur.com/aiaa9.png")
2- How can I search in android library codes?
3- Where is setting activity in this library? To be more specific I want Date & Time activity ("i.stack.imgur.com/lY7SJ.png")

How to Add Java codes to Decompiled Files?

I decompiled an Apk file and I want to add some code to the java classes,but it seems that the javaclasses are different from the way they are written,for example those who edit WhatsApp and make WhatsApp plus ,how did they decompile WhatsApp to get dull source code and add some java codes to add features ?really frustrating !
The apk is most likely obfuscated with some program such as proguard because the developers do not want you looking at their source code..

Creating my own launcher as personnal project (launcher3 fork)

Hey everyone,
Due to the lockdown in my country I have to stay home. What a better way to do this than working on a project right ?
The idea is to create a simple launcher with the basic functionnality :
having an app drawer
home screen with dock
possibility to create folder on homescreen
possibility to remove app / folder from homescreen
bonus : possibility to add icon pack
You see, very basic as I said.
I started from scratch, but yesterday I asked on Lawnchair's community telegram and someone talked to me about Launcher3.
I didn't know this launcher and I discovered that a lot of launcher are based on Launcher3, they are all a fork from it.
This motivate me to do a fork to.
But I have a lot of problems to build the launcher itself. I clone the project, open it with Android Studio and I have errors from gradle, when I fix them I have other errors. I think I'm doing wrong but I searched online and I don't find any ressources that can help to start this project or give me clues to understand better.
I am a beginner in Android dev, but trust me I have a really strong motivation I don't want to hear "This is to difficult for you mate, try something else"
Thank you for reading me
hello, you means you want to make a personal launcher project base on launcher3. so now what's your problem in make it build success?
Based on our previous experience, may be has fllow steps:
1.you need a aosp source(or you already have other rom code choose, it's ok), and build it;
2.get the framework.jar from the out path intermediates (for launcher3 has many class only system framework contain);
3.copy launcher3 code from aosp source to your owner path, and make an Android studio project;
4.copy the second step framework.jar to the launcher3 Android studio project(you can put it under app/libs/) and just compileOnly the framework.jar(we just need to declare some system class for compile, finally when the app work it still base on different devices owner framework in the system);
5.add flowing code in you build.gradle:
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xbootclasspath/p:libs/framework.jar'
}
}
6.if you have a some v7 package implements may be some time will show you some <attr> conflict, like <attr name="icon"> conflict, just change it to <attr name="icon" format="string"> is ok.
Under normal conditions,above steps can help you to make your launcher3 project work well in AS, and also you can compare some open source in github, there has some launcher3 AS project. hope to work for you, if not work for you, you can show the error message you meet more detail, may be we can help to found out the problem
Bro I think you can use jadx decompiler and any working laucher3 to show their source code. Learn from it how the stuffs work. Then start a new project from scratch in Android Studio.. Modify for your own needs.
walker ice said:
hello, you means you want to make a personal launcher project base on launcher3. so now what's your problem in make it build success?
Based on our previous experience, may be has fllow steps:
1.you need a aosp source(or you already have other rom code choose, it's ok), and build it;
2.get the framework.jar from the out path intermediates (for launcher3 has many class only system framework contain);
3.copy launcher3 code from aosp source to your owner path, and make an Android studio project;
4.copy the second step framework.jar to the launcher3 Android studio project(you can put it under app/libs/) and just compileOnly the framework.jar(we just need to declare some system class for compile, finally when the app work it still base on different devices owner framework in the system);
5.add flowing code in you build.gradle:
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xbootclasspath/p:libs/framework.jar'
}
}
6.if you have a some v7 package implements may be some time will show you some <attr> conflict, like <attr name="icon"> conflict, just change it to <attr name="icon" format="string"> is ok.
Under normal conditions,above steps can help you to make your launcher3 project work well in AS, and also you can compare some open source in github, there has some launcher3 AS project. hope to work for you, if not work for you, you can show the error message you meet more detail, may be we can help to found out the problem
Click to expand...
Click to collapse
Hey,
Thank you for your answer. I clone launcher 3 from here : ht tps:// android.googlesource.com/ platform/ packages/ apps/ Launcher3
But I can built it on android studio, am I doing it wrong ? (I'm on Windows 10 btw)
I open the folder Launcher3 (from which I cloned) and AS ask me for gradle location ...
Thanks again.

Categories

Resources