Skip to content

Commit

Permalink
now assets are on the correct subdirectories inside output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
creador committed Feb 11, 2017
1 parent 2eadbe9 commit b04c38b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Can have the keys:<br/>
This returns true/false on the callback, indicating the given APK was made or not using Titanium.

### extract (onReadyCB).
This does the extraction of assets and js sources into memory (passed to callback onReady(err, data)).
This does the extraction of assets and js sources into memory.

### reconstruct (onReadyCB). `in progress`
This attempts to rebuild the source code from memory into a structure that can be opened as a Titanium Project.
Expand All @@ -46,7 +46,10 @@ Retrieves Titanium information about the current APK using the extracted resourc

## UPDATES

version 1.0.7-9:
version 1.1.0:
- now assets are put on the correct directories.

version 1.0.9:
- updated to latest apk_unpack to use jadx.
- now resources and manifest are also copied to outputdir

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ti_recover",
"version": "1.0.9",
"version": "1.1.0",
"description": "Appcelerator Titanium APK source code recovery tool",
"main": "ti_recover.js",
"repository": {
Expand Down
14 changes: 10 additions & 4 deletions ti_recover.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ var _tmp = {
package_name : '',
memory_source : {},
_tmp_used : false,
_isit_in_dev : false
_isit_in_dev : false,
_restructured : false
};

var _config = {
Expand Down Expand Up @@ -160,8 +161,10 @@ var writeToDisk = function() {
// delete existing file first
fs.truncateSync(_tmp_file,0);
}
fs.writeFileSync(_tmp_file, _prettyCode(_tmp.memory_source[_i].content));
console.log(colors.yellow('writeToDisk-> file '+_i+' written.'));
var _pti = _prettyCode(_tmp.memory_source[_i].content);
var _byt = (_pti.length>1000)?Math.round(_pti.length/1024)+' KB':_pti.length+ ' Bytes';
fs.writeFileSync(_tmp_file, _pti);
console.log(colors.yellow('writeToDisk-> file '+_i+' written ('+_byt+').'));
}
} else {
console.log('writeToDisk-> You must first call extract method.'.red);
Expand All @@ -175,7 +178,10 @@ var copyAssets = function() {
// copy AndroidManifest.xml to output dir
_file.copySync(_config.apk_dir+'AndroidManifest.xml', _config.out_dir+'AndroidManifest.xml');
// copy assets
_copy_dir.sync(_config.apk_dir+'assets'+path.sep, _config.out_dir+'assets'+path.sep);
if (_tmp._restructured) {
} else {
_copy_dir.sync(_config.apk_dir+'assets'+path.sep+'Resources'+path.sep, _config.out_dir); // +'assets'+path.sep
}
};

var clean = function() {
Expand Down

0 comments on commit b04c38b

Please sign in to comment.