Jump to content

AnDE - Android Design Editor


Guest BigBearMDC
 Share

Recommended Posts

Okay, works now.

But theres still the chance that Random generates the same number 2 times...

well... 1:99999999 ... but anyway :D

Greetings,

BigBear

can you generate a timestamp to do it? It would order backups and would be totally unique. If you want to use the unix timestamp, as is fairly generic across platforms, it ususally works in .net as so:

static double ConvertToUnixTimestamp(DateTime date)

{

	DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);

	TimeSpan diff = date - origin;

	return Math.Floor(diff.TotalSeconds);

}

Edited by Bakes
Link to comment
Share on other sites

can you generate a timestamp to do it? It would order backups and would be totally unique. If you want to use the unix timestamp, as is fairly generic across platforms, it ususally works in .net as so:

static double ConvertToUnixTimestamp(DateTime date)
{
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
TimeSpan diff = date - origin;
return Math.Floor(diff.TotalSeconds);
}[/code]

Files are now sored in this format:

filename_Day-Month-Year-Hour-Minute-Second_old.apk

:D

Greetings,

BigBear

Edited by BigBearMDC
Link to comment
Share on other sites

once iv replaced all the files i need and iv repacked it into a zip file again what can i use to sign it as it wont install onto to the phone without being verified

Link to comment
Share on other sites

once iv replaced all the files i need and iv repacked it into a zip file again what can i use to sign it as it wont install onto to the phone without being verified

I think you don't need to sign it.

But I'm not sure...

Greetings,

BigBear

Link to comment
Share on other sites

yeah when i try n flash it on to my pulse it says it needs signing =/ is there a way of editing without unpacking the zip ?

I do not extract the archive.

I'll try to add an autosign fearure :-)

Greetings,

BigBear

Link to comment
Share on other sites

cheers :D how do you to it without extracting ?

i create a ZipFile object and a ZipEntry object (both from the .dll)

I extract the archive to a folder named "*archivename*_temp".

From that folder i build the directory tree. You can now browse

the unpacked content of the archive. If you have chosen a file to

replace, add it to the queue and process the queue, i create a new

ZipFile named newFramework:

newFramework = new ZipFile(File.Open("" + archPath + "" + archName + "." + archType, FileMode.Open));
Next, i create a ZipEntry - named fileToReplace - which represents a file in the archive plus its path:
fileToReplace = new ZipEntry(str.Substring(str.LastIndexOf(" -> ") + 4));
...
str.Substring(str.LastIndexOf(" -> ") + 4)
... is just the path to the file in the archive. What i do then is to delete the ZipEntry from the archive and append the new file:
fileToReplace = new ZipEntry(str.Substring(str.LastIndexOf(" -> ") + 4));
newFramework.BeginUpdate();
newFramework.Delete(fileToReplace);
newFramework.CommitUpdate();
output.AddOutput("Removed \"" + fileToReplace.Name + "\" from Archive", true);
newFramework.BeginUpdate();
newFramework.Add(str.Substring(0, (str.LastIndexOf(" -> ") + 1)), fileToReplace.Name);
newFramework.CommitUpdate();[/code]

So i extract the archive to get the folder tree, make an ZipEntry

with the file and the path i want to replace, and then delete the file

directly from the archive without unpacking it, and I add another file

the same way.

So I only extract the archive to make it easier to browse it's content.

I could manage to build the folder tree without extracting the archive,

but I think thats not necessary for the moment. Also this makes it

easier to get the Image files out of the archive I think :D

Greetings,

BigBear

Edited by BigBearMDC
Link to comment
Share on other sites

  • 1 month later...
Hi gyus

I'm very proud to present you the new version of AnDE.

AnDE 2.1.3

It has really many improvements!

It's for example now possible to place files, with which you want to replace images in the framework, in a seperate folder.

AnDE then automatically replaces the files in the archive with the files from the folder :)

Of course the files in that folder must have the same names that the files in the archive have ;)

Also, I fixed the crash-bug that sometimes happened when you quit AnDE.

Current Version: 2.1.3

Requirements:

.NET Framework 3.5

Screenshot:

70670e4441.png

________________________________________________________________________________

_

Manual

AnDE is an application, that is able to replace files from ZIP - Archives.

*.apk files are ZIP - Archives that store additional information.

So its possible to replace files in the archive using a ZIP - Library for C# - thats what I did.

There are 3 ways to replace files int the *.apk archive:

- Manual Replacement

- Automatic Replacement

- both

Whichever you want to use, you have to load an archive first:

Click on "File" -> "Open Archive"

AnDE the unpacks the archive and stores the files in a directory that has the same

name that the archive has + "_temp". If this directory already exists when you open

an archive, you will have to delete it (or at least rename it). Once that is done,

You'll see a directory tree in the white box on the left side called "Archive Content".

If you check "Show PNG's only", you will only see *.png file in "Archive Content".

