Hi, i'm wondering where i can read more about /system/media/lockstyle file structure and coding language. Yeah, i know that manifest is an XML file, but if we for example have this code:
Code:
<Var name="isreached_to_pressed" expression="1" const="true"/>
<Var name="lock_state_pressed" expression="eq(#unlocker_lock.state,1)+eq(#unlocker_call.state,1)+eq(#unlocker_mess.state,1)"/>
<Var name="lock_state_normal" expression="eq(#unlocker_lock.state,0)*eq(#unlocker_call.state,0)*eq(#unlocker_mess.state,0)"/>
<Var name="lockstate" expression="#unlocker_lock.state+#unlocker_call.state+#unlocker_mess.state"/>
<VariableCommand name="camera_show_ani_end" expression="ifelse(#leftToRight,#screen_width-abs(#touch_dist),abs(#touch_dist)-#screen_width)" const="true" condition="#camera_show_ani_con"/>
Where do i get more information about all this eq, abs, ifelse expression, and Var names like lock_state_pressed, lock_state_normal, camera_show_ani_end etc. Is there any guide out there, i wasn't able to find by myself.
Oh, one more thing.
Does the lockstyle file only describes the outlook of lock screen or does it also handle the actions like how to unblock (press, swap or tap)?
Related
in order to get a mod to work in my theme i need to add a couple strings to my public.xml thats found in my framework-res.apk. i used ultracompare to compare 2 different xml files and i know what needs to be added to my xml file. i use notepad ++ to edit values but never added strings.
1. can i use notepad++ to add the strings to my public.xml?
2. does it matter what line they end up on?
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
You don't need to worry about adding pngs to the public.xml. just put the pngs in place in the decompiled apk along with the xml that's using the pngs. You can't add pngs that aren't being used, which is the only requirement.
Run 'apktool b' to rebuild the apk and the pngs should be added to the public.xml. that data will be in the resources.arsc file in the new apk if you had no errors. Copy that to your original apk and you're set.
You can decompile your recompiled apk if you want to see the newly added entries to the public xml. But that's just for fun.
Note; I found in the framework 21 for backflip that there was no more room for draw9.png images, just regular pngs.
Also, if you copy any1 else draw9.pngs from their apk make sure you copy the png from an unzipped apk and not a decompiled apk. Decompiles adds the 1 pixel ring around the image that wont go away unless recompiled. And you can't replace draw9 images to recompile or apktool will try to add it as a new draw9.png to public xml and error out. Just insert to your original apk.
That should cover all bases.
Im sorry, the second post threw me off. You said strings specifically. I would think the rule should apply the same. Use the string in an xml and the string is declared in another xml in the values folder, I think its strings xml. The compiled string resources will be in the resources.arsc file in the new apk.
djstaid said:
I use Open XML Editor, but I am sure you can use whatever works best for you. Notepad would hurt my brain though.
As far as the Public.XML, I don't think you can just remove and add lines to it...
The way it was explained to me was that any extra or new pngs added to a theme will be added into the Public.xml by way of "aapt". So there is no need to add. As far as removing items... well the entries are all coded a specific way so if you remove line 100... then everything from 101 to the end will be off by 1 and cause a lot of problems. An example...
<public type="attr" name="exported" id="0x01010010" />
<public type="attr" name="process" id="0x01010011" />
<public type="attr" name="taskAffinity" id="0x01010012" />
<public type="attr" name="multiprocess" id="0x01010013" />
<public type="attr" name="finishOnTaskLaunch" id="0x01010014" />
So as you can see the id used increases and then is associated with a specific item from within your apk. So as far as I know the best way to modify something (like a theme or etc) is to work with a Public.XML that has less in it so you can add to it... or just keep all those items in there (pngs, etc) and just make them a 1x1 image. Not the best way... but from what I have seen it has been done by many a theme maker and ROM builder.
Hope that answers your question.
** edit **
I just realized that I may had confused you (not knowing your knowledge level) so... The items are added to the Public.XML when you build the APK back together after editing it. This can be done with the apktool, which uses the aapt to do it's job. At least that is how it has all been explained to me so far. I also need to modify a Public.XML for my framework-res.apk and ran into problems here.
Click to expand...
Click to collapse
I am getting same problem as OP. You said that new PNGs or something are automatically added in public.xml right? But I am not able to see them. Actually, i added 5 more indeterminate progress bars and edited the animator xml for it too. The app compiled with apkmanager, but after decompiling the same, I don't see the new indeterminate PNGs declared in the public.xml.!! Plz. help me! I can't just flash and test immediately!! cause i don't have that phone!!
No they are not added automatically you have to add it yourself.
Only add or change lines don't remove.
For public.xml
Everything is grouped
Each group has an order
Drawable will be
0x7......00
0x7......01
................
0x7......ff
Remember they use letters also
You can add a new item
0x7.......g0
They have to be in order by resource type
String would start with ex...
0x6......00
Find the last string id that was used and add the next id.
Remember they are not always in order so actually use the text search to be sure.
Not sure if you already added the string to the strings.xml
That has to be done also.
For that open strings.xml
Copy the last line
Paste it to next line
Change string name (must match public.xml) and than value (what text is displayed)
Let me know if you need more help.
Sent from my PG86100 using Tapatalk
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
wes342 said:
Here is a write up i was planning on doing for my site
decided to start it now.
Add resources to an android apk
Its just a start but should be able to do it with out problems
Click to expand...
Click to collapse
Oh mahhnn!! Thanks a lot for that!! Now I don't need to depend on crappy tools for adding resources any more!!!
Once again, thanks a lot for that!!
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
"<public type="drawable" name="stat_notify_sms_9" id="0x7f020254" />"
Click to expand...
Click to collapse
So i make a line under that and that would be that:
<public type="drawable" name="ab_bottom_solid_dark_holo" id="0x7f020255" />
Click to expand...
Click to collapse
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Basian Mile said:
So when i understand it right i made it like that.
I wanna add "ab_bottom_solid_dark_holo.9.png" to mms.apk.
I copy it to "drawable-xhdpi". I open "public.xml" and scroll to the end of "<public type="drawable" ". Last string is:
So i make a line under that and that would be that:
In the whole xml is no other "7f020255". So that would be all? No other changes to do?
Click to expand...
Click to collapse
Everytime I've added a drawable, or a string, to my apps, I've never had to put them into public.xml
All I do is compile and they're added automatically. The only time I need to touch public.xml is if I want to remove something.
That would be nice. iam on JellyBean on my Galaxy Nexus and use apktool cmd. And it just gave me errors.
What do u use to compile. Maybe its a nice Tool with more Functions.
Trying to compile some samples from the Android SDK.
I just took the AccelerometerPlay example, ran the command:
Code:
android update project -p . -t 1
which creates the Ant build file, then
Code:
ant release
which builds release APK files.
The problem is, if I add something like:
Code:
import android.util.Slog;
to the .java file, the build fails, claiming that it can't find the file (even though it exists in {sdk_path}/sources/android-15
I'm guessing that it looks for .class files inside {sdk_path}/platforms/android-15/android.jar , where android/util/Slog.class doesn't exist.
How do I get this build to work?
I've tried adding
Code:
<src path="${sdk.dir}/sources/android-15" />
under the <javac> task in {sdk_dir}/tools/ant/build.xml, but it seems to throw out more errors, whilst also appearing to try to compile every single .java file there.
I'm new to Java so really don't know what I'm doing - can anyone please point me in the correct direction?
Thanks.
Anyone have any idea?
If you're new to Java, you may want to give Eclipse a try. You won't have to mess around with Ant too much and it will help you with your syntax/imports.
From your description, it looks like you'll want to add the .jar file you mentioned to the 'classpath' attribute of the <javac> element in your ant XML file.
- chris
Thanks for the reply cttttt.
What .jar file are you referring to? android.jar? Because that doesn't have the classes as far as I know.
Eclipse gets me even less further - I can't seem to install the ADT plugin at all. On Eclipse 3.7.2, it throws the WST error, and when I try the solutions "that work", I get thrown network errors.
(so at least I can get a build actually going with Ant)
I don't mean 12/24 hr format. I mean HH:mm:ss format. I want my status bar clock to display something like 23:59:59, I want the "seconds counter" included. How do I do this? Are there any app that can do this or I need to modify some system files (SystemUI.apk perhaps)? My phone is xperia mini pro (rooted). Thanks.
You would need to edit a bunch of files including xmls and smalis. I have looked and you may need to edit it on a source code level as the entry for the seconds is not present.
Thanks for your feedback. Do I really need to change the source that much? Is it possible to just change the value of the variable containing mm (HH:mm) to "mm:ss".
Ex.
HH=22
mm=39
ss=49
var hour=HH
string a="%mm%:%ss%"
string minute="%a%"
display contents of hour:minute
output = 22:39:49
I'm no programmer.
See that's the problem. The way it is written it just refs time format. Which is buried in the source code.
I need help on creating an app which requires root access.
Purpose of this app
1) Able to access a file in root/data/data/*APP XYZ*/*THIS FILE*
2) Generate a random string of number
3) Replace the specific string in *THIS FILE* with the randomly generated number
4) Saves *This File*
Right now I can do it manually but it is rather tedious. Was thinking if it would be possible to create an app to do this automatically with one click.
__________________________________________________________________________
After typing the above, I was thinking that maybe a shell script would do just fine.
Yeah a script would simply be more than enough !
#!/system/bin/sh
set number=$RANDOM
echo "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
*random unimportant stuff*
<string name="uuid">302$number-abcdefghijk</string>
</map>
" > /data/data/com.app/shared_prefs/app.xml
For some reason this script fails to run.
I want to change the uuid string but it doesnt seem to want to run.
I have a webpage that uses "Courier New" and "Source Code Pro" monospaced fonts. Unfortunately, simply copying these two truetype fonts to my /System/Fonts directory and rebooting isn't enough to fix the problem.
I have a feeling I need Android-specific html code in order for my webpage to be displayed properly on my Android web browser. If I'm right, I'm hoping the android-specific code wouldn't affect Windows desktop web browser viewing.
Could someone please be kind enough post extremely simple "working" html code that will display, for example, the word test once in "Courier New" font; and, also once in "Source Code Pro" font?
Below is my best attempt to make this work. But, my Android just laughed at me.
-----------------------------------------------------------------------------
<html>
<style> @font-face {
font-family: 'Courier New';
src: url('cour.ttf');
}
@font-face {
font-family: 'Source Code Pro';
src: url('SourceCodePro-Regular.ttf');
}
</style>
<body>
<span style='font-size:7.5pt;font-family:"Courier New"'>◄</span>
<span style='font-size:7.5pt;font-family:"Source Code Pro"'> China </span>
<span style='font-size:7.5pt;font-family:"Courier New"'>►</span>
</body>
</html>
-----------------------------------------------------------------------------
Thanks so much,
MKANET
Is there a better place I can ask this question? Im really motivated to get this working ASAP.
I ended up doing something drastic... renaming DroidSansMono.ttf to DroidSansMono.bak; then, renaming a font I want to use with it (in the /System/Fonts directory. Now, when I select "monospace" as my font-family in html, at least I can see the font I want. I'm guessing there has to be a better place to ask these kinds of questions. Hopefully, one day someone will know the answer to this and post here.