kernel compile config question: append current date to config localversion? - Android

I was wondering if anyone would know how to append the current date when a kernel was compiled so that it would generate a date automatically rather than hardcoding it each time you build the kernel. Right now the common practice for kernels I've seen is to hardcode it such as:
CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-20120806" in your .config file. I was wondering if there was a way to have it pull the current date into the string instead of hardcoding it.
Right now I'm just guessing names of a potential variable such as $(date) or something but I'm just taking pot shots.
Any ideas?

jawz101 said:
I was wondering if anyone would know how to append the current date when a kernel was compiled so that it would generate a date automatically rather than hardcoding it each time you build the kernel. Right now the common practice for kernels I've seen is to hardcode it such as:
CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-20120806" in your .config file. I was wondering if there was a way to have it pull the current date into the string instead of hardcoding it.
Right now I'm just guessing names of a potential variable such as $(date) or something but I'm just taking pot shots.
Any ideas?
Click to expand...
Click to collapse
Couldn't you just append that to your make command.
Code:
make -j8 CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-$(date +%Y%M%d)"

I'll give that a whirl. I really didn't know if there was any valid variable that could do it or if it is wishful thinking.
Sent from my LG-VM670 using Tapatalk 2

you rock. that works

jawz101 said:
you rock. that works
Click to expand...
Click to collapse
Hell yea man, you are welcome.

Related

[INFO] Palm Pre (Cards-Like) Thumbnails

