yashsingh1/xdaforums huggingface dataset:
[Android Software Development] sga999:
For the first issue, you're talking about new options for non system apks (option 12). I was working with SystemUI.apk and option 11 for SYSTEM apks. Answering y for this system apk, I could accomplish what I wanted. But just because I'm trying to understand all of this, I also tried the n answer.

When I picked that n answer, my SystemUI.apk had problems (missing bars). Then I figured out that it was because only META-INF had been used from the original, and the new AndroidManifest.xml was used. Maybe it can be made clear that the n answer uses only the META-INF from the original?. In the absence of any options to pick when answering n, I thought maybe both META-INF AND AndroidManifest could be included from the original by just adding that extra line that I mentioned. But maybe it would be best to add an option under the n answer that allows us to either to pick the old META-INF, or or the old AndroidManifest.xml, or both?

Again, I do realize that what I want for system apks can be accomplished by using the y answer instead. But I was trying to get the n answer to work also, and I couldn't do that without making changes to your script.

All of your new choices (6 in total as shown above) for non system apks sound fine to me. I haven't done much with that part of your script yet, so I really wasn't questioning that part yet. You certainly can add the extra options to make it more robust.

Now, onto your next ideas about a prompt for modifying files. I was mostly wanting some tip that it was time to change things (similar to how you prompt us to change the keep folder), either after the decompile or before the compile step. Your fix goes further and actually will open the folder. That would be good, I think. But where would you insert these lines? After compile or before decompile? Decompile happens in 9 and 10, while compile happens in 11, 12, and 15. Maybe it makes more sense before the compile steps. Someone may decompile, just to look at the output, but they may not want to see this extra prompt about modifying anything.

Thanks for listening to my requests.
[Android Software Development] officiallyme:
i'm sorry for the noobish question, but could someone tell me how to use this tool with rootbox? rootbox is cm based.

i used to use samsung stock and simply copied the framework-res.apk and the twframework ane everything was fine.

but with rootbox i can't fet it to work.

which framework do i need? is there one that works? rootbox is running android 4.2.2

hope some can help me out :)
[Android Software Development] iamareebjamal:
Hi guys

This problem is out of my reach and I think it's related to corrupted .9.png files

I tried apktool too but no luck, should I let apktool use its framework to decompile it instead of using the framework-res.apk of this ROM(I am currently doing it)

But, How can I fix it?

Thanks in advance

~/Desktop > java -jar apktool.jar d SystemUI.apk SystemUI
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/d/apktool/framework/1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Coordinate out of bounds!
at sun.awt.image.ByteInterleavedRaster.setDataElements(Unknown Source)
at java.awt.image.BufferedImage.setRGB(Unknown Source)
at brut.androlib.res.decoder.Res9patchStreamDecoder.drawVLine(Res9patchStreamDecoder.java:99)
at brut.androlib.res.decoder.Res9patchStreamDecoder.decode(Res9patchStreamDecoder.java:58)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:107)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:73)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:238)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
[Android Software Development] raziel23x:
I was just given you some examples of what I could do in can modify the no answer for system compile to prompt for if you want the original manifest as well.

as for placement for the lines of code they can be place just about anywhere so long as there location is defined in the script after the prompt
[Android Software Development] sga999:
Okay, good. For the system apk compile, for the n answer, it would be nice to prompt for whether we want the original manifest included instead of the new.

I think we're on a different wavelength about a prompt to "remind" me to modify the sources in projects! I know these lines can be put anywhere in the script. But I'm trying to find the appropriate place where we can be reminded this editing now needs to be done. I mean, I might do step 9 to decompile, and then without a "reminder" to go make changes to the decompiled sources, I might do step 11 to recompile. In fact, I've made this mistake several times! I've actually forgotten to go the edits, just because there's no prompt to tell me to do that. (So I decided to add a line in the system apk section, right after the decompile was done. But that was just handling the system apk case).

