Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.9.18.5 #41

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
c6ef273
Removed firmware from deployed solution
Androxyde May 24, 2015
0232ac4
HomeUser selector + Xperifirm integration
May 24, 2015
6bd8ba1
XperiFirm integration
May 24, 2015
755c4ab
XperiFirm integration
May 24, 2015
780d6e8
HomeSelector
May 24, 2015
33f552c
XperiFirm integration
May 24, 2015
090c338
XperiFirm Integration
May 24, 2015
f390e7f
XperiFirm integration
May 24, 2015
eedcfc3
XperiFirm integration
May 24, 2015
60cbbaa
XperiFirm integration
May 24, 2015
02299e0
XperiFirm icon
May 24, 2015
58a541b
config.properties in profile
May 24, 2015
b22176e
TA better backup
May 24, 2015
78db4d5
Better TA Backup
May 24, 2015
be97057
Added oem to vendor category
May 28, 2015
207b493
Show message dialog when trying to cancel while not cancelable
May 28, 2015
d1bd586
Cosmetic
May 28, 2015
8417e7d
XperiFirm integration
Androxyde May 29, 2015
61b4993
XperiFirm wrapper
Androxyde May 29, 2015
30c142f
Changed devices git repository to user home
Androxyde May 30, 2015
f8a9b43
Home selector now activates new home selected
Androxyde May 30, 2015
5d3bf58
Removed drivers folder from deployement
Androxyde May 30, 2015
9e990fe
Removed drivers from deployment
May 30, 2015
fbdcad1
Mistake with drivers folder deletion (bad ant command)
May 30, 2015
5266bb9
0.9.18.6
Androxyde May 30, 2015
4624901
Error ...
May 30, 2015
15f7d20
Reintroduce deleted script
Androxyde May 30, 2015
d2f7ae9
Deploy xperifirm wrapper for mac
May 31, 2015
ddf0282
Check xperifirm errors on launch + chmod 755 on xperifirm wrapper for
Androxyde May 31, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ProgramExe/xperifirm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
mono "$1" -o "$2"
10 changes: 2 additions & 8 deletions ant/deploy-release.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="all" name="Deploy Flashtool">

<property name="version" value="0.9.18.5"/>
<property name="progtime" value="14-02-2015 15:30:00"/>
<property name="version" value="0.9.18.6"/>
<property name="progtime" value="30-05-2015 22:30:00"/>

<target name="all" depends="core release"/>

Expand Down Expand Up @@ -36,8 +36,6 @@
<mkdir dir ="../../Deploy/FlashTool/custom/shells"/>
<mkdir dir ="../../Deploy/FlashTool/custom/features"/>
<mkdir dir ="../../Deploy/FlashTool/custom/sin"/>
<mkdir dir ="../../Deploy/FlashTool/custom/mydevices"/>
<mkdir dir ="../../Deploy/FlashTool/firmwares"/>
<mkdir dir="../../Deploy/FlashTool/x10flasher_lib"/>
<mkdir dir="../../Deploy/FlashTool/x10flasher_lib/langs"/>
<mkdir dir="../../Deploy/FlashTool/drivers"/>
Expand All @@ -49,10 +47,6 @@
<fileset dir="../src/org/lang/ressources"
excludes="**/.svn"/>
</copy>
<copy todir="../../Deploy/FlashTool/firmwares">
<fileset dir="../firmwares"
excludes="**/.svn"/>
</copy>
<copy todir="../../Deploy/FlashTool/custom/root">
<fileset dir="../romupdates" excludes="**/.svn"/>
</copy>
Expand Down
9 changes: 9 additions & 0 deletions ant/setup-linux.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<delete dir="../../Deploy/FlashTool/x10flasher_lib/swtwin"/>
<delete dir="../../Deploy/FlashTool/x10flasher_lib/swtmac"/>
<delete dir="../../Deploy/FlashTool/x10flasher_lib/mac"/>
<delete dir="../../Deploy/FlashTool/drivers"/>
<delete file="../../Deploy/FlashTool/config.properties"/>
</target>

