mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-26 15:27:27 +00:00
Merge origin/master
This commit is contained in:
@@ -40,7 +40,6 @@ import com.jpexs.decompiler.flash.abc.types.ScriptInfo;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.Trait;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitClass;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter;
|
||||
import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst;
|
||||
import com.jpexs.decompiler.flash.action.Action;
|
||||
import com.jpexs.decompiler.flash.action.ActionGraphSource;
|
||||
import com.jpexs.decompiler.flash.action.ActionList;
|
||||
@@ -297,6 +296,9 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
@Internal
|
||||
private volatile Map<Integer, CharacterTag> characters;
|
||||
|
||||
@Internal
|
||||
private volatile Map<Integer, List<CharacterIdTag>> characterIdTags;
|
||||
|
||||
@Internal
|
||||
private volatile Map<Integer, Set<Integer>> dependentCharacters;
|
||||
|
||||
@@ -363,6 +365,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
public void updateCharacters() {
|
||||
characters = null;
|
||||
characterIdTags = null;
|
||||
}
|
||||
|
||||
public void clearTagSwfs() {
|
||||
@@ -426,8 +429,10 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
synchronized (this) {
|
||||
if (characters == null) {
|
||||
Map<Integer, CharacterTag> chars = new HashMap<>();
|
||||
parseCharacters(getTags(), chars);
|
||||
Map<Integer, List<CharacterIdTag>> charIdtags = new HashMap<>();
|
||||
parseCharacters(getTags(), chars, charIdtags);
|
||||
characters = Collections.unmodifiableMap(chars);
|
||||
characterIdTags = Collections.unmodifiableMap(charIdtags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,6 +440,14 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
return characters;
|
||||
}
|
||||
|
||||
public List<CharacterIdTag> getCharacterIdTags(int characterId) {
|
||||
if (characterIdTags == null) {
|
||||
getCharacters();
|
||||
}
|
||||
|
||||
return characterIdTags.get(characterId);
|
||||
}
|
||||
|
||||
public Map<Integer, Set<Integer>> getDependentCharacters() {
|
||||
if (dependentCharacters == null) {
|
||||
synchronized (this) {
|
||||
@@ -725,20 +738,28 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
}
|
||||
|
||||
private void parseCharacters(Iterable<Tag> list, Map<Integer, CharacterTag> characters) {
|
||||
private void parseCharacters(Iterable<Tag> list, Map<Integer, CharacterTag> characters, Map<Integer, List<CharacterIdTag>> characterIdTags) {
|
||||
for (Tag t : list) {
|
||||
if (t instanceof CharacterTag) {
|
||||
int characterId = ((CharacterTag) t).getCharacterId();
|
||||
if (characters.containsKey(characterId)) {
|
||||
logger.log(Level.SEVERE, "SWF already contains characterId={0}", characterId);
|
||||
}
|
||||
if (t instanceof CharacterIdTag) {
|
||||
int characterId = ((CharacterIdTag) t).getCharacterId();
|
||||
if (t instanceof CharacterTag) {
|
||||
if (characters.containsKey(characterId)) {
|
||||
logger.log(Level.SEVERE, "SWF already contains characterId={0}", characterId);
|
||||
}
|
||||
|
||||
if (characterId != 0) {
|
||||
characters.put(characterId, (CharacterTag) t);
|
||||
if (characterId != 0) {
|
||||
characters.put(characterId, (CharacterTag) t);
|
||||
characterIdTags.put(characterId, new ArrayList<>());
|
||||
}
|
||||
} else {
|
||||
if (characterIdTags.containsKey(characterId)) {
|
||||
characterIdTags.get(characterId).add((CharacterIdTag) t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (t instanceof DefineSpriteTag) {
|
||||
parseCharacters(((DefineSpriteTag) t).getTags(), characters);
|
||||
parseCharacters(((DefineSpriteTag) t).getTags(), characters, characterIdTags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2482,6 +2503,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
public void clearAllCache() {
|
||||
characters = null;
|
||||
characterIdTags = null;
|
||||
abcList = null;
|
||||
timeline = null;
|
||||
clearReadOnlyListCache();
|
||||
@@ -3194,15 +3216,15 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
timelined.setModified(true);
|
||||
timelined.resetTimeline();
|
||||
} else // timeline should be always the swf here
|
||||
if (removeDependencies) {
|
||||
removeTagWithDependenciesFromTimeline(tag, timelined.getTimeline());
|
||||
if (removeDependencies) {
|
||||
removeTagWithDependenciesFromTimeline(tag, timelined.getTimeline());
|
||||
timelined.setModified(true);
|
||||
} else {
|
||||
boolean modified = removeTagFromTimeline(tag, timelined.getTimeline());
|
||||
if (modified) {
|
||||
timelined.setModified(true);
|
||||
} else {
|
||||
boolean modified = removeTagFromTimeline(tag, timelined.getTimeline());
|
||||
if (modified) {
|
||||
timelined.setModified(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3852,7 +3874,7 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
String mainClassName = null;
|
||||
//currentDomain,preloader
|
||||
/*double width = 0;
|
||||
double height = 0;
|
||||
double height = 0;
|
||||
*/
|
||||
for (NameValuePair nvp : no.pairs) {
|
||||
if (nvp.name instanceof StringAVM2Item) {
|
||||
@@ -3883,11 +3905,11 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
break;
|
||||
/*case "width":
|
||||
width = Double.parseDouble("" + nvp.value.getResult());
|
||||
break;
|
||||
case "height":
|
||||
height = Double.parseDouble("" + nvp.value.getResult());
|
||||
break;*/
|
||||
width = Double.parseDouble("" + nvp.value.getResult());
|
||||
break;
|
||||
case "height":
|
||||
height = Double.parseDouble("" + nvp.value.getResult());
|
||||
break;*/
|
||||
case "mainClassName":
|
||||
mainClassName = "" + nvp.value.getResult();
|
||||
break;
|
||||
|
||||
@@ -166,13 +166,6 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
|
||||
return actions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed) {
|
||||
for (BUTTONRECORD r : characters) {
|
||||
needed.add(r.characterId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceCharacter(int oldCharacterId, int newCharacterId) {
|
||||
boolean modified = false;
|
||||
@@ -282,7 +275,6 @@ public class DefineButton2Tag extends ButtonTag implements ASMSourceContainer {
|
||||
if (r.buttonStateHitTest) {
|
||||
frameHit.layers.put(r.placeDepth, new DepthState(layer, frameHit, false));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
timeline.addFrame(frameUp);
|
||||
|
||||
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
|
||||
import com.jpexs.helpers.ByteArrayRange;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -139,4 +140,20 @@ public class DefineButtonSoundTag extends Tag implements CharacterIdTag {
|
||||
public void setCharacterId(int characterId) {
|
||||
this.buttonId = characterId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed) {
|
||||
if (buttonSoundChar0 != 0) {
|
||||
needed.add(buttonSoundChar0);
|
||||
}
|
||||
if (buttonSoundChar1 != 0) {
|
||||
needed.add(buttonSoundChar1);
|
||||
}
|
||||
if (buttonSoundChar2 != 0) {
|
||||
needed.add(buttonSoundChar2);
|
||||
}
|
||||
if (buttonSoundChar3 != 0) {
|
||||
needed.add(buttonSoundChar3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,13 +219,6 @@ public class DefineButtonTag extends ButtonTag implements ASMSource {
|
||||
return Helper.byteArrayToHexWithHeader(writer, actionBytes.getRangeData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed) {
|
||||
for (BUTTONRECORD r : characters) {
|
||||
needed.add(r.characterId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceCharacter(int oldCharacterId, int newCharacterId) {
|
||||
boolean modified = false;
|
||||
|
||||
@@ -34,6 +34,7 @@ import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -63,6 +64,18 @@ public abstract class ButtonTag extends CharacterTag implements DrawableTag, Tim
|
||||
|
||||
public abstract boolean trackAsMenu();
|
||||
|
||||
@Override
|
||||
public void getNeededCharacters(Set<Integer> needed) {
|
||||
for (BUTTONRECORD r : getRecords()) {
|
||||
needed.add(r.characterId);
|
||||
}
|
||||
|
||||
DefineButtonSoundTag sounds = getSounds();
|
||||
if (sounds != null) {
|
||||
sounds.getNeededCharacters(needed);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RECT getRect() {
|
||||
return getRect(new HashSet<>());
|
||||
@@ -89,7 +102,7 @@ public abstract class ButtonTag extends CharacterTag implements DrawableTag, Tim
|
||||
}
|
||||
|
||||
public DefineButtonSoundTag getSounds() {
|
||||
for (Tag t : swf.getTags()) {
|
||||
for (CharacterIdTag t : swf.getCharacterIdTags(getCharacterId())) {
|
||||
if (t instanceof DefineButtonSoundTag) {
|
||||
DefineButtonSoundTag st = (DefineButtonSoundTag) t;
|
||||
if (st.buttonId == getCharacterId()) {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
!insertmacro LANG_STRING STRING_ADD_CONTEXT_MENU "Add to context menu"
|
||||
!insertmacro LANG_STRING STRING_SECTION_APP "Application GUI and Libraries"
|
||||
!insertmacro LANG_STRING STRING_SECTION_SWC "Download FlashPlayer library from Adobe site - useful for ActionScript direct editation and other features"
|
||||
!insertmacro LANG_STRING STRING_SECTION_CONTEXT_MENU "Adds FFDec to context menu of SWF and GFX files in windows explorer."
|
||||
!insertmacro LANG_STRING STRING_SECTION_CONTEXT_MENU "Adds FFDec to context menu of SWF and GFX files in Windows Explorer."
|
||||
!insertmacro LANG_STRING STRING_SECTION_SHORTCUT "Creates shortcut link on desktop"
|
||||
!insertmacro LANG_STRING STRING_UNINST_USER "Remove user configuration"
|
||||
!insertmacro LANG_STRING STRING_HELP_US "Help us"
|
||||
@@ -24,7 +24,7 @@
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_REQUIRED "This application requires Flash ActiveX control"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_WILLINSTALL "This application requires installation of the Flash ActiveX control. This will be downloaded and installed as part of the installation."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_ALREADYINSTALLED "Flash ActiveX already installed"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_MISSING "Result: Flash Active X is missing."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_MISSING "Result: Flash ActiveX is missing."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_WILLDOWNLOAD "About to download Flash from "
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_DOWNRESULT "Download result = "
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_CANNOTDOWNLOAD "Cannot download Flash ActiveX. You can download it later manually or use our own flash viewer."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
!define LANG "HUNGARIAN" ; Must be the lang name define by NSIS
|
||||
!insertmacro LANG_STRING STRING_SWC_NOTFOUND "PlayerGlobal.SWC nem található az Adobe weboldalán. Talán a tűzfal blokkolja az elérést vagy engedélyezve van proxy. Később beállithatja az elérési utat az SWC fájlhoz a haladó beállitásoknál."
|
||||
!insertmacro LANG_STRING STRING_SWC_NOTFOUND "PlayerGlobal.SWC nem található az Adobe weboldalán. Talán a tűzfal blokkolja az elérést vagy engedélyezve van proxy. Később beállíthatja az elérési utat az SWC fájlhoz a haladó beállításoknál."
|
||||
!insertmacro LANG_STRING STRING_SAVED_TO "mentve ide:"
|
||||
!insertmacro LANG_STRING STRING_EXISTS_SKIP_DOWNLOAD "már létezik, letöltés kihagyása"
|
||||
!insertmacro LANG_STRING STRING_STARTING_DOWNLOAD "Letöltés megkezdése"
|
||||
@@ -7,52 +7,52 @@
|
||||
!insertmacro LANG_STRING STRING_ADD_CONTEXT_MENU "Hozzáadás a helyi menühöz"
|
||||
!insertmacro LANG_STRING STRING_SECTION_APP "Alkalmazás GUI és Könyvtárak"
|
||||
!insertmacro LANG_STRING STRING_SECTION_SWC "FlashPlayer könyvtár letöltése az Adobe oldaláról - ActionScript közvetlen szerkesztéséhet és egyéb funkciókhoz szükséges"
|
||||
!insertmacro LANG_STRING STRING_SECTION_CONTEXT_MENU "Hozzáadja az FFDec-ez az SWF és GFX fájlok helyi menüjáhez windows tallózóban."
|
||||
!insertmacro LANG_STRING STRING_SECTION_CONTEXT_MENU "Hozzáadja az FFDec-ez az SWF és GFX fájlok helyi menüjéhez windows tallózóban."
|
||||
!insertmacro LANG_STRING STRING_SECTION_SHORTCUT "Parancsikon létrehozása az asztalon"
|
||||
!insertmacro LANG_STRING STRING_UNINST_USER "Felhasználói beállitások eltávolitása"
|
||||
!insertmacro LANG_STRING STRING_HELP_US "Segitsen nekünk"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_FREE "Ez az egész decompiler ingyenes és nyilt forráskódú. Ha szeretne minket támogatni szólhat másoknak a decompiler-ről. Használja a linkeket az oldalunkra, osszon meg pár szót."
|
||||
!insertmacro LANG_STRING STRING_UNINST_USER "Felhasználói beállítások eltávolítása"
|
||||
!insertmacro LANG_STRING STRING_HELP_US "Segítsen nekünk"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_FREE "Ez az egész decompiler ingyenes és nyílt forráskódú. Ha szeretne minket támogatni szólhat másoknak a decompiler-ről. Használja a linkeket az oldalunkra, osszon meg pár szót."
|
||||
!insertmacro LANG_STRING STRING_HELP_US_DONATE "Ha szeretné kifejezni az elismerését a szerzőnek a fejlesztésre fordított időért és erőforrásokért, elfogadunk és értékeljük anyagi támogatását is."
|
||||
!insertmacro LANG_STRING STRING_HELP_US_MORE "Kattintson ide több információhoz:"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_DOYOU "Tudod hogy segithetsz nekünk?"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_BUTTON "Segitsen nekünk!"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_DOYOU "Tudod hogy segíthetsz nekünk?"
|
||||
!insertmacro LANG_STRING STRING_HELP_US_BUTTON "Segítsen nekünk!"
|
||||
!insertmacro LANG_STRING STRING_SWC "PlayerGlobal.swc letöltése"
|
||||
!insertmacro LANG_STRING STRING_SWC_CHECK "Adobe oldal vizsgálata a legújabb PlayerGlobal.swc fájlhoz"
|
||||
;Flash ActiveX:
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_REQUIRED_TITLE "Flash Player ActiveX vezérlő szükséges"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_REQUIRED "Ezen az alkalmazásnak szüksége van a Flash ActiveX vezérlőhez"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_WILLINSTALL "Ezen alkalamzásnak szüksége van a Flash ActiveX vezérlő telepítésére. A telepítés közben le lesz töltve és telepítve."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_WILLINSTALL "Ezen alkalmazásnak szüksége van a Flash ActiveX vezérlő telepítésére. A telepítés közben le lesz töltve és telepítve."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_ALREADYINSTALLED "Flash ActiveX már telepítve van"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_MISSING "Eredmény: Flash ActiveX hiányzik."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_WILLDOWNLOAD "Flash letöltése innen: "
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_DOWNRESULT "Letöltési eredmény = "
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_CANNOTDOWNLOAD "Nem sikerült letöltei a Flash ActiveX-et. Később letöltheti manuálisan vagy használhatja a saját flash nézőkét."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_LAUNCHSETUP "Flash telepitő inditása"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_LAUNCHSETUP "Flash telepitő indítása"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_INTERRUPTED "A Flash telepítés megszakadt - visszatérési kód"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_SETUPOUTCOME "Flash Telepítő kimenetelének vizsgálata"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_UNABLEFINDAFTER "Flash ActiveX nem található annak ellenére hogy a Flash telepítés sikeres volt"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_UNABLEINSTALL "Nem lehet telepípteni a Flash ActiveX-et. Később letöltheti manuálisan vagy használhatja a saját flash nézőkét."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_UNABLEINSTALL "Nem lehet telepíteni a Flash ActiveX-et. Később letöltheti manuálisan vagy használhatja a saját flash nézőkét."
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_SETUPFINISHED "Flash Telepitő befejeződött"
|
||||
!insertmacro LANG_STRING STRING_FLASH_AX_DETECTING "Flash ActiveX detektálása"
|
||||
|
||||
;JRE:
|
||||
!insertmacro LANG_STRING STRING_JRE_REQUIRED_TITLE "JRE Telepités szükséges"
|
||||
!insertmacro LANG_STRING STRING_JRE_REQUIRED "Ezen az alkalmazásnak szüksége van a Java ${JRE_VERSION} vagy újabb verzióra"
|
||||
!insertmacro LANG_STRING STRING_JRE_REQUIRED_INFO "Ezen alkalamzásnak szüksége van a Java Runtime Environment telepítésére. A telepítés közben le lesz töltve és telepítve."
|
||||
!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED_TITLE "JRE Frissités szükséges"
|
||||
!insertmacro LANG_STRING STRING_JRE_REQUIRED_INFO "Ezen alkalmazásnak szüksége van a Java Runtime Environment telepítésére. A telepítés közben le lesz töltve és telepítve."
|
||||
!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED_TITLE "JRE Frissítés szükséges"
|
||||
!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED "Ezen az alkalmazásnak szüksége van a Java ${JRE_VERSION} vagy újabb verzióra"
|
||||
!insertmacro LANG_STRING STRING_JRE_UPDATEREQUIRED_INFO "Ezen alkalmazásnak újabb Java Runtime Environment verzióra van szüksége. A telepítés közben le lesz töltve és telepítve."
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTVERSION "JRE Verzió detektálás"
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE "JRE Verzió detektálás kész - eredmény = "
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE_OLD "Régi JRE található"
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE_NO "JRE nem taláható"
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPLETE_NO "JRE nem található"
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_1 ""
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_2 " verziú összehasonlitása a "
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_2 " verzió összehasonlítása a "
|
||||
!insertmacro LANG_STRING STRING_JRE_DETECTCOMPARE_3 " verzióval. Eredmények: "
|
||||
!insertmacro LANG_STRING STRING_JRE_WILLDOWNLOAD "JRE letöltése innen: "
|
||||
!insertmacro LANG_STRING STRING_JRE_DOWNRESULT "Letöltési eredmény = "
|
||||
!insertmacro LANG_STRING STRING_JRE_CANNOTDOWNLOAD "Nem sikerült letölteni a Java-t. Később letöltheti manuálisan."
|
||||
!insertmacro LANG_STRING STRING_JRE_LAUNCHSETUP "JRE telepitő inditása"
|
||||
!insertmacro LANG_STRING STRING_JRE_LAUNCHSETUP "JRE telepitő indítása"
|
||||
!insertmacro LANG_STRING STRING_JRE_SETUPFINISHED "JRE telepités befejeződött"
|
||||
!insertmacro LANG_STRING STRING_JRE_INTERRUPTED "A JRE telepítés megszakadt - visszatérési kód "
|
||||
!insertmacro LANG_STRING STRING_JRE_SETUPOUTCOME "JRE telepitő eredményének vizsgálata"
|
||||
|
||||
@@ -1560,13 +1560,8 @@ public class CommandLineArgumentParser {
|
||||
long stopTime = System.currentTimeMillis();
|
||||
long time = stopTime - startTime;
|
||||
System.out.println("Export finished. Total export time: " + Helper.formatTimeSec(time));
|
||||
if (exportOK) {
|
||||
System.out.println("OK");
|
||||
System.exit(0);
|
||||
} else {
|
||||
System.err.println("FAIL");
|
||||
System.exit(1);
|
||||
}
|
||||
System.out.println(exportOK ? "OK" : "FAIL");
|
||||
System.exit(exportOK ? 0 : 1);
|
||||
}
|
||||
|
||||
private static void parseDeobfuscate(Stack<String> args) {
|
||||
@@ -1643,39 +1638,38 @@ public class CommandLineArgumentParser {
|
||||
badArguments("compress");
|
||||
}
|
||||
|
||||
boolean result = false;
|
||||
try {
|
||||
SWFCompression compression = SWFCompression.ZLIB;
|
||||
String compressionString = !args.isEmpty() ? args.pop() : null;
|
||||
if (compressionString != null) {
|
||||
switch (compressionString.toLowerCase()) {
|
||||
case "zlib":
|
||||
compression = SWFCompression.ZLIB;
|
||||
break;
|
||||
case "lzma":
|
||||
compression = SWFCompression.LZMA;
|
||||
break;
|
||||
default:
|
||||
System.out.println("Unsupported compression method: " + compressionString);
|
||||
System.exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
try (InputStream fis = new BufferedInputStream(new FileInputStream(args.pop()));
|
||||
OutputStream fos = new BufferedOutputStream(new FileOutputStream(args.pop()))) {
|
||||
SWFCompression compression = SWFCompression.ZLIB;
|
||||
String compressionString = !args.isEmpty() ? args.pop() : null;
|
||||
if (compressionString != null) {
|
||||
switch (compressionString.toLowerCase()) {
|
||||
case "zlib":
|
||||
compression = SWFCompression.ZLIB;
|
||||
break;
|
||||
case "lzma":
|
||||
compression = SWFCompression.LZMA;
|
||||
break;
|
||||
default:
|
||||
System.out.println("Unsupported compression method: " + compressionString);
|
||||
System.exit(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (SWF.compress(fis, fos, compression)) {
|
||||
System.out.println("OK");
|
||||
} else {
|
||||
System.err.println("FAIL");
|
||||
}
|
||||
result = SWF.compress(fis, fos, compression);
|
||||
System.out.println(result ? "OK" : "FAIL");
|
||||
} catch (FileNotFoundException ex) {
|
||||
System.err.println("File not found.");
|
||||
System.exit(1);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
System.exit(0);
|
||||
System.exit(result ? 0 : 1);
|
||||
}
|
||||
|
||||
private static void parseDecompress(Stack<String> args) {
|
||||
@@ -1683,24 +1677,21 @@ public class CommandLineArgumentParser {
|
||||
badArguments("decompress");
|
||||
}
|
||||
|
||||
boolean result = false;
|
||||
try {
|
||||
try (InputStream fis = new BufferedInputStream(new FileInputStream(args.pop()));
|
||||
OutputStream fos = new BufferedOutputStream(new FileOutputStream(args.pop()))) {
|
||||
if (SWF.decompress(fis, fos)) {
|
||||
System.out.println("OK");
|
||||
System.exit(0);
|
||||
} else {
|
||||
System.err.println("FAIL");
|
||||
System.exit(1);
|
||||
}
|
||||
result = SWF.decompress(fis, fos);
|
||||
System.out.println(result ? "OK" : "FAIL");
|
||||
} catch (FileNotFoundException ex) {
|
||||
System.err.println("File not found.");
|
||||
System.exit(1);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
System.exit(0);
|
||||
System.exit(result ? 0 : 1);
|
||||
}
|
||||
|
||||
private static void parseSwf2Xml(Stack<String> args) {
|
||||
@@ -1714,6 +1705,7 @@ public class CommandLineArgumentParser {
|
||||
new SwfXmlExporter().exportXml(swf, new File(args.pop()));
|
||||
} catch (FileNotFoundException ex) {
|
||||
System.err.println("File not found.");
|
||||
System.exit(1);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
@@ -1849,24 +1841,21 @@ public class CommandLineArgumentParser {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean result = false;
|
||||
try {
|
||||
try (InputStream fis = new BufferedInputStream(new FileInputStream(args.pop()));
|
||||
OutputStream fos = new BufferedOutputStream(new FileOutputStream(args.pop()))) {
|
||||
if (SWF.renameInvalidIdentifiers(renameType, fis, fos)) {
|
||||
System.out.println("OK");
|
||||
System.exit(0);
|
||||
} else {
|
||||
System.err.println("FAIL");
|
||||
System.exit(1);
|
||||
}
|
||||
result = SWF.renameInvalidIdentifiers(renameType, fis, fos);
|
||||
System.out.println(result ? "OK" : "FAIL");
|
||||
} catch (FileNotFoundException ex) {
|
||||
System.err.println("File not found.");
|
||||
System.exit(1);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
System.exit(0);
|
||||
System.exit(result ? 0 : 1);
|
||||
}
|
||||
|
||||
private static Map<String, String> parseFormat(Stack<String> args) {
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.jpexs.decompiler.flash.tags.Tag;
|
||||
import com.jpexs.decompiler.flash.tags.VideoFrameTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.AloneTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterIdTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.CharacterTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.FontTag;
|
||||
import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag;
|
||||
@@ -620,6 +621,22 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
return t;
|
||||
}
|
||||
|
||||
private static void writeTag(Tag t, SWFOutputStream sos) throws IOException {
|
||||
t = classicTag(t);
|
||||
|
||||
t.writeTag(sos);
|
||||
if (t instanceof CharacterIdTag) {
|
||||
List<CharacterIdTag> chIdTags = t.getSwf().getCharacterIdTags(((CharacterIdTag) t).getCharacterId());
|
||||
if (chIdTags != null) {
|
||||
for (CharacterIdTag chIdTag : chIdTags) {
|
||||
if (!(chIdTag instanceof PlaceObjectTypeTag || chIdTag instanceof RemoveTag)) {
|
||||
((Tag) chIdTag).writeTag(sos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void createAndShowTempSwf(TreeItem treeItem) {
|
||||
SWF swf = null;
|
||||
try {
|
||||
@@ -741,7 +758,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
t.getNeededCharactersDeep(needed);
|
||||
for (int n : needed) {
|
||||
if (!doneCharacters.contains(n)) {
|
||||
classicTag(swf.getCharacter(n)).writeTag(sos2);
|
||||
writeTag(swf.getCharacter(n), sos2);
|
||||
doneCharacters.add(n);
|
||||
}
|
||||
}
|
||||
@@ -757,7 +774,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
}
|
||||
}
|
||||
|
||||
classicTag(t).writeTag(sos2);
|
||||
writeTag(t, sos2);
|
||||
}
|
||||
|
||||
RECT r = parent.getRect();
|
||||
@@ -772,7 +789,6 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
|
||||
new ShowFrameTag(swf).writeTag(sos2);
|
||||
} else {
|
||||
|
||||
boolean isSprite = false;
|
||||
if (treeItem instanceof DefineSpriteTag) {
|
||||
isSprite = true;
|
||||
@@ -804,11 +820,11 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel
|
||||
}
|
||||
}
|
||||
|
||||
classicTag(characterTag).writeTag(sos2);
|
||||
writeTag(characterTag, sos2);
|
||||
}
|
||||
}
|
||||
|
||||
classicTag((Tag) treeItem).writeTag(sos2);
|
||||
writeTag((Tag) treeItem, sos2);
|
||||
|
||||
MATRIX mat = new MATRIX();
|
||||
mat.hasRotate = false;
|
||||
|
||||
Reference in New Issue
Block a user