Hi all,
@ruqqq (aka arctu, author of HelixLauncher) tweeted me a whole bunch of stuff this afternoon, and to be honest, this is 99% his credit, I only changed the required line in framework to help him test, so I get 1% . Anyway, @ruqqq did some searching online, and the one of most importance was this:
http://www.mail-archive.com/[email protected]/msg21135.html
After looking at the code, we simply uncommented the following line in ActivityThread.java:
Code:
//info.thumbnail = createThumbnailBitmap(r);
With it commented, it thumbnail will always be null, with it uncommented, well, we may be able to get actual thumbnails. @ruqqq then went on to write a quick (and ugly ) app to find out if thumbnails of running apps can be retrieved, and the result is, yes, it can be retrieved. The screenshot I posted only shows 2 apps cause of the lack of ScrollView, but I believe he's writing a better proof-of-concept as we speak, while I'm rushing to go out once I end this post (else the girlfriend's fury ).
Screenshot: http://twitpic.com/1w1p6t
New Screenshot (Still ugly ): http://twitpic.com/1w1v6k
So what's the point of this post? Nothing, really. It's just that the commented line has apparently been in there as early as 1.5, but it was always commented out. We removed the comment, and it actually does return thumbnails. With this, it means that if future ROMs are compiled with that line uncommented, it will be possible to actually write apps to emulate/simulate the cards system, possibly even on a system level (by overriding the recent applications dialog).
That's all .
@ruqqq's concept app source: http://github.com/ruqqq/ActivityThumbnailPrototype-Application
framework source: Come on, it's just a line .
Very interesting. Looking forward to seeing/hearing more! =)
yay! experimentation succeed.
just to add on:
the idea is that third-party developers can implement this in their apps without any breaking codes. the api has always been official. if thumbnail doesn't exist, it returns a null. so, a dev simply has to write a code that checks for this property and carry out 'instructions' based on the availability of the thumbnail.
implications:
what we learn is that the reason they disabled the code is to prevent wasteage of resource (CPU and Mem) as the thumbnail code runs everytime the onPause of an activity is performed. This means that enabling it may or may not cause slowness in the system. Conclusion? Need extensive testing.
wow this is great news looking forward to seeing cards like on web os
the wonders of Android!
Pretty cool stuff. Perhaps you can make it so only if the app is running is that variable on and generating thumbnails ? Regardless cant wait for what developers do with this, im sensing the app taskos with live thumbnails it already has the fling up to end task.
Also to prevent this from being rom specific, maybe you could compare the hexcodes of 2 framework-res.apk's one with uncommented and one without, that way it could be added to any existing rom ?
Daneshm90: This has to be baksmali/smali-ed in.. ^^
Cyanogen Please Put this in you next ROM! Android is just awesome! thanks for the post!
Daneshm90: This has to be baksmali/smali-ed in.. ^^
Click to expand...
Click to collapse
Is that even possible ? it doesnt have a classes.dex (Nvm, u have to push the classes.dex of framework.jar into framework-res and decompile)
can u give me a modded and unmodded framework-res ? just wanna do some digging
Wow this has great potential!
I agree is this became stable Activity closer and switcher in the format + ADW + cyan or any other great developer + froyo = greatness
The bitmap can be used to make rotation and other screen changes faster. Load the bitmap before you load the real screen. This could be very important.
lsim001 said:
The bitmap can be used to make rotation and other screen changes faster. Load the bitmap before you load the real screen. This could be very important.
Click to expand...
Click to collapse
Thats actually true. The iPhone OS takes a screenshot of each app on exit, and then when you open it again it displays that screenshot until the activity is fully loaded. Could be implemented as such on Android too, but would take a lot of back end work.
Also, theres one thing I'm worried about. Since it takes a screenie on every OnPause of the activity, how will you stop it from displaying a "card" for every activity of an application. I mean for instance my game has 3 activities, one for each the play surface, the start screen, and the score screen, wouldn't I see a "card" for each of those the way this is now?
Sounds like that was put in to future proof the OS.
At the time it was probably too gpu reliant, and they decided to forego it.
Hello!
Please excuse my ignorance, but I have a few questions.
I am the developper of TaskOS and this feature is what I'm looking for months in my application.
Si, if I understand well this topic, the linecode to add must be done by ROM's developpers, is it true?
I really would like to have a list of compatible ROM's or please tell me if I am totally misunderstanding what you say.
Profete162
Profete, I don't think that any ROMs have this yet because it has just been discovered.
Je crois qu'il n'y a pas de ROMs qui utilisent ce code car il vien d'etre decouvert
Hi all, by uncommenting the line, you can then simply refer to the official API (oddly), and all the methods will work instead of returning null (for thumbnails). Check it out here: http://developer.android.com/reference/android/app/ActivityManager.RunningTaskInfo.html
According to Fede (developer of LauncherPro), the thumbnail resolution is 84dip by 63dip .
profete162: As of now, I doubt any ROMs include this. Hit me up on Twitter @Wysie_Soh !
profete162 said:
Hello!
Please excuse my ignorance, but I have a few questions.
I am the developper of TaskOS and this feature is what I'm looking for months in my application.
Si, if I understand well this topic, the linecode to add must be done by ROM's developpers, is it true?
I really would like to have a list of compatible ROM's or please tell me if I am totally misunderstanding what you say.
Profete162
Click to expand...
Click to collapse
this is at discussion stage currently and the first post is just my prototype to show it works.
basically, the current plan is to improvise the code to:
1. higher resolution + optimization (perhaps: a bit sensitive issue)
2. orientation detection (discussed with Fede on twitter, it's quite simple)
3. incorporate in custom rom (e.g. cyanogenmod)
...if you're using CyanogenMod, get in touch with Wysie to get his framework or .. you can compile yourself to test it.
i don't have my N1 with me right now and hence can't develop this any further than now. *irritated*
Any further developments with this, guys?
gee
gee willickers!

[Q] Samsung 9 Patches

Has anyone else noticed all of the .9 files in Samsung's APKs that are _not_ valid 9patch images? box_launcher_bottom.9 or box_launcher_top_normal.9 for example.
If you try to replace them, they stop working as 9patches, causing busted images in the UI. If you put the _exact_ same file back in, they are fine.
Anyone know what might be causing this? I am going to create proper 9patch files for a few and see if those work...
BitVenom said:
Has anyone else noticed all of the .9 files in Samsung's APKs that are _not_ valid 9patch images? box_launcher_bottom.9 or box_launcher_top_normal.9 for example.
If you try to replace them, they stop working as 9patches, causing busted images in the UI. If you put the _exact_ same file back in, they are fine.
Anyone know what might be causing this? I am going to create proper 9patch files for a few and see if those work...
Click to expand...
Click to collapse
I havent had a problem replacing them, its editing the image that gives me trouble... I have to use a totally different image..
I am not sure what you mean? Replacing? As in, with something similar? And you have an image issue... as in you want an entirely different style of skin? What have you replaced them with that worked?
If I replace the .9.png with an image of similar size it is fine... If I take the .9.png and lets say, make it more opaque/transparent or change the rgb ratios, then the image breaks and shows up funny...
junkdruggler said:
If I replace the .9.png with an image of similar size it is fine... If I take the .9.png and lets say, make it more opaque/transparent or change the rgb ratios, then the image breaks and shows up funny...
Click to expand...
Click to collapse
Still confused. Do you create your own .9.png's from scratch? Do you just use a regular png of the same size? I've been reading up on these .9's and I know that I can now make some morphs but it is going to be a lot more work than I thought unless there is some trick you know to create them.
yeah ive just used regular pngs... whatever I could find lying around my 16gb of theming stuff on my sdcard...
Not everything just works, Ive found problems along the way... I use ninja morph to test out my stuff before flashing with MM so I have less trouble finding out what doesnt work...
Making .9 files is not hard, at all. But then again I do Android dev as part of my job I am just curious if anyone knows how Samsung is able to use _bad_ .9 files (no marked-up edges) and still have them show up correctly. No big deal, I can figure it out myself I guess.
BitVenom said:
Making .9 files is not hard, at all. But then again I do Android dev as part of my job I am just curious if anyone knows how Samsung is able to use _bad_ .9 files (no marked-up edges) and still have them show up correctly. No big deal, I can figure it out myself I guess.
Click to expand...
Click to collapse
Could you explain how to make them? I tried using regular png's with no luck. The file names don't match so they won't get replaced properly. I can't edit existing ones and make them work. I guess I have to make my own from scratch but I don't really get how. If I can figure this out I'll be theming like crazy. (which may not be a good thing for all the other things I need to get done)
There are a few places online that explain them. I will let you google for that info/guides (I am at work right now). I will say however that there's a tool in the SDK (if you build it) called draw9patch that creates a little tool to show you how they look stretched different ways, and lets you edit them, very handy.
As for the 'rules'. It's easy. The left & top edges of a .9 file (1 pixel) define where the image will stretch. If you place a black dot in the left-x, center-y pixel of the image, it will stretch that row if the image needs to be bigger. The rest of the image will not be stretched. The same goes for the top. You can place extra pixels to expand the area stretched, or even make more than 1 area that stretches (my notification bar skin will show how that's done).
The right/bottom edges use the same mechanism (1 pixel row/column) but they define a box on the image that _content_ inside the image will fit into. You can see this if you go find some 'edit box' skins. The black dots on the bottom/right are placed where the edit box's internals are relative. Unlike left/top, you _can't_ have more than 1 section per side.
Using draw9patch it is _very_ easy to play with. If I get some time I will upload some examples, maybe with my next morph (an extension of the diamond-plated steel look I did for the launcher in some other threads).
BitVenom said:
Making .9 files is not hard, at all. But then again I do Android dev as part of my job I am just curious if anyone knows how Samsung is able to use _bad_ .9 files (no marked-up edges) and still have them show up correctly. No big deal, I can figure it out myself I guess.
Click to expand...
Click to collapse
I'm not really sure what your getting at by "_bad_ .9" but if an image is sized correctly, it doesn't need guidelines.
Perfect example is this image:
which has no guidelines whatsoever
maybe you could upload an example?
Yeah I've just renamed regular .png files with no prob 90 percent of the time..
Sent from my SGH-T959 using XDA App
one thing you could also try doing is using apktool and decompiling the apk with the 9.png's you are trying to replace. apktool decodes them and shows the patches.
Well I tried using the draw9 tool. Very simple and easy to see what is happening. I modified a bunch of the Mms .9.pngs (on a mac?) with photoshop, saved, opened with draw9 to add the stretching, saved them and made a morph. When applied it only changed some of my images and the ones that changed won't stretch properly so the text extends outside the image.
I ONLY replaced images but something got screwed up. My text messages started showing coming from the wrong people, and I would reply to one person and the text would go to someone else. Not good. Tried to use the revert I had created and it fixed the graphics but not the other sending/receiving problem. Lucky I had a backup so I'm flashing back to that now.
I'm sure I'm making some stupid error, oh well I'll figure it out eventually.
Gahhhh!!!
Well, after digging around, and not being able to determine why my own changes to .9 files were causing issues, I found it: If I use _apktool_, I get a proper .9.png, and it looks great. If I just unzip the apk, I get the old png, still valid, but without it's outer-edges that are used for .9 markup. What-The-F? Really. So does the damned thing have 2 versions of the file in it? A PNG is compressed, it shouldn't be possible to create a version minus the outline without tons of trouble. Where is that data being hidden? If I put mine in place, will it just blow it all up?
I am going to give it a shot, see what happens.
Putting the 'proper' .9 that apktool created back into the morph and loading it results in something that is _better_, but still rather broken. Somehow the 'patches' from the .9 file are being applied over the .9 itself. There must be something about .apk that encoded extra data in a side-channel of some sort. I wonder if anyone here knows who to ask? I am a very capable programmer, and happy to write/transplant code to get a reliable .9 path for odd .apk variants (as I understand Samsung's is new/custom)... ?
Info I just found: http://code.google.com/p/android-apktool/issues/detail?id=2
So apktool will decode from binary to source. Now I just need to get a path back to binary, and I think it'll fly...
Hrm, I found the Froyo code that de-serializes a PNG and checks for 9patch, as well as the code to save one back out with 9patch info. I need to determine why the 'source' 9patch minus hidden binary data is not acceptable to the Vibrant. It should be, all of this code reinforces that. I feel like I am _suuuuuuper_ close to having this work.
Well, I need to write a tool (maybe after next week) to do the heavy lifting... but hand pushing the 'custom' PNG chunk from a valid .9 onto a processed one results in a valid .9. You have to know the PNG format (and be handy with a Hex editor), and since you are stealing data from another image, hopefully didn't edit the size/split areas too much. I know google's format too, so hand-editing the custom chunk data to move around the black-bars (virtually) isn't too bad. But again, a tool that just takes .9.pngs with visible borders and encodes them (and removes the _massive_ waste of RAM that is the Photoshop chunks.. wow), and is able to do the opposite will likely help all theme modders out there. I will update the head of this post once the tool is complete.
As an aside, even after getting a working file (my folders now have black, not grey backgrounds) - I still have a grey box in the center... and that is _not_ in the image. Very, very odd. I will track that down too... probably just some layout courtesy of Samsung.
Noon Sunday - Ah, got the grey-box too. I _think_ a simple 'encode 9patch' tool already exists, will test the process and report back. But I have fully custom graphics now that look excellent.
Just added: https://code.google.com/p/android-apktool/issues/detail?id=92
Also I'll add wiki page about 9patch images, cause many people don't understand them and they don't know, what to do. They're WTFing, as you did above ;-)
Thanks!
Brut sir Being a long time hobby-hacker... the chase was as valuable for me as the catch... but I definitely appreciate somebody else making it work first
9Patches are easy now, and one of the most powerful elements that Android UI utilizes too!
Ok, I think you understand 9patch images already, but I wrote an art with explanation:
https://code.google.com/p/android-apktool/wiki/9PatchImages
Brut.all said:
Ok, I think you understand 9patch images already, but I wrote an art with explanation:
https://code.google.com/p/android-apktool/wiki/9PatchImages
Click to expand...
Click to collapse
Thanks for that. I'm going to be giving these 9patches another try.