Expand All @@ -67,14 +68,22 @@
<target name="binaries" depends="clean, main_lib, JRE">
<copy file="../ProgramExe/FlashTool" todir="../../Deploy/FlashTool"/>
<copy file="../ProgramExe/FlashToolConsole" todir="../../Deploy/FlashTool"/>
<copy file="../ProgramExe/xperifirm" todir="../../Deploy/FlashTool/x10flasher_lib"/>
<copy todir="../../Deploy/FlashTool/x10flasher_lib">
<fileset dir="../linux"
excludes="**/.svn"/>
</copy>
<chmod file="../../Deploy/FlashTool/FlashTool" perm="755" />
<chmod file="../../Deploy/FlashTool/FlashToolConsole" perm="755"/>
<chmod file="../../Deploy/FlashTool/x10flasher_lib/xperifirm" perm="755"/>
<chmod file="../../Deploy/FlashTool/x10flasher_lib/adb.linux.x64" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/adb.linux.x86" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/adb.linux" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/fastboot.linux.x64" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/fastboot.linux.x86" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/fastboot.linux" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/unyaffs.linux.x64" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/unyaffs.linux.x86" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/unyaffs.linux" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/bin2elf" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/bin2sin" perm="755" />
Expand Down
3 changes: 3 additions & 0 deletions ant/setup-mac.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<delete dir="../../Deploy/FlashTool/x10flasher_lib/swtwin"/>
<delete dir="../../Deploy/FlashTool/x10flasher_lib/mac"/>
<delete file="../../Deploy/FlashTool/config.properties"/>
<delete dir="../../Deploy/FlashTool/drivers"/>
</target>

