[Q] Change source of image from .cs file - Windows Phone 7 Software Development

Hi. How would you go about to change the source of an image from the .cs file? I've tried this:
xaml.cs:
Code:
BitmapImage yesImage = new BitmapImage(new Uri("/Test;component/Images/yes.png"));
img.Source = yesImage;
The xaml file has a control <image Name="img" /> residing in it.
Would binding in some kind of way solve this?
Sorry for the basic question, but I've searched and wasn't able to find anything that covers this.

Hi,
You're doing it in the right way. I assume you know you're using a URI referencing an image in an external assembly (i.e. a referenced dll separate from the project your .cs file is in)? (in your case called 'Test').
Is the image definitely in an external assembly?
Is that assembly definitely called 'Test'?
Is the image you are trying to load marked as Build Action 'Content' in Visual Studio?
Here's some code that loads an image from an external DLL called Shared:
MyImage.Source = new BitmapImage(new Uri("/Shared;component/Icons/Tick.png", UriKind.Relative));
Here's some similar code that loads it from the same assembly as the .cs file:
MyImage.Source = new BitmapImage(new Uri("/Icons/Tick.png", UriKind.Relative));
Hope that helps,
Ian

That worked! I changed the images (that are local to the project) "Build Action" to "content" and added the UriKind.Relative to the URI and also removed the /Test;component/ from the address.
What i find odd though is that the images (that I added to a folder called Images in the project) had the Build Action set to Resource as default and when i added the source via the property box of Visual Studio to the image control in the XAML it inserted the "/Test;component/Images/yes.png" for me and the images were visible. When changing the Build Action to Content they were gone again.
Anyway, it works now. Thanks

Glad it helped

Related

Question on "hand modified XIP chain"

