I want to add some resources to android 5.0 framework,and I added some drawable/anim/layout files to /framework/base/core/res/res,and add "" in the public.xml in values directory,then I use "mm" at "/frameworks/base/core/res" to make a framework-res.apk ,and "adb put framework-res.apk /system/framework" ,but it does not work ,system crashes!
How can I add some resources to framework and it work?
You just add your resources under /framework/base/core/res/res/Resource_Type_Folder/.
Make an entry of your resource in public.xml under /framework/base/core/res/res/values/public.xml
That's it.
Build your image and you can access it from any app using following syntax:
#android:resoure_type/resource_name
BR,
Rahul
Related
Is it possible to get the config.xml file that is generated by Cordova based applications using Adroguard?
I cannot find it under the /res folder and it is not listed in the output of get_files() method.
apktool, on the other hand, is able to get the config.xml from the apk that is use it on.
Since it is under res folder, You need to get it by unzipping the file to a temporary directory and then parse it using Axml parser. In get_files(), you must see "resources.arsc" file. The res files are part of that. You can do something like :
config_xml_path = os.path.join(<your apk unzipped path>, 'res', 'xml', 'config.xml')
with io.open(config_xml_path, 'rb') as axml_file:
parsed_axml_file = AXMLPrinter(axml_file.read())
axml_content = parsed_axml_file.get_buff().decode('utf-8)
parsed_axml = minidom.parseString(axml_content.encode('utf-8'))
You might get some errors if the config.xml is badly formatted but I am not including the solution to handle those case. I hope you will get an idea with the above example.
I need to extract the application icon in a APK file.
I'm using aapt to know the icon location inside the APK file.
I'm running aapt dump badging com.example.app.apk:
this command returns me:
(...)
application-icon-120:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-160:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-240:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-320:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-480:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-640:'res/drawable-anydpi-v26/ic_launcher.xml'
application-icon-65534:'res/drawable-anydpi-v26/ic_launcher.xml'
(...)
but as you can see it returns me the location of an XML file which in some way is encrypted. I know this XML file has the real path for the PNG file icon, but I don't know how can I get that real path (or how can I decrypt the XML and then parse it).
Is there any way to get the real path for an application icon inside a APK file with a XML pointing to other location?
Thanks!
Check out this project,
https://github.com/iBotPeaches/Apktool
It can be used to unarchive an APK, including the assets.
apktool d <your>.apk
try extract your apk file with 7-zip and you will get res foulder
I got this in my folders :
But on my android device, i have a file not found error because it looks for andoid_assets instead...
Where can i set my folder path ?
fixed,
do not put underscores as prefix for folder name..
Need to access the asset files from your main root(projectname->www) only on android device need to set the path like file:///android_asset/www/yourfilepath
E.g., file:///android_asset/www/images/xyz.png
I have started working on android just 1 month back (so please consider my question even if it looks simple). I have my Bluetooth code running on Android 2.2. So I am working on using backport-android-bluetooth to migrate it to Android 1.6 (as I have some old pads with 1.6).
I came across foll. link: http://code.google.com/p/backport-android-bluetooth/
I have queries regarding point no. 1 and 2 under 'Install' which are as follows:
1. download backport-android-bluetooth2.jar, and put into your projects's reference libraries. - Where is exactly 'projects' reference library'? How to put .jar file in that 'reference library
2. put backport_android_bluetooth.properties in to your src directory. -Is this file to be put in 'src' folder or '*Project_Name*' folder like project.properties file?
Thanks in advance.
Put a new file into your src dir,named backport_android_bluetooth.properties
and then put the code below in it:
#permission_name = ${your package name).PERMISSION_BLUETOOTH
permission_name = com.example.bluetooth.PERMISSION_BLUETOOTH
#request_enable = ${your package name}.action.REQUEST_ENABLE
request_enable = com.example.bluetooth.action.REQUEST_ENABLE
#request_discoverable = ${your package name}.action.REQUEST_DISCOVERABLE
request_discoverable = com.example.bluetooth.action.REQUEST_DISCOVERABLE
if u r using eclipse than right click on ur project New/Folder,
give folder name as libs and copy & paste android-bluetooth2.jar in libs folder.
than right click on libs folder go to Build Path/ Configure Build Path
Click on Add Jar, select your project/libs/android-bluetooth2.jar
press ok
Hi all
I am trying to develop an android extension for air, but I have a problem with resources.
According to this : Official adobe doc - FREContext
and this Extending AIR by Oliver Goldman
We simply have to add the resources we need in the res file of the Native part, then they are added inside the .ane file and passed to the final apk. In order to access them though we have to use getResourceId( "drawable.background_image" ) instead of R.drawable.background_image
But when I generate my extension, the res file is actually not even included anywhere inside the .ane file and also not inside the final apk. And I have found not a single extension on the net using resources (not even in the adobe samples)
For this test I simply use the basic Hello world Vibrate test, but I added a new png in the drawable folder.
As you can see while unziping the .ane file, then going to META-INF/ANE/Android-ARM
the res file is absent.
As a result, the program crashes when I try to access my resource FREContext.getResourceId("drawable.ppy_accessory_manage.png")
Has anyone managed to make resources work with ANE in android? Is there something I should change in my command line while compiling the ane?
Thanks :-)
PS, here is my batch to compile the ANE :
set adt_directory=C:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\bin
set root_directory=C:\Users\hugo\Adobe Flash Builder 4.6
set library_directory=%root_directory%\HelloANELibrary
set native_directory=%root_directory%\HelloANENative
set signing_options= -storetype pkcs12 -keystore "C:\Users\hugo\Adobe Flash Builder 4.6\certificat.p12"
set dest_ANE=HelloANE.ane
set extension_XML=%library_directory%\src\extension.xml
set library_SWC=%library_directory%\bin\HelloANELibrary.swc
"%adt_directory%"/adt -package %signing_options% -target ane "%dest_ANE%" "%extension_XML%" -swc "%library_SWC%" -platform Android-ARM -C "%native_directory%" library.swf HelloANENative.jar
You just have to add after "-platform Android-ARM" the following: -C "%native_directory%" res
With your res folder in %native_directory% !
But the best way is to create a %target_native_directory%, put everything you need inside, and use:
-C "%target_native_directory%" .