<target name="JRE">
Expand All @@ -64,12 +65,14 @@
<target name="binaries" depends="clean, main_lib, JRE">
<copy file="../ProgramExe/FlashTool" todir="../../Deploy/FlashTool"/>
<copy file="../ProgramExe/FlashToolConsole" todir="../../Deploy/FlashTool"/>
<copy file="../ProgramExe/xperifirm" todir="../../Deploy/FlashTool/x10flasher_lib"/>
<copy todir="../../Deploy/FlashTool/x10flasher_lib">
<fileset dir="../mac"
excludes="**/.svn"/>
</copy>
<chmod file="../../Deploy/FlashTool/FlashTool" perm="755" />
<chmod file="../../Deploy/FlashTool/FlashToolConsole" perm="755"/>
<chmod file="../../Deploy/FlashTool/x10flasher_lib/xperifirm" perm="755"/>
<chmod file="../../Deploy/FlashTool/x10flasher_lib/adb.mac" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/fastboot.mac" perm="755" />
<chmod file="../../Deploy/FlashTool/x10flasher_lib/unyaffs.mac" perm="755" />
Expand Down
16 changes: 15 additions & 1 deletion src/flashsystem/Bundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public final class Bundle {
private String _version;
private String _branding;
private String _device;
private String _cda="";
private String _revision="";
private String _cmd25;
private String _resetCust;
public final static int JARTYPE=1;
Expand Down Expand Up @@ -79,6 +81,7 @@ private void feedFromJar(String path) {
_device = _firmware.getManifest().getMainAttributes().getValue("device");
_version = _firmware.getManifest().getMainAttributes().getValue("version");
_branding = _firmware.getManifest().getMainAttributes().getValue("branding");
_cda = _firmware.getManifest().getMainAttributes().getValue("cda");
_cmd25 = _firmware.getManifest().getMainAttributes().getValue("cmd25");
Enumeration<JarEntry> e = _firmware.entries();
while (e.hasMoreElements()) {
Expand Down Expand Up @@ -212,6 +215,14 @@ public void setDevice(String device) {
_device=device;
}

public void setCDA(String cda) {
_cda = cda;
}

public void setRevision(String revision) {
_revision = revision;
}

public void setCmd25(String value) {
_cmd25 = value;
if (_cmd25==null) _cmd25="false";
Expand Down Expand Up @@ -241,13 +252,16 @@ public boolean hasResetStats() {
}

public void createFTF() throws Exception {
File ftf = new File(OS.getFolderFirmwares()+File.separator+_device+"_"+_version+"_"+_branding+".ftf");
File ftf = new File(OS.getFolderFirmwares()+File.separator+_device+"_"+_version+"_"+(_cda.length()>0?_cda:_branding)+(_revision.length()>0?("_"+_revision):"")+".ftf");
if (ftf.exists()) throw new Exception("Bundle already exists");
byte buffer[] = new byte[10240];
StringBuffer sbuf = new StringBuffer();
sbuf.append("Manifest-Version: 1.0\n");
sbuf.append("Created-By: FlashTool\n");
sbuf.append("version: "+_version+"\n");
sbuf.append("branding: "+_branding+"\n");
sbuf.append("cda: "+_cda+"\n");
sbuf.append("revision: "+_revision+"\n");
sbuf.append("device: "+_device+"\n");
sbuf.append("cmd25: "+_cmd25+"\n");
Manifest manifest = new Manifest(new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8")));
Expand Down
2 changes: 1 addition & 1 deletion src/flashsystem/BundleMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ else if (intname.toUpperCase().contains("RPM"))
add(intname,"kernel".toUpperCase());
else if (intname.toUpperCase().contains("ELABEL"))
add(intname,"elabel".toUpperCase());
else if (intname.toUpperCase().contains("VENDOR"))
else if (intname.toUpperCase().contains("VENDOR") || intname.toUpperCase().contains("OEM"))
add(intname,"vendor".toUpperCase());
else if (intname.toUpperCase().contains("BOOT_DELIVERY"))
add(intname,"bootbundle".toUpperCase());
Expand Down
31 changes: 25 additions & 6 deletions src/flashsystem/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
import org.logger.MyLogger;
import org.util.HexDump;

import com.sonymobile.cs.generic.array.ArrayUtils;

import flashsystem.io.USBFlash;

public class Command {

private boolean _simulate;
private byte[] reply;

public static final byte[] TA_FLASH_STARTUP_SHUTDOWN_RESULT_ONGOING = {
0x00, 0x00, 0x27, 0x74, 0x00, 0x00, 0x00, 0x01, 0x01};
Expand Down Expand Up @@ -49,6 +52,7 @@ public class Command {
static final int CMD10 = 10;
static final int CMD12 = 12;
static final int CMD13 = 13;
static final int CMD18 = 18;
static final int CMD25 = 25;


Expand All @@ -62,7 +66,7 @@ public Command(boolean simulate) {

public String getLastReplyString() {
try {
return new String(USBFlash.getLastReply());
return new String(reply);
}
catch (Exception e) {
return "";
Expand All @@ -71,7 +75,7 @@ public String getLastReplyString() {

public String getLastReplyHex() {
try {
return HexDump.toHex(USBFlash.getLastReply());
return HexDump.toHex(reply);
}
catch (Exception e) {
return "";
Expand All @@ -80,12 +84,20 @@ public String getLastReplyHex() {

public short getLastReplyLength() {
try {
return (short)USBFlash.getLastReply().length;
return (short)reply.length;
}
catch (Exception e) {
return 0;
}
}

public byte[] getLastReply() {
return reply;
}

public boolean isMultiPacketMessage() {
return (USBFlash.getLastFlags() & 4) > 0;
}

private void writeCommand(int command, byte data[], boolean ongoing) throws X10FlashException, IOException {
if (!_simulate) {
Expand All @@ -112,12 +124,19 @@ private void writeCommand(int command, byte data[], boolean ongoing) throws X10F
public void send(int cmd, byte data[], boolean ongoing) throws X10FlashException, IOException
{
writeCommand(cmd, data, ongoing);
LogProgress.updateProgress();
reply = USBFlash.getLastReply();
if (USBFlash.getLastFlags()==0) {
writeCommand(Command.CMD07, Command.VALNULL, false);
throw new X10FlashException(getLastReplyString());
}

while(isMultiPacketMessage()) {
writeCommand(cmd, data, ongoing);
reply = ArrayUtils.concatenateByteArrays(reply, USBFlash.getLastReply());
if (USBFlash.getLastFlags()==0) {
writeCommand(Command.CMD07, Command.VALNULL, false);
throw new X10FlashException(getLastReplyString());
}
}
LogProgress.updateProgress();
}

}
22 changes: 21 additions & 1 deletion src/flashsystem/TaFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class TaFile {
FileInputStream _in;
Scanner _scanner;
Vector<TaEntry> entries = new Vector<TaEntry>();
int _partition = 0;

public TaFile(File f) throws TaParseException, FileNotFoundException {
_taf = f;
Expand All @@ -22,7 +23,8 @@ public TaFile(File f) throws TaParseException, FileNotFoundException {
boolean beginentry=false;
while (_scanner.hasNextLine()) {
String line = _scanner.nextLine().trim();
if (!line.startsWith("/") && !(line.length()<=4)) {
if (line.startsWith("/")) continue;
if (!(line.length()<=4)) {
Scanner scanline = new Scanner(line);
scanline.useDelimiter(" ");
while (scanline.hasNext()) {
Expand Down Expand Up @@ -50,7 +52,21 @@ public TaFile(File f) throws TaParseException, FileNotFoundException {
}
}
}
if(_partition == 0 && line.length() == 2){
try {
_partition = Integer.parseInt(line);
if (_partition !=1 && _partition != 2) {
throw new TaParseException("TA partition should be 1 or 2");
}
} catch (NumberFormatException e) {

}
}
}

if(_partition == 0){
_partition = 2;
}
entry.close();
entries.add(entry);
try {
Expand All @@ -66,6 +82,10 @@ public Vector<TaEntry> entries() {
public String getName() {
return _taf.getName();
}

public int getPartition() {
return _partition;
}

public String toString() {
String result = "";
Expand Down
Loading