This is just a "reminder" type of thing, just like when you tell us to go delete stuff out of keep. It needs to either be right at the end of the decompile step, or right at the start of the compile step. That's why I was mentioned how many places you do decompiles and compiles (9 and 10 for decompile, 11, 12, and 15 for compile). I guess you could make it a completely different step with a different number, but that kind of defeats the whole purpose. That would mean I had to remember to go do that extra step in between the decompile and compile!

I don't mean to make this a big deal. I can certainly put a prompt into the script myself to remind me to go make the edits. Anyway, I hope I've made my self clear, but let me know if you don't understand me.
[Android Software Development] sga999:
Minor nit. '6' is missing from in front of the "Install APK" choice. "occured" should be "occurred". I know spelling isn't a priority here, so only fix them if you feel like it!
[Android Software Development] officiallyme:
anybody?
[Android Software Development] raziel23x:
no clue what rootbox to even tell you
[Android Software Development] iamareebjamal:
^

Anybody knows about this problem
[Android Software Development] officiallyme:
cm? anything that'll work with cyanogenmod will do :)
[Android Software Development] raziel23x:
Check out my last two commits on the experimental build.

I have added the options that we talked about to both the System Files and NON system Files when compiling them to add in the original AndroidManifest.xml

Next I am working on adding in that other feature we talked about with the with reminding to edit the project I Am just trying to think of the best way to word it right now and how I want to implement it correctly
[Android Software Development] raziel23x:
I added the new feature that will allow you to open the projects after decompiling them
[Android Software Development] sga999:
Script.bat now just exits for me right after I reply to the prompt about opening the projects folder (you have 'project', but it should be 'projects'. Also, you need a 'g' on the end of 'editin').

I won't have time to test more for several hours, so maybe I'm doing something wrong. But it looks like START "%~dp0projects/%capp%" is not doing what you expect.
[Android Software Development] raziel23x:
I will fix when I get home right now at Chuckecheese with my 4 year old son
[Android Software Development] raziel23x:
fixed it
[Android Software Development] sga999:
Thanks! I think the prompt might be better like this:

ECHO %capp% has finished decompiling. Would you like to open the projects\%capp% folder to begin editing?

Also, I like it better without CLS before that prompt. Then I'd be able to see my prior decompile step (9 or 10)...it just helps me keep track of what's going on. In fact, I don't quite understand why all the CLS commands are there. It seems like it would all just scroll nicely without those, and we could go back and see what we've done. With all the CLS, we can't go back. As usual, this isn't important, but it's just my personal preference.

I haven't tried the new options under y and n yet, but I'll be doing that tonight or tomorrow. Thanks for those changes.

As I said before, spelling isn't a priority here, but if you'd like me to go through and fix the errors, I'd be glad to. I could attach it here later if you want. Of course, right now I'm only looking at the experimental Script.bat, but I could do others if you're interested.

EDIT: I changed the ECHO line above to have projects\%capp%, i.e. back slash instead of forward slash. Not important since it's just a prompt, but I'm trying to be accurate.

---------- Post added at 05:49 PM ---------- Previous post was at 05:13 PM ----------

In the new stuff about copying AndroidManifest.xml, you have this. It should be INPUT1 in the first line.

set /P INPUT3=Type input: %=%

IF %INPUT1%==y (call :syscom04)

IF %INPUT1%==n (call :syscom05)

This line should have 'system' instead of 'unsigned', I think.

7za a -tzip "%~dp0place-apk-here-for-signing/unsigned%capp%" "%~dp0projects/temp/AndroidManifest.xml" -mx%usrc% -r
[Android Software Development] sga999:
Someone asked about .jar files way back in post #553. I'm not sure if that person ever found an answer.

I put a .jar file in the 'for-modding' folder, but if I use option 9 to decompile, an error occurs. If I rename the .jar to .apk, it will decompile it. I see lines in the script in option 27 for "Set Current Project", and they seem to have something to do with setting jar=1. But I really don't understand what that's all about.