[Q] Editing Project-V Lockscreen

I would like to edit the "Android unlock" lockscreen that is included with Project-V, I have found the smali file (LockScreen.smali in android.policy.jar) that I believe contains the code for elements I want to remove, but I have zero java coding experience.
I want to remove the next alarm and battery charging notifications that show below the clock on the AOSP lockscreen.
Can anyone help? Or point me to some resources/guides for learning the language?
No expert here or anything but I would think that would be a smali file somewhere in android.policy.jar and not xml.
Sent from my GT-I9000
jneal9 said:
No expert here or anything but I would think that would be a smali file somewhere in android.policy.jar and not xml.
Sent from my GT-I9000
Click to expand...
Click to collapse
Ya, I have started looking in there, but so far I'm not finding anything
Yeah smali is pretty low level java and tough to understand. Maybe try and PM Romanbb. He seems be very good with java.
Have you had any luck with this? I want to do pretty much the same thing, except I want to keep the alarm details. I know a bit about Java but lockscreen.smali just gives me a headache..
Ticklefish said:
Have you had any luck with this? I want to do pretty much the same thing, except I want to keep the alarm details. I know a bit about Java but lockscreen.smali just gives me a headache..
Click to expand...
Click to collapse
Here's what Roman said:
"Removing them via smali will be a huge pain. They are defined an XML layout file in framework-res.apk, you could try and modify them to shove them off the screen, or make the dimensions small enough to where it's not visible. Don't try and remove it from the XML file though, it'll throw smali errors."
WidgetLocker is fulfilling my needs.
Ah, well..I suppose it depends on how much of a stubborn nerd you are.
I've tried WidgetLocker and it does seem to be a decent app, but it's not for me. I started out wanting to modify the stock lockscreen and, dammit, I'm going to do it. I've done some fiddling with the smali code and I've got a pretty good idea what to do, I just need some free time in which to do it.
Free time? Around Christmas? Nah..
Thanks for your tip about removing them from the layout files. This was the first thing I tried and I ended up with all sorts of errors once I'd pushed the framework back to the phone.