If you uncheck it, you will see all files. You can expand the directorys in the directory

tree by clicking on the '+' Symbol. A expanded directory will collaps if you click on the

'-' Symbol. Now you can choose a file by just clicking on it. If you choose an *.png file,

the image will appear in the left picture frame named "Selected File". Here's the point

where i want to mention that you can replace all files in the Archive, not only *.png

files. Anyway, once you have chosen a file that you want to replace, you can continue.

From now you can choose on of the free ways.

I'll start with

Manual Replacement

Once you have loaded a file you want to replace, click on "Open File".

A window will appear that lets you choose a replacement file. If you choose a *.png file,

it will show up in the picture frame named "Replace with". Next, click on "Add to Queue".

In the "Queue" window beside tha main AnDE window an item will be added. Now the file

is added to the queue. You can delete files from the queue by clicking on one item and

pressing the "Delete" key on your keyboard. When you added all the files you want to the

queue, click on "Process Queue". AnDE creates a backup of the archive file you opened

named "archive + _old". If this file already exists, you will be asked to delete it. If you

don't want to delete it just click "No" and Ande will add a randomly generated number

to the name of the archive. As an example, if your original file's name is "archive-a.apk",

the backup could be called "archive-a_12345_old.apk". After that the files in the archive

get replaced and thats it ;)

Automatic Replacement

Once you loaded the archive, click on "Choose Folder". A window will appear that lets

you choose a folder. Copy all replacement files into this folder. The files must have

the same name that the files from the archive have, which you want to replace. As an example

there is a file called "a.png" in the archive, then the folder must also contain a file called "a.png".

If there's only a file called "b.png", nothing will be replaced. Its not necessary to keep the folder

structure of the archive. As an example if you want to replace the files "a.png" and "folder_b\b.png"

of the archive, you can just copy "a.png" and "b.png" into the replacement folder. AnDE automatically

searches the files in the archive and adds them to the queue, if the file names match. Once thats

done, click on "Process Queue". If you want to replace many files (I tried it with ~700), AnDE

might look like it freezes and windows might tell you "Not Responding", but thats normal.

Both

You can also combine this two methods :P

Additional Information

If you click on a picture frame while a picture is loaded, a window will show up, showing you the

picture in original size.

You can hide and undock the Queue and Output windows if you click on "View".

The whole application has ~700 lines of code and is fully written in C# using .NET framework 3.5.

________________________________________________________________________________

_

For updates an never versions, just have a look at this thread :P

Have Fun!

PS: please report your bugs and send me a PM with them.

Greetings,

BigBear

I USE THIS TOOL TO CHANGE \framework-res\assets\images\android-logo-mask.png AND android-logo-shine.png,THE OLD android-logo-mask.png SIZE IS 128X280,THE OLD android-logo-shine.png SIZE IS 256X280,THE NEW android-logo-mask.png SIZE IS 320X480,THE NEW android-logo-shine.png SIZE IS 640X480,AFTER I REPLACE THE TWO FILES ,I CAN'T BOOT MY G2 MAGIC,CAN YOU TELL ME WHY?THANKS!

Files.rar

Link to comment
Share on other sites

I USE THIS TOOL TO CHANGE \framework-res\assets\images\android-logo-mask.png AND android-logo-shine.png,THE OLD android-logo-mask.png SIZE IS 128X280,THE OLD android-logo-shine.png SIZE IS 256X280,THE NEW android-logo-mask.png SIZE IS 320X480,THE NEW android-logo-shine.png SIZE IS 640X480,AFTER I REPLACE THE TWO FILES ,I CAN'T BOOT MY G2 MAGIC,CAN YOU TELL ME WHY?THANKS!

Youll have to resign the apk files.

Look for 'AndroidSign'.

PS: You should not change the resolution of the images.

This could also cause a crash. Also, try to keep the file size as small as possible.

Greetings,

BigBear

Edited by BigBearMDC
Link to comment
Share on other sites

  • 6 months later...
  • 3 weeks later...
  • 4 weeks later...

I would like to ask for a new feature if you could do it: resizing images.

I really want to port "themes" from other DPI ROMs, like from Galaxy S to the G1. But what makes it hard to manually resize all the images.

I have the formula to count the new sizes too:

targetX = originalX * (targetWidth/originalWidth)

targetY = originalY * (targetHeight/originalHeight)

Link to comment
Share on other sites

  • 4 weeks later...
  • 4 weeks later...
  • 3 weeks later...
I would like to ask for a new feature if you could do it: resizing images.

I really want to port "themes" from other DPI ROMs, like from Galaxy S to the G1. But what makes it hard to manually resize all the images.

I have the formula to count the new sizes too:

targetX = originalX * (targetWidth/originalWidth)

targetY = originalY * (targetHeight/originalHeight)

You could make an action in photoshop and run it for all the images you like, its pretty simple

Link to comment
Share on other sites

  • 10 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.