Could you explain please (very short description) how you modified the xip chain for rom kitchen?
All I can see is the following:
- no length (0)
- no RSA1 signature
- only file entries
What I want to know:
- how to find phys. (ROM) position (do you use unused holes in rom?)
- is 0 length for ROM = autolength
- how to choose the RAM position
- why can length of RAM be 0
Please help. (I need this info for a smartphone project)
I did not bother setting the length, only the 'pvAddr' field is used.
I only make fileentries, because I have yet to implement the generation of modules. ( if I ever do ).
yes, I use unused holes in the rom.
actually, if you don't care about xip updates of other sections, you
may use addresses anywhere in the rom, where your data fits.
It does not nescesarily have to be contigous.
I just copied the ram setting from the other xip entries.
Thank you for the information.
Why don't you take romimage.exe from platformbuilder to generate a XIP block. You only have to write a little .bib file for it. This tool can handle modules and compression as well.
John
P.S. Source code for romimage.exe is available in PB 4.2 private build tree.
I hadn't found that tool yet when I wrote makexip, and then we couldn't have made the romkitchen with it, since romimage.exe runs only under windows.
Don't waste your time with this crap tool (romimage.exe). Some needed files are missing (e.g. bin2xip.exe).
How can I be sure to choose a good phys. addr.? There might be some memory mapped devices...
I have one additional difficult question:
Modules are relocated when embedded into XIP's. Even there seems to be a modification to the import table of the module (e.g. references to coredll.dll will be checked/updated?)
If I extract a module (e.g. a *.dll) from a XIP of an other phone do I have to re-relocate it / modify it's import section even if I place it in a FILES section?
Thanks
John
converting bin to xip is not that difficult. see http://www.xs4all.nl/~itsme/projects/xda/wince-flashfile-formats.html
do you mean the 'physfirst' field in the romheader? that is just the startaddress in the rom.
since the relocation information is not stored in rom, the only way to really
recover it, is to disassemble the file, and find the offsets to stuff that
needs to be reallocated.
so that is a lot of work. and dumprom only extracts nonrelocatable .exe and .dll modules.
if your extracted dll is fixed to a memory location that overlaps with an already existing dll, you will have a problem I think.
I am not even sure, if an extracted dll works at all, I only use them for reverse engineering.
Yes, I mean phys first field. But how can I be sure to choose a valid address for the new XIP block?. My idea is to use address space between existing XIP blocks. Or can I simply choose a very high address (e.g. 8F000000) and hope not to use a region where memory mapped devices are located?
Since I used (your?) dumprom to extract the *.dll files do you think they are "nonrelocated"?
John
I ask so much because I crashed my lovely smartphone a week ago. :-(
My new XIP seems to be invalid... so it doesn't boot anymore. Unfortunately I've killed the bootloader too...
When I try next time (I've ordered a new one) this must not happen!
I am sure they are nonrelocated, fixed to run from a specific memory location.
( just wrote another post about this )
maybe even the module loader does not allow non-xip modules to be loaded in xip reserved memory.
THANK YOU VERY MUCH
I've got it. My Smartphone now have a new XIP block with some files in it...
Only thing left is to rewrite some *.dll files (only resource dlls with no function exports) to extend the language of the MIO 8380.
Are you familiar with languages on smartphone? There are multiple .mui files (resource dlls containing all the dialogs and strings). I've exported all resources and (re)created the dll's as resource only. Unfortunately they don't work ... yet ...
Are there some other files for language extension? What about "wince.nls" or "mxip_lang.vol" ?
Thanks again for your great tools. I will setup a site containing detailed information about this hack soon.
John Smith
cool, I am always interested to see how things work out that I haven't actually tried myself yet.
is this how you create resource only dll's:
http://www.xs4all.nl/~itsme/projects/programming/icondll.html
Currently I'am a little bit confused. PB 4.2 docu says MUIs are resource only .dlls and sample in smartphone sdk adds a dllmain...
I will have to investigate this things a little bit more...
John
O.K.
I've tried anything. The only thing left is that the new resource dlls are not XIPed as modules...
The sample mui app works fine (regardless of resource only / normal dll).
John
P.S. I've successfully changed all other settings some things already appear in the new language. Only poutlook, homescreen and control panel will not change!
Now after some more testing (included a dllmain into the mui file which logs the loading/unloading to file) it seems that my mui.dll is never loaded by system (if I load it manually with LoadLibrary the log is written).
Here is my question:
I've looked a little bit deeper into the dumped mui.dll and found a pointer in security section (pe header) which points to nowhere (just after the [virtual] end [rva] of all of the e32/o32 sections).
Could it be, that I've missed something? Does dumprom fill in this values correctly?
One other interesting idea could be to exchange only the data section of the module (since I want to patch resource only .dlls). But since english is a very short term language all other files will be bigger...
John
>>> I've got it <<<
the new (mui-language) modules have to be REAL xip modules...
So I've build a custom.bib file and used RomImage from CE3.0 Platformbuilder. Even compression is possible now.
Note: romimage.exe does the same thing as makexip.pl
To share my results here is the content of the .bib file I've used:
Code:
MEMORY
; Name Address Size Type
MYXIP 81f00000 0013f000 RAMIMAGE
RAM 8c020000 00fe0000 RAM
CONFIG
COMPRESSION = ON
PROFILE = OFF
ROMFLAGS = 2
ROMSTART=81f00000
ROMSIZE=13f000
ROMWIDTH=32
DLLHIGHADDR=00b00000
MODULES
; Name Path Memory Type
; ------------------------- ------------------------------- ------ ----
outres.dll.0407.mui input\outres.dll.0407.mui MYXIP SHU
syncres.dll.0407.mui input\syncres.dll.0407.mui MYXIP SHU
tapres.dll.0407.mui input\tapres.dll.0407.mui MYXIP SHU
tshres.dll.0407.mui input\tshres.dll.0407.mui MYXIP SHU
wmplayer.exe.0407.mui input\wmplayer.exe.0407.mui MYXIP SHU
FILES
; Name Path Memory Type
; ------------------------- ------------------------------- ------ ----
Busy.0407.mid input\Busy.0407.mid MYXIP
mxip_lang_799.rgu input\mxip_lang_799.rgu MYXIP
ms_splash.gif input\ms_splash.gif MYXIP
carrier_splash.gif input\carrier_splash.gif MYXIP
- The MYXIP region in MEMORY section is a hole in the ROM I've found with calcgaps.pl.
- The RAM region is copied from the other sections (they all use the same)
- ROMSTART and ROMSIZE have to be the same values as defined in MYXIP
- DLLHIGHADDR has to be the !!!lowest!!! loading address found with dumprom (header: dlls=...-... ).
Example: If the lowest address found is "header: dlls=00b00000-00c90000 ..." then DLLHIGHADDR has to be 00b00000
Don't care about the warning the warning "Unable to do imports from ... to COREDLL.dll - will late bind". Thats because coredll is in another XIP.
John
P.S. Thanks a lot for all of your support.
DETAILED INFORMATION ABOUT THIS HACK CAN BE FOUND HERE:
http://smartphonerom.tripod.com (only download the "detailed information")

[APP][DISCONTINUED] TF3D manila mode9 editor

6Fg8 proudly presents:
m9editor
development discontinued
​
m9editor is your little helper when it comes to editing manila files. It lets you edit nearly all aspects of a mode9 file. Additionally it will assist you with graphics, allowing import, export and CFC compression. And It includes a directory viewer with information specific to manila files.
requirements:
m9editor is written in .net, so .netCF3.5 (currently SP1) must be installed (usually its already there). It has been developed and tested using Windows XP x64, but should run on any Windows platform.
usage:
see the manual contained in the download package (PDF)
making of / credits:
thanks to: D-MAN666, sztupy, nixx-X1, Chainfire, pcarvalho, showaco, guap, 12aon, xboxmod, NisseDILLIGAF, smotrs, for contributing knowledge, ideas, testing. Thank you guys (& gals of course) !
version history:
2009-03-10 - v3.3.0.1
BUGFIX: crashed when using selections
2009-03-09 - v3.3.0.0
- LuaConv is now included in the m9editor download package
- CHG: all sourcecode related functions use ".lua" as default extension
- NEW: compile and import function for lua script sourcefiles:
for mode9 files (embedded scripts):
m9editor remembers the filename of the source on a per-node basis and lets you subsequently edit the recently used file from the particular node. You may also attach/detach such a link manually. If a link is established, you may edit the sourcefile (check if you set the "SourceCodeViewer" option in m9editor.cfg) and recompile/import in a single step. When saving the mode9 file the links are saved too (mode9file.ann) and reloaded on next open.
for standalone scripts:
m9editor checks if a correspondig xxxxxxxx_manila.lua exists in the script directory. If yes, you are offered edit and compile options.
- NEW: editor context menu: view source for embedded scripts
- NEW: search previous button
- FIX: editing characterreference threw exception
- NEW: dirviewer context menu for mode9 files: compare with: compare two mode9 files without loading it first
- NEW: dirviewer context menu for all files: hex compare with: compare two files with hexview.
Only available if AptDiff is installed. Edit m9editor.cfg and insert the following line (use the path on your system):
AptDiffPath=c:\Program Files (x86)\Brother Technology\AptDiff 1.5\aptdiff.exe
If AptDiff is installed and configured in m9editor.cfg, text compares are done with AptDiff instead of ExamDiff
WARNING:
during directory analyze, if a lua script is found, m9editor checks for existence of <filename>.luac.lua. If its found it will be renamed to <filename>.lua. In directory viewer the line will be shown blue colored to indicate the presence of a sourcecode file.
during mode9 file load, if a embedded script is found, m9editor checks for existence of <filename>_<bytepos>.luac.lua. If its found it will be renamed to <filename>_<bytepos>.lua. In mode9 editor you will notice the link to the script sourcecode. Dont forget to save the mode9 file to make the link permanent (otherwise if you modify the structure, links might be lost due to changing byteposition).
WARNING2:
The pdf attached doesnt reflect the latest changes to m9editor, update follows.
2009-02-22 - v3.2.0.1
- fixed definitions for weather.mode9 and landscape.mode9 which rendered them unusable after modifying
2009-02-22
I removed the QtcConv and LuaConv tools because they lack of syntactical checks and the same functionality is available in m9editor.
EDIT: added the old LuaConv again, seems to work not that bad i thought it would
2009-02-21 - v3.2.0.0
- font changes for various fields to avoid overlapping
- if "manila files dir" is changed in settings, directoryview will be reloaded
- new: directory viewer context menu option for mode9 files: "extract embedded scripts", writes them to script directory
- changed interpretation of UV property (16.16 instead of INT32)
- picture view: new "save as PNG" and "save as QTC" buttons will save your graphic to a selectable directory
2009-02-19 - v3.1.0.1
bugfix for "save tree to file" function
2009-02-19 - v3.1.0.0
time for a new version
- m9editor now remembers last window/splitter positions and restores them on start and returning from minimize
- HOT compare feature: if a mode9 file is loaded, rightclick on the toplevel node to compare with another mode9 file, or save the treeview as a textfile. Compares are done with a freeware tool named "ExamDiff" from PrestoSoft.
2009-02-18 - v3.0.5.0
new context menu functions in directory viewer: delete, copy to
2009-02-17 - v3.0.4.0
content of XML, HTML displayed in lower right panel
evaluation of XML locales in directory viewer
manual is complete, and now a part of the package
2009-02-16 - v3.0.3.1
annotations now work for new tags as well, and will be copied between instances (+corrected a few flaws during display)
new: search within decompiled lua scripts
new: copy annotations between instances of m9editor
2009-02-11 - v3.0.2.0
bugfix: empty value crash
minor improvements
2009-02-10 - v3.0.1.0
some little improvements:
- sourcecode of embedded scripts and .luac files is shown whenever possible
- zoom percentage display for graphics display
2009-02-09 - v3.0.0.0
I've made a lot of changes to improve m9editor. The most important are:
- integration with sztupy's luadec (thanks and credits to sztupy for great decompiler and permission to use, and of course once again to D-MAN666 for providing knowledge)
- import of compiled lua scripts (ANSI or Unicode, autodetected)
- UI reworked: editor, directory viewer, image viewer combined in one window
planned for next releases of m9editor:
- copy files to/from PDA if connected via ActiveSync
- smart-select referenced graphic files in a mode9 file
- selfcheck for consistent mode9 writing
- analysis of lua script "require"'s for valid manila names
download stats:
v.3.2.0.1: 1554 views (wow! impressed!)
Guess I'll have to try that, seems great !
Your editor seems (as you describe it) only able to change values, but not the structure of the mode9 file, do you intend to change that ?
I have an ongoing project of mode9/xml converter in C, if I can be of some help, don't hesitate to ask
Hi Ximoon,
guess you belong to the "intended audience"
At the moment only changing values is allowed, correct. The main reason for this is that i'm unable to interpret and understand the complete structure, and to make sure that writing of m9 files produces valid files. If there's more info on that i could build it into the editor of course.
What i could imagine is a more generic approach, e.g. allow insertion/deletion of tags based on hex-values. I'll give that a thought.
Do you have any detailed info about the tag-structure? It can be seen in the tagfile but as hexvalues. Ive been able to interpret some of them, but the meaning of many others is unknown to me. So m9editor filters most of them for better reading.
Anyway, there's more to come with m9editor. I already built routines to disassemble lua scripts which run fine, but as its output is only relevant to p-code its pretty useless at this time. Also planned is a tool to allow image replacement. That could go to a point where we have a complete workbench for TF3D, including preview and the like. But thats far beyound my current scope.
Nice anyway !
I have no more information than you do, all I got is from the manilla thread where you posted earlier
But in the end, names of the tags doesn't really matter.
For LUA, I found some decompiler on the web, so I guess a tool to convert lua-unicode to lua-ascii and reverse could work to use those tools.
I guess I'll go on with my editor and see what I could do in the end, for two different approches could be constructive !
Must have been ChunkSpy, right? I found many more but mostly outdated and not working for Lua 5.1.
The Lua routines i've already written allow converting unicode to ascii, and save the scripts in ascii respectively. I'll have to recode them in .net as the first quick approach has been VB
Nice start, man
I was waiting for so long since somebody starts public Manila DevKit since i posted specs i reversed
Drop me a PM if you have any questions
Can't wait to use those lua tools
yeah, right D-MAN, most of that thing is based on your findings, my respect m8.
I'll PM you later, gotta go shopping now for newyears eve
6Fg8 said:
yeah, right D-MAN, most of that thing is based on your findings, my respect m8.
I'll PM you later, gotta go shopping now for newyears eve
Click to expand...
Click to collapse
Yah, sure, after NY eve when my hangover is over
oh oh, nice tool thank you
new version has been released, details here
got ean error if i want to open a file..
System.UnauthorizedAccessException: Der Zugriff auf den Pfad C:\Dokumente und Einstellungen\Administrator\Desktop\HTC\tf3d\2c684cd8_manila wurde verweigert.
bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
bei System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
bei System.IO.FileStream..ctor(String path, FileMode mode)
bei m9editor.m9efunctions.readm9(String fname, Boolean writedebug)
bei m9editor.m9editor.fileopen_Click(Object sender, EventArgs e)
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnClick(EventArgs e)
bei System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ButtonBase.WndProc(Message& m)
bei System.Windows.Forms.Button.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Click to expand...
Click to collapse
edit: i was write protected.....
schreda said:
got ean error if i want to open a file..
System.UnauthorizedAccessException: Der Zugriff auf den Pfad C:\Dokumente und Einstellungen\Administrator\Desktop\HTC\tf3d\2c684 cd8_manila wurde verweigert.
Click to expand...
Click to collapse
sorry, i dont have that file on my touch HD, cannot test. Are you sure its a mode9 file? Can you upload it here?
schreda said:
edit: i was write protected.....
Click to expand...
Click to collapse
that explains something
hmm.. i'm trying to port the analog clock from the Diamond to the HD.. i must change the Resolution i think but i got a bad result if i change the size var... ( i took the original file from the Hd to compare it
schreda said:
hmm.. i'm trying to port the analog clock from the Diamond to the HD.. i must change the Resolution i think but i got a bad result if i change the size var... ( i took the original file from the Hd to compare it
Click to expand...
Click to collapse
great idea, i'd appreciate to see a analog clock on the HD
new version has been released, details here
wow! finally someone is doing it
thanks and keep up the good work!!!
what i show in screenshot, is it portion of unparsed data?
can one edit them? i tried and failed cause i dont know what to change...
i'm missing: RectF, X, Y, Width, Height
pcarvalho said:
wow! finally someone is doing it
thanks and keep up the good work!!!
what i show in screenshot, is it portion of unparsed data?
can one edit them? i tried and failed cause i dont know what to change...
i'm missing: RectF, X, Y, Width, Height
Click to expand...
Click to collapse
its the value of the tag above, "Viewport". Currently i dont know how to parse that, as its binary and i dont understand the meaning. Could be 8 x Int16, or 4x Int32, or a mixture of that, and even then i wouldnt understand what these values mean. Obviously parameters for Viewport.
Yes, you can edit that, simply overwrite the hexvalues and press enter, it will be written.
Can you shed light into the purpose of these values? I'll be glad to parse them right.
BTW there is a baaad bug in v1.0.2.0 when writing m9, i'm currently correcting that.
6Fg8 said:
its the value of the tag above, "Viewport". Currently i dont know how to parse that, as its binary and i dont understand the meaning. Could be 8 x Int16, or 4x Int32, or a mixture of that, and even then i wouldnt understand what these values mean. Obviously parameters for Viewport.
Yes, you can edit that, simply overwrite the hexvalues and press enter, it will be written.
Can you shed light into the purpose of these values? I'll be glad to parse them right.
BTW there is a baaad bug in v1.0.2.0 when writing m9, i'm currently correcting that.
Click to expand...
Click to collapse
take your time my friend
those ones for Viewport i only know that they are:
<Property Name="Viewport" Type="RectF" X="0" Y="0" Width="31457280" Height="35127296" Animated="False"/>
cause i used D-MAN666's mode9parser, talk with him cause he might help, i hope

[Q] [Win 8 JS dev] Uglified, Concated, UTF-8 + BOM encoded JS files for a Windows App

Hey everybody,
I'm currently porting my company's webapp to Windows 8. As being written 99% in JavaScript, I just started a new Windows Store JS App project in Visual Studio and moved all of my code in. After some fixes, the app is running fine now.
For deployment, I'm using grunt with grunt-contrib-uglify to concat and minify my JS files. They are saved with UTF-8 encoding und the windows app runs fine using those minified scripts. But the WACK certification fails because those files don't contain the BOM (Byte Order Marker).
I now added a step to my grunt setup, which adds the BOM to those JS files by reading the filecontent as buffer and re-save it with \uFFEF (the BOM) at the beginning. That leads to correctly encoded files, passing the certification.
The funny part is:
When I run the app as Debug or Release right from VS (with debugger), the app is working fine.
If I bundle the app for store submit and start it with the debugger attached, it's also running fine. But if I start the app without the debugger, the scripts are not being loaded.
Do you have a tip for me?
ice8lue said:
Hey everybody,
I'm currently porting my company's webapp to Windows 8. As being written 99% in JavaScript, I just started a new Windows Store JS App project in Visual Studio and moved all of my code in. After some fixes, the app is running fine now.
For deployment, I'm using grunt with grunt-contrib-uglify to concat and minify my JS files. They are saved with UTF-8 encoding und the windows app runs fine using those minified scripts. But the WACK certification fails because those files don't contain the BOM (Byte Order Marker).
I now added a step to my grunt setup, which adds the BOM to those JS files by reading the filecontent as buffer and re-save it with \uFFEF (the BOM) at the beginning. That leads to correctly encoded files, passing the certification.
The funny part is:
When I run the app as Debug or Release right from VS (with debugger), the app is working fine.
If I bundle the app for store submit and start it with the debugger attached, it's also running fine. But if I start the app without the debugger, the scripts are not being loaded.
Do you have a tip for me?
Click to expand...
Click to collapse
Build project as release and THEN create the app package check for breakpoints. Also does it run uncompressed?
Can you provide the code or the package?
Toxickill said:
Build project as release and THEN create the app package check for breakpoints. Also does it run uncompressed?
Click to expand...
Click to collapse
Doesn't the Package process do the build on it's own?
It is working when I load all the single JS files (that grunt is merging into one) and add the BOM to all of them. If I just concat those files without compression/minification it's working, together with the added BOM it's not...
There are no errors (I added an error listener), they simply don't get loaded.
---
I tried your solution, but it ends the same. The interesting part is, if I use publish rather than build, it gets installed und IS running without a debugger. After packaging, it's not...
The marker you are adding is for the UTF format MS uses... However you are encoding to UTF-8...
Toxickill said:
The marker you are adding is for the UTF format MS uses... However you are encoding to UTF-8...
Click to expand...
Click to collapse
This is, basically, what I'm doing to those JS files after concat/minify:
Code:
var buf = grunt.file.read(fileName, { encoding: null });
var missingBOM = (buf[0] !== 0xEF && buf[1] !== 0xBE && buf[2] !== 0xBB);
if (missingBOM) {
grunt.file.write(fileName, '\ufeff' + buf, { encoding: 'utf-8' });
}
See here http://msdn.microsoft.com/en-us/library/windows/desktop/dd374101(v=vs.85).aspx
Im mobile so im sorry for link.. But you are using the wrong marker for the encoding see here for a table.
Toxickill said:
See here http://msdn.microsoft.com/en-us/library/windows/desktop/dd374101(v=vs.85).aspx
Im mobile so im sorry for link.. But you are using the wrong marker for the encoding see here for a table.
Click to expand...
Click to collapse
Hmm... but it's the same marker as VS adds when I'm manually saving them with UTF8-signed encoding. EF BB BF adds cryptical symbols but no BOM...
Can you create me a blank program compress it and send it to me so i can see if it does not work and i ca debug it as well.
Toxickill said:
Can you create me a blank program compress it and send it to me so i can see if it does not work and i ca debug it as well.
Click to expand...
Click to collapse
I'm sorry, I can't give out the code...
This is essentially what it does:
HTML:
HTML:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" href="%dest%css/%lib-css%" />
<link rel="stylesheet" href="%dest%css/%app-css%" />
</head>
<body>
<div id="wrapper"></div>
<script>
var script = document.createElement('script');
script.async = false;
script.type="text/javascript";
script.charset = "utf-8";
script.onload = function() {
...
};
script.src = '%dest%js/%libs-js%';
document.head.appendChild(script);
var script = document.createElement('script');
script.async = false;
script.type="text/javascript";
script.charset = "utf-8";
script.onload = function() {
... (initialize app,...)
};
script.src = '%dest%js/%app-js%';
document.head.appendChild(script);
</script>
</body>
</html>
What my grunt script does is minify all JS files into app.js and libs.js, the CSS into app.css and libs.css and replace the %var% variables with the corresponding files/folders.
My script now writes the correct BOM to the file and also removes possible BOMs in the file left from the source files during merging:
Code:
var buf = grunt.file.read(dist + fileName, { encoding: null });
var BOM = new Buffer([0xEF,0xBB,0xBF]);
// remove multi BOMs from Buffer
var bufString = buf.toString('utf-8');
bufString = bufString.replace(BOM.toString('utf-8'), null);
buf = new Buffer(bufString, 'utf-8');
// add new UTF-8 BOM to the beginning of the file buffer
var bomFile = Buffer.concat([BOM,buf]);
grunt.file.write(dist + fileName, bomFile, { encoding: 'utf-8' });
I double-checked via a HEX editor that the resulting files 1. contain the correct BOM at the beginning and 2. don't contain any additional BOMs (neither the UTF8 nor the THF16 one).
Still, no luck launching the app without a debugger, my JS is not loaded/parsed...
No ideas guys?
ice8lue said:
No ideas guys?
Click to expand...
Click to collapse
Sorry, ive been working the 8.1 jailbeak, try keeping your scrips in the same directory and referencing them with the file name only...
This could be the problem....
Code:
%dest%js/%libs-js%
Im not familiar with JS windows store apps.
Toxickill said:
Sorry, ive been working the 8.1 jailbeak, try keeping your scrips in the same directory and referencing them with the file name only...
This could be the problem....
Code:
%dest%js/%libs-js%
Im not familiar with JS windows store apps.
Click to expand...
Click to collapse
No problem in general, but we're eager to release the app.
The code path is correct, these are variables, being overwritten during deployment.
Update:
It looks like it's really the combination of merged JS files by uglifyJS and the BOM that causes this problem. I now disabled the merge, loading all of the files seperately (but in a minified form) with the BOM added. The app now succeeds certification AND is running without a debugger.
This is ugly, but it's working - finally.

Push to-->talk, text & directions

Hello!
For the topic of this discussion, I would like to use the following web link as reference. Please visit:
http://www.taganize.com/signature/signature.html
This link will ONLY work in smart phones like iPhone and Android. Directions icon works best with Google Maps installed.
The idea here is that when a link is provided to this page or these icons embedded into email signatures people can contact each other with simple push of a button from smart phone. Especially if person isn't in a persons contact list.
The html code for this page is straight forward:
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta charset="utf-8">
<title>Signature</title>
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="DejaVu Sans">
<center><img src="http://www.taganize.com/signature/taganize.png" width="500" height="90"/></center><p>
<center><font size="3"><b>Activate NFC chips and generate QR codes in seconds.</p>
<i>Reuse them forever!</b></i></font><p></center></font>
<center><img src="http://www.taganize.com/signature/call_me_now.gif" width="160" height="40"/></center>
<p>
<center><img src="http://www.taganize.com/signature/text_me.png" width="80" height="80"/></center>
<p>
<center><img src="http://www.taganize.com/signature/directions.png" width="80" height="80"/></center>
<p>
<center><font size="2"><b>Icons powered by Taganize.com<br></b></i></font></center>
</body>
</html>
But look at the setup procedure and steps
Preparations- Get these three things squared away first:
1. Create Taganize.com account
2. Obtain three images of your choice representing: Call Me, SMS and Visit Me and/or Directions.
3. Setup a hosting account where images and html files can be placed. The pratical thing for novices to do is sign up for either a 'Pancake' account or 'Droppages' accounts and enable access to ones Dropbox account. THIS IS ALL FREE TO DO! As you experience more of Taganize and what Taganize can do for you these third party services will become indispensible in all your QR and NFC needs! See:
A) https://pancake.io/
B) http://droppages.com/getting+started
STEP # 1
1. Sign In to Taganize.com
2. Create Folder 'My uri's' or similar
3. Create three tags:
a. Name your first tag 'Telephone'. In 'target url' field type tel:00358-Area Code-Number NOTE: 00 replaces +. No spaces allowed!
b. Name your second tag 'SMS'. In 'target url' field type sms:00358-Area Code-Number NOTE: 00 replaces +. No spaces allowed!
(If user wants to add message to SMS then do this: sms:00358-Area Code-Number?body=TYPE MESSAGE HERE)
c. To enter directions using geo uri with Google maps (eg https://maps.google.com). Go here!
Right click on the exact location you want to go to and choose 'What's here?'. Coordinates appear top left of screen.
Enter the geo coordinates into the Taganize target url field as follows:
For directions by car enter:
google.navigation:q=60.159057, 24.864673
For additional info on using URIs visit the Taganize.com help section!
4. For each Taganize tag you create you must go to 'Tag Info' located to 'right' of each tag and choose 'view details'. At the bottom of this pop-up window you will find the Taganize assigned url. Write down this url for each of the three tags you create!
STEP # 2
This step involves uploading the three images to a hosting service. Non-novices are assumed to possess that level of knowledge to know what the url of each of their images is.
The urls for images uploaded to 'Pancake' OR 'Droppages' will look similar to this:
Image Location:
http://NAME_USER_ASSIGNS.droppages.com/NAME_OF IMAGE. (example: picture.svg)
http://NAME_USER_ASSIGNS.pancakeapps.com/NMAE_OF_IMAGE. (example: picture2.jpg)
1. User must now upload all three images.
2. User must correctly note the exact url to each image. This can be easily tested by typing each images url in a broswer.
STEP # 3
1. Open 'signature.html' in a text editor
2. We will now assign icons in order from top to bottom. Determine which icon you want to be top, middle, bottom.
3. User will find three lines of code that look similar to this:
<img src="http://www.taganize.com/signature/call_me_now.gif" width="160" height="40"/>
4. Re-enter to each of the three lines the new url for each images location. Adjust the width and height of your image accordingly.
5. Navigate to where the file 'Signature.html' is and open it with your favorite browser.
6. Adjust the width and height accordignly in the signature.html file. Hit refresh on your browser to review changes.
Step: # 4
1. User will find three lines of code that look similar to this: <a href="http://taganize.com/t?c=fC2JgPxr">
2. Replace each line of code with the url You noted in Step # 1 part 4. Make sure they match with your icons.
3. Click save but do not close out.
4. Navigate to where the file 'Signature.html' is and open it with your favorite browser.
5. Provided you entered everything accordingly, web page should open exactly as you want.
6. Upload signature.html file to same destination as images.
7. Type the complete url for signature.html in your smart phone browser.
8. You are now in business.
Would creating an app to do this be a better alternative or is this entireley a non issue and duable?
I set up a poll to hear your opinions.'Just go here:
http://www.taganize.com/signature/signature.html
and click on Uncle Sam.
Thank you!!

Replacing Facebook Messenger resources

I am trying to change the emojies inside of Facebook Messenger by the ones from EmojiOne.
In the first place, I decompiled through dex2jar the messenger APK and did quite a bit of search but no luck, it is obfuscated and pretty hard to read.
So my second guess was to replace each emoji in the resources. To do that, I used aapt to get one and try it:
HTML:
> aapt dump resources msg.apk | grep 1f60f
resource 0x7f020eca com.facebook.orca:drawable/messenger_emoji_1f60f_32: t=0x03 d=0x000017b3 (s=0x0008 r=0x00)
resource 0x7f020ecb com.facebook.orca:drawable/messenger_emoji_1f60f_64: t=0x03 d=0x000017b2 (s=0x0008 r=0x00)
resource 0x7f0c2086 com.facebook.orca:string/emoji_1f60f: t=0x03 d=0x00003439 (s=0x0008 r=0x00)
I tried this :
HTML:
public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable {
if (!resparam.packageName.equals("com.facebook.orca"))
return;
XModuleResources modRes = XModuleResources.createInstance(MODULE_PATH, resparam.res);
resparam.res.setReplacement("com.facebook.orca", "drawable", "messenger_emoji_1f60f_32", modRes.fwd(R.drawable.emojione_emoji_1f60f_32));
resparam.res.setReplacement("com.facebook.orca", "drawable", "messenger_emoji_1f60f_64", modRes.fwd(R.drawable.emojione_emoji_1f60f_64));
}
and quite a few other things, but nothing seems to work. My drawable is working since I tried it in an Activity.
Even though I can get this working, would this be a proper solution to my original problem ?
Will I need to replace EACH emoji one by one in the two sizes ?
Thanks in advance
Bump please, no one?
Up for this thanks
This doesn't solve your problem, but I recently decompiled a proguarded apk too, and couldn't find the right resources easily. I found a method too do so though.
First, install xinstaller, then under misc enable debugging apps (allows debugging any app).
Next, connect your phone, make sure adb is on and connected, open Facebook and go to a conversation. Send some emoji too.
In Android studio, go into Android device monitor (ddms), tools -> Android -> Android device monitor. MAKE SURE YOU SET DDMS UP first
Now, find the button in the toolbar that says something like ui automator dump . This will take a layout dump of your displayed screen and give you a screenshot that you can use to click on various layout objects. You will be able to select the emoji and see what resource id is associated with it.
Or at least, it will give you a method to start looking for the resource id's. Combined with a tool like grep for windows, checking out public.xml for the ID's (they're in hex, but if you want to search in code for the ID, convert it to decimal). And you can pretty much find where the code and resource ID's are now !

Categories

Resources