So am I supposed to be able to decompile (and subsequently recompile) a .jar file without renaming it to an apk file first?
[Android Software Development] raziel23x:
yea there is a bug with jar files I have not gotten around to spend time to trouble shooting that section but our is on the Todo list
[Android Software Development] officiallyme:
i have to say, i really enjoyed using apk multitool to mod my apps while i was running samsung stock rom.

but i am really, really surprised that no one using a costum rom is modding apks :eek:
[Android Software Development] raziel23x:
Finished trouble shooting and added support for jar files being able to decompiled and to recompile with the changes
[Android Software Development] raziel23x:
Moved where system files are located after compiling and fixed the install system files scripts to match this new location

Still working on a way to fix the other issues with the scripts that have been reported please keep the bug reports coming and please give some detail as to why it failed.

Just saying a feature will not work does not tell me anything

I need logs and hell if you have access to Github and know how to fix a bug feel free to fork the repo select the experimental branch and add your fixes then do a pull request I will review it then will merge it if it works
[Android Software Development] bovirus:
Using last stable version, using option 13 (Sign APK) apepar an error and the log report4d that jarsigner is not recognized as command.

Is Jarsigner part of JDK? Have I install it?

With previous stable version (that has simple 13. Sign APK (without Google Android Amrket ID) it worked (without JDK).
[Android Software Development] raziel23x:
it needs to have the jdk installed
[Android Software Development] raziel23x:
I updated the experimental build to Better explain that it requires the JDK in the menu main screen. also when selecting the Option it will also prompt you to make sure to set up the environmental variable or else it will not function.

I originally tried to package the needed files but the jar signer depends on the entire jdk to function for some odd reason.
[Android Software Development] Megatron007:
during decompiling of apk. it gives some error even tough i have install java jdk & jre latest version wat should i do?
[Android Software Development] raziel23x:
can you copy past from the log file that error I can see the image from my phone
[Android Software Development] Megatron007:
:confused:
[Android Software Development] raziel23x:
are you using the latest experimental builds from today?
[Android Software Development] Megatron007:
yess n my os in win 8
[Android Software Development] elol:
Someone help me,I can't decomplie system UI jellybean 4.1 for stock Rom sense...but I success decomplie and complie framework-res.app for sense Rom jellybean 4.1...any idea for solution???
[Android Software Development] raziel23x:
I have tested this on my win 8 pro 64bit and I cannot reproduce your error report
[Android Software Development] raziel23x:
error report please
[Android Software Development] sga999:
I tried a JAR file, and it works, but I have a couple of questions/suggestions.

Do you want to say something about JAR files, maybe at the top of the menu? Maybe something like "JAR files are decompiled/compiled similar to system apks".

For a JAR file, do you want to omit the question about AndroidManifest being copied from the original? I'm saying this based on what someone said on VTS thread a couple of days ago. Here's what they said:

"Jar files never contain AndroidManifest.xml, mostly they are bootclasspath elements. AndroidManifest.xml is only meant for apk files which does work to declare permissions, intents the app uses."

(You don't really need to do this...I can always just say n when you ask the question, but it would make it neater).

Now, for system apks (or JAR files), now that you've put them in a separate "modified-system..." folder, I think it would be better not to prefix 'system' in front of the file name. Then if I want to push it with its actual name, I can answer n to your rename question, and I won't have to answer y and enter the actual file name. I mean, you can still ask if I want to rename, but most of the time, I won't need to.

Fix typos in this line, as shown in the 2nd line.

ECHO *Notice you need to go into your enviroment Variables and set the patch to your JAVA_HOME*

ECHO *Notice you need to go into your environment Variables and set the path to your JAVA_HOME*
[Android Software Development] raziel23x:
fixed the typo and did a few more tweaks to fix some other issues with setup.bat
[Android Software Development] sga999:
I don't see any changes in the experimental setup.bat. Are the changes only to the stable version?
[Android Software Development] raziel23x:
the changes are to batch files that are in the other folder which are only linked to the setup batch. I am still not done with the changes so right now the system full pull feature for installing the framework-res is broken. the install feature still works but the pulling of the system files for install is broken.

I am completely rewriting how it works and is going to integrate the pull feature into the actual install feature and improve detection and installation of dependencies.
[Android Software Development] sga999:
This is really strange. I'll keep looking but I don't see how this is happening. I'm doing step 9 to decompile. The java step works, but then it gets an error (see below). But 'opeproj' label is definitely in the script.bat! Here's what's in the log:

java version "1.7.0_17"

Java(TM) SE Runtime Environment (build 1.7.0_17-b02)

Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: C:\Users\sga1\apktool\framework\1.apk

I: Loaded.

I: Regular manifest package...

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

The system cannot find the batch label specified - opeproj

EDIT: I ran this exact same thing earlier today without a problem. So I think it must be some kind of "memory problem". I'll reboot the PC tomorrow and see if that changes things. But not tonight!
[Android Software Development] raziel23x:
Yea I checked the code and it is linked correctly and test pass so it has to be a memory issue.

I get though alot when massive edits happen but though are rare.

off the subject of this error how do you like the new splash screen when you first launch the application?
[Android Software Development] raziel23x:
Rewritten the system pull scripts to make dynamic installation of the dependencies more robust.
[Android Software Development] sga999:
My problem with the "missing opeproj label" still happened after rebooting the laptop. So I just moved that section of the script up to be right under the 'goto opeproj' (under the .de section of the script). It worked! I haven't seen this type of problem before.

I'm sorry that I don't notice anything about the splash screen. It doesn't look different to me, though I never really pay much attention...I'm just trying to get to the "guts" it! What changed from before?
[Android Software Development] raziel23x:
I replaced the large ascii image with a more clean look and given credit to My main testers and since you have been given a lot of insight and testing I added you to the list
[Android Software Development] sga999:
Well, it keeps getting weirder! If I edit your new script, I can see the new header (thanks for putting me there!). But when I run it, somehow it's running an older version. I thought I had a problem like this a week or so ago, but then I couldn't reproduce it. It's really strange because even when I bring up an entirely new command window, it still gets an older version. So strange!

I'll figure it out!
[Android Software Development] raziel23x:
that is strange. well I am off to chuckecheese with my son so maybe later tonight in willtake a look.
[Android Software Development] sga999:
Oh dear, the "running the old script problem" is something to do with how I extract your files. Do you really want a folder within the zip? I mean, usually when I click on a zip file in Windows Explorer, I see all the compressed files, and then I can "Extract all files". In this situation, that extract creates another folder with the same name. Then I go copy the new script.bat and paste it into my existing folder with all my previous files. I think I must be copying the wrong file sometimes, due to this duplicate named folder issue. Is it possible for you to zip it all so there's not that "extra" folder underneath the zip?

Obviously, you should not be required to do this change, just to fit my needs. But I'm still curious as to why you have that folder under the zip...I usually do not see zips built that way.

Even if I DO get your correct script.bat, the problem with 'opeproj' is still occurring. I can fix that by rearranging the lines of the script, but I'd rather not have to do that. No one else is having this issue? I don't have any idea how this could only occur for me....it's an ASUS laptop with Windows 7, and I don't have other script problems, though I admit that I don't run that many scripts.

EDIT: If I google this "cannot find the batch..." error, there are lots of things about it. Does this one about having to CALL instead of just executing programs or scripts.

http://stackoverflow.com/questions/...-system-cannot-find-the-batch-label-specified

OR...maybe this one which has that same solution but also talks about CRLF problems.

http://stackoverflow.com/questions/...tch-label-specified-is-thrown-even-if-label-e

If you google this problem, it goes on and on!
[Android Software Development] raziel23x:
the zip file is auto generated by Github so I have no control over how it is packaged. I could manually zip them and manually upload every time in do changes but I normally let just let Github do the work for me
[Android Software Development] sga999:
Okay, you answered while I was doing an edit. Don't worry if that's the way github does it....I'll have to do things the right way.

I have an EDIT in my prior post about the 'opeproj' problem.
[Android Software Development] raziel23x:
send me your changes as a attachment and I well as them when I get home
[Android Software Development] sga999:
You have "Private testes" in your header. Ha!

---------- Post added at 01:28 PM ---------- Previous post was at 01:25 PM ----------

My change was just to rearrange the script. But it sounds like the problem may reoccur at any time, due to other issues, so rearranging may just be a temporary fix. I'll certainly give you my modified way if you'd like, but it seems like there's an underlying problem that would be good to fix.

---------- Post added at 01:43 PM ---------- Previous post was at 01:28 PM ----------

I ran Unix2Dos on your script.bat, as one of those solutions from the Google search suggested. I no longer have the problem. I'm not suggesting that's the way for you to fix it, but maybe it's a hint. I never had this problem until getting a version yesterday? where you said you have made some changes about dependencies? So maybe it's not that Unix2Dos needs to be run on the entire file...maybe something in those lines messed it up?

Sorry for so many guesses here....I don't really have the answer for the best way, but rearranging probably isn't the best idea. If you do that, the problem will probably happen again "soon".
[Android Software Development] spyrosk:
[MENTION=2968938]raziel23x[/MENTION]

Thank you for this amazing tool.

Yesterday I used your latest stable release for the first time and I encountered the following problem.

Even If I delete resources.arsc from keep folder the newly systemxxxx.apk keeps the original resources.arsc

So I did some digging in script.bat and found out that when re-zipping the resources.arsc with no compression, the script is extracting the file from the original apk to temp folder instead from the new systemxxxx.apk.

I fixed it by changing line 659 under :nq2 label like this:

original

7za a -tzip "../place-apk-here-for-modding/system%capp%" "../keep/*" -mx%usrc% -r
rmdir /S /Q "%~dp0keep"
7za x -o"../projects/temp" "../place-apk-here-for-modding/%capp%" resources.arsc -r
7za a -tzip "../place-apk-here-for-modding/system%capp%" "../projects/temp/resources.arsc" -mx%resusrc% -r
rmdir /S /Q "%~dp0projects/temp"

modified

7za a -tzip "../place-apk-here-for-modding/system%capp%" "../keep/*" -mx%usrc% -r
rmdir /S /Q "%~dp0keep"
7za x -o"../projects/temp" "../place-apk-here-for-modding/[COLOR=red]system[/COLOR]%capp%" resources.arsc -r
7za a -tzip "../place-apk-here-for-modding/system%capp%" "../projects/temp/resources.arsc" -mx%resusrc% -r
rmdir /S /Q "%~dp0projects/temp"

Should it be like this or I understood wrong?
[Android Software Development] raziel23x:
I have not updated the stable build in quite a while please use the Experimental Build as it is updated daily and these above issues have been fixed already there
[Android Software Development] c0rsaro381:
Hello I have a problem.'m Trying to compile the apk for gmail, but when I go to compile I get the following error ...

http://img6.imageshack.us/img6/4189/erroregmail.png

I also tried to update api 17, put in the folder, other \ date.

But it always gives the same error.

What could be wrong?

Thanks in advance
[Android Software Development] raziel23x:
I you tried http://xdaforums.com/showthread.php?t=1755243 this might help you with compiling
[Android Software Development] bovirus:
Should be possible in Stable & Experimental build change the apk filename build by APK from

unsignedApkName.apk -> ApkName-unsigned.apk

signedApkName.apk -> ApkName-signed.apk

to have the file in alpahbetical order and then have clear the application name?

Thanks.
[Android Software Development] raziel23x:
this has been asked about a little over a year ago. and in have never found a coding solution that allows this.
[Android Software Development] bovirus:
Should be possible to make a simple operation.like wHen you create unsignexxxx or signedxxx apk file jst before to go back to APK Multi tool menu could you do

ren unsignedxxxxx xxxx-unsigned

or

ren signedxxxxx xxxx-signed