The order of the camera images viewer is reversed

I'm using CM 11.
After taking a photo, there's an option to slide the finger and view the images (and the other images taken by the camera).
In my case, for some reason, the order is reversed! It shows the first image ever taken first, I have to slide thousands of images to get to the new image.
Any solution?
Thank you
Any idea?
guyman20 said:
I'm using CM 11.
After taking a photo, there's an option to slide the finger and view the images (and the other images taken by the camera).
In my case, for some reason, the order is reversed! It shows the first image ever taken first, I have to slide thousands of images to get to the new image.
Any solution?
Thank you
Click to expand...
Click to collapse
there would be an option in galarry to sort the images modify the setting to name or date
bhavstech said:
there would be an option in galarry to sort the images modify the setting to name or date
Click to expand...
Click to collapse
There is no option of "sort by", there is "group by" which creates annoying folders according to time periods, which isn't what I wanted..
guyman20 said:
There is no option of "sort by", there is "group by" which creates annoying folders according to time periods, which isn't what I wanted..
Click to expand...
Click to collapse
there is option gallary>camera>groupby
bhavstech said:
there is option gallary>camera>groupby
Click to expand...
Click to collapse
That's what I said, there is only "group by", which isn't the same as "sort as".
I don't want it to be grouped into days. I want to see everything spread sorted by time.
It is indeed sorted by time, but in the reverse order..
guyman20 said:
That's what I said, there is only "group by", which isn't the same as "sort as".
I don't want it to be grouped into days. I want to see everything spread sorted by time.
It is indeed sorted by time, but in the reverse order..
Click to expand...
Click to collapse
use gallery kitkat from playstore
Well it does work, but I really want to use a stock app from a trusted source, and not an external paid app.
I'm sure there's a solution to this bug..
guyman20 said:
Well it does work, but I really want to use a stock app from a trusted source, and not an external paid app.
I'm sure there's a solution to this bug..
Click to expand...
Click to collapse
Hmm a stock app from a trusted source huh? If you can learn a lil Java and some minor hacking skills you can always decompile the camera app you "trust" and hunt for the code where the sort operation takes place which I expect to be done by an object of a small private or public class that implements comparator, for reversing the sort it would be a single line of code like comparator.reverse( theArrayListofpics); also it could be totally different simpler or complex code depending on the app, or you can avoid all the above pain in the ass and use a not-so-stock 3rd party apps like Focal by one of the CM devs.
Sent from my GT-I9100 using Tapatalk

Using xposed to test variables

I plan on trying this myself, I've been looking at rovos tutorial on making xposed modfules (although I don't know java this seems like a simple to do I could probably figure it out) However in the tutorial rovo says, "so the cleanest way to change it would be to change the appearance definition. However, the this is not possible to change styles with the Xposed framework and probably won't be (it's too deep in native code). " I was thinking using xposed it would be pretty easy to dynimically load all declared variables in given file, then just insert code that changes the value. That way you can easily test what each variable does in a file ("I'm thinking specifically of a file called color.xml which only contains color values located within framework-res.apk) Is this not possible with xposed. Could you not inject code after each retrieved variable to just change the value?
I haven't used c++ in a few years so I'm a little rusty, but now I'm thinking I could just make a program that reads the xml as text and changes all hex values to the color pink of a defined number of lines (eg 1-10) then automatically generates a flashable zip. For the purpose of making it easier to figure out what changes what via trial and error. Will probably take me a while to get around to it.

Categories

Resources