[Q] Stock mi 4i downloaded phish.tmp and pattern.tmp - Malware? - Xiaomi Mi 4i

Hi,
I received my phone yesterday and immediately after setting up my Google account on the phone, I updated it to latest version of MIUI [6.5.3.0(LXIMICD)] [Android version 5.0.2(LRX22G)].
After that I updated all preinstalled Playstore apps. Installed Google camera also. No other new apps were installed, no file was copied on to the phone, no file was downloaded.
After some time, I noticed that two files were automatically getting downloaded - "phish.tmp" and "pattern.tmp". It is available in the 'Downloads' folder.
It seems like people have noticed this behaviour on other miui phones, but no conclusion has yet been drawn.
http://en.miui.com/thread-83338-1-1.html
http://en.miui.com/thread-103122-2-1.html
http://en.miui.com/thread-86991-1-1.html
Can somebody throw some light on this?
Any way to find out which app downloaded it?
Anybody else noticed this, or am i the only one with this problem?

I also noticed it.. Didn't took it so seriously though [emoji14]
Will do some research and reply

I am also getting the same.

You can open both files as Text.
Phish.tmp is an endless list of Websites
Code:
mobile.28365365.com
www.yixingjia.com
avbbs.me
www.87654.com
www.gegeshe.com
ccc36.bjh868.net
gfw74.tk
msb.188bet.com
m.h367.com
www.ddaa44.com
mobile.yu8k.com
www.baiavbbs.com
m.youjizz.com
75515.com
www.axxbbs.com
www.new56.net
www.11xxzz.com
www.12ddd.www.avbbs.me
www.avbbs123.com
www.0820.com
174.139.109.38
m.jumeiouhua.net
baixxx789.com
www.viidii.info
www.5566889.com
666.hulingo.net
go.kk186.cn
www.h367.com
yk997.com
www.1144qq.com
www.yixingjia.info
jk7775.com
www.22444.com
www.8568888.com
www.zlvc.net
enhmm.com
www.14000.com.....
Pattern.tmp looks like this
Code:
{
"version":"1.1",
"features":[
{
"name":"Fei_xin",
"abstract":"Start with 12520",
"sms_type":1,
"address":{pattern:["^12520"]}
},
{
"name":"sms_body_length",
"sms_type":1,
"body":{body_len:["0-15"]}
},
{
"name":"bracket_title_not_personal_address",
"assist":true,
"address":{type:[1,2,3,4,5,6]},
"body": {
"or_pattern":[
"^(\\s)*【[\\u4E00-\\u9FFF|a-z|0-9|0-9| | |\\.]{2,12}】",
"【[\\u4E00-\\u9FFF|a-z|0-9|0-9| | |\\.]{2,12}】(\\s|\\u0000)*$",
"^(\\s)*\\[[\\u4E00-\\u9FFF|a-z|0-9|0-9| | |\\.]{2,12}\\]",
"\\[[\\u4E00-\\u9FFF|a-z|0-9|0-9| | |\\.]{2,12}\\](\\s|\\u0000)*$"
]}
},
{
"name":"important_info_body",
"assist":true,
"body": {
neg_pattern:["恭喜.*幸运.*奖品"],
"or_pattern":[
"尾号.{0,1}\\d{4}",
"券.{0,4}\\d{6,20}",
"验证码.{0,4}\\d{4,8}",
"密码.{0,4}\\d{6,10}"
]}
},
{
"name":"important_addr",
"assist":true,
"address":{type:[1,5]}
},
{
"name":"important_info",
"sms_type":1,
"combi":["bracket_title_not_personal_address&important_info_body",
"important_addr&important_info_body"]
},
{
"sms_type":1,
"name":"linking_up",
"body": {"or_pattern":[
"^(\\s)*\\(接上条\\)",
"^(\\s)*(接上条)",
"^(\\s)*(接上:|接上:|接上条:|接上条:)",
"^(\\s)*\\([1-9]/[1-9]\\)",
"^(\\s)*([1-9]/[1-9])"
]}
},
{
"sms_type":0x08000000,
"name":"fa_piao",
"body": {
num_types:[2],
body_len:["15-55"],
or_pattern:[
"(发|發|fa)(.|\\n)*(票|飘|漂|嫖|缥|螵|瞟|嘌|piao)",
"票发"
]}
},
{
"sms_type":0x08000000,
"name":"fa_piao_1",
"body": {
struct_types:[1],
num_types:[2],
body_len:["15-55"]
}
},
{
"sms_type":0x08000000,
"name":"bank_card_remittance",
"body": {
num_types:[0],
body_len:["15-55"],
or_pattern:[
"[工|农|侬|建|中|交|招|邮政].{0,14}行"
]}
},
{
"sms_type":0x08000000,
"name":"phish",
"body": {
struct_types:[2]
}
},
{
"name":"subscription",
"sms_type":0x00000100,
"body": {
"or_pattern":[
"^(\\s)*[\\[|【][\\u4E00-\\u9FFF]{0,8}(早报|晚报|手机报|快报|播报|预报|战报|晨报|新闻|奇闻|快讯|短讯|刊|阅读|百科|所学|小学|中学|小米)[\\u4E00-\\u9FFF]{0,4}[】|\\]]",
"[\\[|【][\\u4E00-\\u9FFF]{0,8}(早报|晚报|手机报|快报|播报|预报|战报|晨报|新闻|奇闻|快讯|短讯|刊|阅读|百科|所学|小学|中学|小米)[\\u4E00-\\u9FFF]{0,4}[】|\\]](\\s|\\u0000)*$",
"^(\\s)*[\\u4E00-\\u9FFF]{0,8}(早报|晚报|手机报|快报|播报|预报|战报|晨报|新闻|奇闻|快讯|短讯|刊|阅读|百科|所学|小学|中学|小米)[\\u4E00-\\u9FFF]{0,4}[:|:]"
]}
},
{
"name":"all_chinese",
"sms_type":0x00000100,
"body": {
"neg_pattern":[
"[^\\u4E00-\\u9FFF|,|。|\\n| | ]"
]}
},
{
"name":"multi_semicolo",
"sms_type":0x00000100,
"body": {
"or_pattern":[
"\\W1\\..{6,}\\W2\\..{6,}\\W3\\..{6,}",
"\\W1,.{6,}\\W2,.{6,}\\W3,.{6,}",
"\\W1、.{6,}\\W2、.{6,}\\W3、.{6,}",
"\\W1:.{6,}\\W2:.{6,}\\W3:.{6,}",
"\\W1:.{6,}\\W2:.{6,}\\W3:.{6,}",
".{6,};.{6,};.{6,};",
".{6,};.{6,};.{6,};",
"(.|\\r){6,}\\n{1,}(.|\\r){6,}\\n{1,}(.|\\r){6,}"
]}
},
{
"name":"telephone_fee",
"sms_type":1,
"address":{"type":[1]},
"body": {"pattern":[
"[1-9][0-9]?元话费",
"(送|赠).*(移动|联通|电信)"
]}
},
{
"name":"official_phone",
"sms_type":0x00004000,
"address":{"type":[2]}
},
{
"name":"important_phone",
"sms_type":0x00001000,
"address":{"type":[1,5]}
}
]
}

Related

[Q] fitting a custom-built cmos sensor to a host running android.

Hi
I work for a company that is in the business of private-security,and recently we decided to test the feasibility of creating a new product line of hand-held personal security recorders that will make use of RGB+IR channels image recording (reproduced from an in-house,custom built back camera based on one of the world's biggest manufacturers of raw cmos imaging sensors fitted with a proprietary bayer filter).
The host device is expected to be based on the ARM architecture and a powerful GPU chip (such as the the Adreno or Power VR latest chips) and although we haven't decided yet of the smart-phone brand that we'll be interested in converting,the model will probably belong to one of the biggest players in the market such as Samsung/HTC/Motorola etc.,and for the obvious reasons...
And here is the question...although we don't see any significant problems with fitting the custom-camera module instead of an original(,non-soldered,ofc...) camera box that comes with the OEM host device while maintaining the same footprint,power & heating envelopes and signaling interfaces (we have some great ASIC engineers here,I fully trust their abilities in that respect ),we're still unsure of our abilities to tweak the ROM of one of today's latest smartphones to include a custom driver (we'll probably hand to one of our affiliate software-house companies to do its coding...for a hefty fee ,not to mention re-writing a camera app,hopefully not from scratch...).
I'd be happy to hear from you,techies of your opinion regarding this project,and considering that some amount of reverse engineering here is a given (right ?),will it be possible to achieve the design goal of the software part of the project in (roughly) 6 months time-frame,and with a budget that should not exceed 250-300 K USD ?
Thanks in advance
David B.
still working on the camera app?
Sure.
Have you looked at other Android applications, which have partially achieved this? They exist.
From the sound of your inventory, you've talented engineers, resources and business sense. Specific issue is to do with variants in hardware and being able to support multiple devices, in most cases not at all 'generic'.
Sony IMX046 found within Xperia X10 models - 8.1MP and the IMX081PQ 16.1MP found in the Arc after debuting as a Cybershot. Both quite different devices, one having double resolution, back lit CMOS sensors and other features, radical enough to place it in a league of it's own. Now try to make that work with a HTC 5MP camera and conjunction it with the front facing camera when video conferencing...
Consider details like pixel arrays, focus, aperture, transistor gates, photo cathodes, anti-reflective coatings, firmware versions, available resolutions (not just desired), operating modes, effects... filters... all different for each device, each manufacturer, each version or release of Android.
To build an database of hardware, sensors, modes, focus sets, image formats, firmware and drivers itself is not hard but is the backbone of what you have in front of you. Provide a platform able to identify the package driver and hardware provider (the right 'glue') itself not overtly difficult or impossible.. perhaps a challenge!
Each driver, device, firmware has significant differences which can not be evaluated on 'one size fits all' method. A highly flexible architecture is required, modular in so far as to analyze and detect variations fail safe, apply the correct logic and driver for base provider as a structured and autonomous instance.
Consider this code from a Gingerbread firmware, designed for a Sony X10. SE will not release Gingerbread (2.3.x) for the X10 as they declared that 2.1 (Eclair) is suitable for the hardware and the software upgrade provides no value.
static const camera_size_type picture_sizes[] = {
{ 3264, 2448 }, // 8MP
{ 2592, 1944 }, // 5MP
{ 2560, 1920 }, // 5MP (reduced)
{ 2048, 1536 }, // 3MP QXGA
{ 1920, 1200 }, // WUXGA
{ 1920, 1080 }, // HD1080 - HDTV
{ 1600, 1200 }, // 2MP UXGA
{ 1680, 1050 }, // WSXGA+
{ 1600, 900 }, // HD+
{ 1440, 900 }, // WSXGA
{ 1280, 768 }, // WXGA
{ 1280, 720 }, // HD720 (HDTV)
{ 1152, 864 }, // XGA+
{ 1024, 768}, // 1MP XGA
{ 800, 600 }, // SVGA
{ 800, 480 }, // WVGA
{ 640, 480 }, // VGA
{ 352, 288 }, // CIF
{ 320, 240 }, // QVGA
{ 176, 144 } // QCIF
};
If you know what you are looking at, you can see some of these resolutions are not supported by the camera and will generate errors in software, leaving unhappy customers! Considering that this is an extract from an active AOSP project to port Gingerbread for the X10, for the love of doing it with no real benefit to the developers involved... it's not bad at all but will become refined into something more like this;
static const camera_size_type picture_sizes[] = {
{ 820, 616 },
{ 3280, 616 },
{ 3280, 2464 },
};
Reason the camera itself only supports 3 possible modes and these have to be defined exactly in the right way for it to work, for a single device and a single pixel out will error, even the order of the driver.. notice bold emphasis on resolution.
0.5Mp - 4X Horiz & Vert. | 2Mp - 4X Vertical Elim. | 8MP - Full Resolution​
Saying it simply, it's not impossible but it's not easy!

[KERNEL][Sep18]-=UNITY V9=-[2.6.35.14][OC/UV][CIFS/TUN][SLQB][NOOP][2WCR]

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Features:
Based on Official GB kernel source code from HTC
Patched to .14
2-way call records - https://market.android.com/details?id=com.skvalex.callrecorder
OC up to 2016MHz (Default 245 - 1075MHz @ Ondemand)
VDD sysfs interface
Tweaked Interactive governor
Additional Virtuous/SmartAss/SavagedZen/Scary governors
Audio Boosts (20%)
CIFS
TUN
CFS
SLQB
NOOP I/O scheduler
TINY PREEMPT RCU
Full EXT4 Support
and more...
Click to expand...
Click to collapse
Compatible with:
All Sense ROM's based on Android 2.3.4 - 2.3.5 >
Click to expand...
Click to collapse
Issues:
- you tell me
Click to expand...
Click to collapse
Install:
- Flash via CWM
Click to expand...
Click to collapse
Download UNITY V9:
http://www.multiupload.com/VPFKEN5RAM
For correct work 2wcr function use CallRecorder app https://market.android.com/details?id=com.skvalex.callrecorder
Click to expand...
Click to collapse
Enjoy
Click to expand...
Click to collapse
More info & GPL:
Virtuous Home: http://www.virtuousrom.com
Virtuous Forum: http://forums.virtuousrom.com/index.php
HTC: http://www.htc.com/
Kernel GIT: https://github.com/mdeejay/msm7x30-gb-kernel
Thanks: Markinus (for teach), avs234 & skvalex (for 2WCR), Flemmard, seo and other Virtuous team, LordClockaN, LeeDroid, etc​
Changelog:
Code:
UNITY V9:
- OC up to 2.0GHz
- Tweak all governors
- New Virtuous governor
- XZ compressing
- PREEMPT_TINY_RCU
- lots minor fixes & tweaks
UNITY V8:
- Fixed VDD
- OC up to 1804MHz
UNITY V7:
- Added VDD sysfs interface
UNITY V6:
- Enabled AMR format support for CallRecorder
- Fixed support apps like "Voice Commander"
UNITY V5:
- Fixed USB for Android 2.3.4
- "Fast USB charging" hack
UNITY V4:
- Added new module for 2wcr
---- Fixed hardware amr recordings
---- Fixed stereo recordings
---- Fixed missing call recordings
- Added SavagedZen governor
- Added Scary governor
- Some minor cleanups
UNITY V3:
- New OC method with 50 steps
- New acpu table
- Fixed kernel info
- Some cleanups
UNITY V2:
- Reverted new audio drivers
- Added 2WCR patch for new audio drivers
- Added Wi-Fi Calling support for T-Mobile users (Kineto GAN)
- Disabled BFQ / Enabled Deadline
- Disabled btrfs & ext2 support
UNITY V1:
- Added support HTC Desire Z & HTC My Touch 4G
- Tweaked video drivers
- CIFS/TUN/UTF set as modules
[SIZE="2"]v.23:
- Back to old video drivers (from official HTC source)
- ACPU edits
v.22:
- Improved SmartAss works with >=1600Mhz
v.21:
- new acpu table
- tweaked governors
- some cleanups
- max OC 1708MHz
v.20:
- not released
v.19:
- Updated video drivers from CodeAurora
- Added BFQ v.2-r1
- Tweak SmartAss (XBOCT)
- Increase GPU & Camera memory allocation (Lee)
- Disable write cache support
- Correct LCD panel size
- Added 1612MHz to acpu table
v.18:
- Added 2 steps in acpu table
- New universal updater script for both filesystems
- Prevent memory leak on hotplug
v.17:
- Added 2-way call records
v.16:
- Based on official GB kernel source code from HTC
- Enabled OC (1516MHz MAX)
- Removed 2-way call records patch
- Added Smartass governor
- Added interactive governor
- Added Conservative governor
- Added audio boost
- Added default V(R) I/O Scheduler
- Added default SLQB Memory allocator[/SIZE]
ACPU Table:
Code:
{ 122000, PLL_3, 5, 2, 61440, 875, VDD_RAW(875) },
{ 245000, PLL_3, 5, 1, 192000, 875, VDD_RAW(875) },
{ 307200, PLL_3, 5, 1, 192000, 900, VDD_RAW(900) },
{ 384000, PLL_1, 2, 0, 192000, 900, VDD_RAW(900) },
{ 460800, PLL_3, 5, 1, 192000, 925, VDD_RAW(925) },
{ 537600, PLL_2, 3, 0, 192000, 950, VDD_RAW(950) },
{ 614400, PLL_2, 3, 0, 192000, 950, VDD_RAW(950) },
{ 691200, PLL_2, 3, 0, 192000, 975, VDD_RAW(975) },
{ 768000, PLL_2, 3, 0, 192000, 1000, VDD_RAW(1000) },
{ 844800, PLL_2, 3, 0, 192000, 1000, VDD_RAW(1000) },
{ 921600, PLL_2, 3, 0, 192000, 1025, VDD_RAW(1025) },
{ 998400, PLL_2, 3, 0, 192000, 1025, VDD_RAW(1025) },
{ 1075200, PLL_2, 3, 0, 192000, 1050, VDD_RAW(1050) },
{ 1152000, PLL_2, 3, 0, 192000, 1075, VDD_RAW(1075) },
{ 1228800, PLL_2, 3, 0, 192000, 1100, VDD_RAW(1100) },
{ 1305600, PLL_2, 3, 0, 192000, 1125, VDD_RAW(1125) },
{ 1382400, PLL_2, 3, 0, 192000, 1150, VDD_RAW(1150) },
{ 1459200, PLL_2, 3, 0, 192000, 1200, VDD_RAW(1200) },
{ 1536000, PLL_2, 3, 0, 192000, 1275, VDD_RAW(1275) },
{ 1612800, PLL_2, 3, 0, 199680, 1325, VDD_RAW(1325) },
{ 1689600, PLL_2, 3, 0, 199680, 1375, VDD_RAW(1375) },
{ 1766400, PLL_2, 3, 0, 199680, 1425, VDD_RAW(1425) },
{ 1843200, PLL_2, 3, 0, 199680, 1450, VDD_RAW(1450) },
{ 1920000, PLL_2, 3, 0, 199680, 1475, VDD_RAW(1475) },
{ 1996800, PLL_2, 3, 0, 199680, 1500, VDD_RAW(1500) },
{ 2016000, PLL_2, 3, 0, 201600, 1500, VDD_RAW(1500) },
Betas: reserved
Thanks MDJ. I will try this on Virtuous Unity 1.24.0
Removed ///
LordGeek said:
@MDJ ..
Is this Kernel strictly for the Unity builds or any build ?
Can I put this on RCMix KINGDOM ?
Click to expand...
Click to collapse
The OP says: "Compatible with: All Sense ROM's"
henrybravo said:
The OP says: "Compatible with: All Sense ROM's"
Click to expand...
Click to collapse
Yeah .. 3:51am here .. little cross-eyed at the moment .. just saw that area of the OP
is anyone else having a problem with kernel versions not showing up in the rom 'about phone'?
here is the logcat when i pull up about phone
Code:
E/HtcAboutPhonePluginManager( 1476): Regex did not match on /proc/version: Linux version 2.6.35.13-UNITY V2-g305b7a2 ([email protected]) (gcc version 4.4.3 (GCC) ) #2 PREEMPT Sun Jun 19 13:41:37 KRAST 2011
I believe that is an issue that was stated in the first post.
Sent from my Inspire 4G using XDA Premium App.
Wolf_2 said:
I believe that is an issue that was stated in the first post.
Sent from my Inspire 4G using XDA Premium App.
Click to expand...
Click to collapse
yes i realize that, but why does every other kernel show in about info? why is this one the only kernel that doesnt show? i want to know WHY its a known issue, and what we can do to fix it.....
help the community dude.
Pirateghost said:
yes i realize that, but why does every other kernel show in about info? why is this one the only kernel that doesnt show? i want to know WHY its a known issue, and what we can do to fix it.....
help the community dude.
Click to expand...
Click to collapse
It's been an issue with MDJ's kernels for quite a while. It's not a big deal, and that's probably why it hasn't been fixed.
It's a great kernel, btw.
I believe I have helped the community plenty of times in the past. I know that there are plenty of others that have done far more than I have. I was not trying to be rude or ignorant toward you. I simply thought that you may have missed that statement in the first post since your original question asked if anyone else was not able to see the kernel information, not why it does not display. As to why this is not showing like so many others display, the OP would have to elaborate as to why this is the case.
Sent from my Inspire 4G using XDA Premium App.
Scott_S said:
Why don't *you* figure it out, and help the community, instead of throwing trips on people?
Wolf_2's original comment was perfectly reasonable.
Yours, not so much.
Click to expand...
Click to collapse
cool story bro
Wolf_2 said:
I believe I have helped the community plenty of times in the past. I know that there are plenty of others that have done far more than I have. I was not trying to be rude or ignorant toward you. I simply thought that you may have missed that statement in the first post since your original question asked if anyone else was not able to see the kernel information, not why it does not display. As to why this is not showing like so many others display, the OP would have to elaborate as to why this is the case.
Sent from my Inspire 4G using XDA Premium App.
Click to expand...
Click to collapse
No need to defend your contributions dude, you've been great
Thanks IRS421 & Scott_S.
Sent from my Inspire 4G using XDA Premium App.
I have researched and figured out how to fix the kernel non display issue if it bothers anyone. Both methods were tested extensively and both work very well.
1. Don't use it. Problem solved.
2. Write the kernel information down on a post it note and stick it on your phone. The nice thing about this method is that you don't have to go into any menus to see the kernel information. It is always displayed for you. Again, problem solved.
Sent from my Inspire 4G using XDA Premium App.
Pirateghost said:
thats so helpful.....
so what i should do is recompile a kernel that someone has already done the work on just to figure out this little bug (that the OP probably knows WHY its doing this)??? why cant the OP just post an explanation as to why his kernel is the only one that does this.....i would appreciate that more than some smartass fkn answers
you guys are really helpful, thanks for that.
Click to expand...
Click to collapse
just use his new kernel found here --> http://forum.xda-developers.com/showthread.php?t=1050106 he fixed the kernel information
Doo Doo said:
here just use his new kernel here --> http://forum.xda-developers.com/showthread.php?t=1050106 he fixed the kernel information
Click to expand...
Click to collapse
thank you. thats better. glad at least one person doesnt have some smartass comment to make.
Please stay on topic and chill out.
Thanks,
Updated! Enjoy

[Q] WP7 facebook application, posting blank status updates only

Hi ive written a simple application for windows phone 7 that posts a status update to the users wall. This is all working correctly except for the fact that when the status update is done it is always empty. I am trying to make it so that the user can enter what they would like to say in a text box, but obviously so far this isnt working and all that is being sent is an empty status update. I am connecting to the facebook api and the authentication all works correctly or the post would not be sent at all. Ive searched all over the web and havent found anyone with the same issue as of yet.
Here is the status update code that I am working on:
Code:
private void PostStatusUpdate(string status, Action<bool, Exception> callback)
{
var request = HttpWebRequest.Create("https://graph.facebook.com/me/feed");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.BeginGetRequestStream((reqResult) =>
{
using (var strm = request.EndGetRequestStream(reqResult))
using (var writer = new StreamWriter(strm))
{
writer.Write("access_token=" + _accessToken);
writer.Write("&message=" + HttpUtility.UrlEncode(status));
}
request.BeginGetResponse((result) =>
{
try
{
var response = request.EndGetResponse(result);
using (var rstrm = response.GetResponseStream())
{
var serializer = new DataContractJsonSerializer(typeof(FacebookPostResponse));
var postResponse = serializer.ReadObject(rstrm) as FacebookPostResponse;
callback(true, null);
}
}
catch (Exception ex)
{
callback(false, ex);
}
}, null);
}, null);
}
[DataContract]
public class FacebookPostResponse
{
[DataMember(Name = "id")]
public string Id
{
get;
set;
}
}
private void PostUpdate_Click(object sender, RoutedEventArgs e)
{
PostStatusUpdate(this.StatusText.Text, (success, ex) =>
{
this.Dispatcher.BeginInvoke(() =>
{
if (success && ex == null)
{
MessageBox.Show("Status updated");
NavigationService.Navigate(new Uri("/Views/MainPage.xaml", UriKind.Relative));
}
else
{
MessageBox.Show("Unable to update status");
}
});
});
}
Has anyone encountered this before / know any solution to this problem?
Any insights into this would be much appreciated
You are using the asyncronous method with no callback function
Looks like you should be using a callback function - See examples here
http://msdn.microsoft.com/en-us/lib...est.begingetrequeststream(v=vs.90).aspx#Y1760
http://msdn.microsoft.com/en-us/lib...brequest.begingetrequeststream(v=vs.100).aspx
Also, did the same code work at one point?
It could be as simple as not closing your connections. I ran into this in the Weather City Editor that I wrote for Windows Mobile.
When I added code to hit accuweathers site to look up the code, I had forgotten to close the connection. I would need to wait until the connection timed out before it would work again.
I think yours is differnt though, since it is updating blank.
But, you could just use GetRequestStream, which does not need the callback function, synce it is not asyncronous. See example code: http://msdn.microsoft.com/en-us/library/d4cek6cc.aspx
Thanks for the reply
Thanks for the reply, the code has never worked so far it has only posted blank facebook statuses, I will see if adding an asynchronous call back makes a difference.
Thanks

Make your own TODO webpage automatically from your code

We have an automatic build server which you can trigger yourself at http://jenkins.casual-dev.com. As a part of the build process it generates a Todo list. This is useful for those of you who have open source projects and would like to accumulate all of your TODOs online somewhere. You can see the todo list in action here: http://builds.casual-dev.com/todo.html
How's it work? It searches the code for "TODO" or "todo" comments. When it finds one, it notes the line number, and the line itself. It attempts to remove the words "//todo" or "//TODO". Then it combines the information all together into HTML format and applies CSS from this page http://codepen.io/bennettfeely/pen/Ftczh
You will need to setup the following:
to run on a Linux/Mac computer or Cygwin under Windows with your source code. This script uses bash.
modify the outputFolder variable to the desired location of your todo.html file (possibly /var/www/)
modify the localFolder variable to the location which the trunk of your source exists (/home/adamoutler/code/project/trunk)
modify the onlineSourceBrowser to match the http address of your trunk folder.
modify the bannerpic to your own image
the script below, copied into /usr/local/bin/makeTodo.
Here is the script.
Code:
#todosite.sh creates a webpage our of todo comments and formats like Google Now
#Copyright (C) 2013 Adam Outler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#! /bin/bash
#Path to your code
startingFolder="./code/myCode";
#Path to output the HTML Todo List
outputFolder=/home/adamoutler/website/builds
#Banner picture
bannerpic='http://casual-dev.com/wp-content/uploads/2013/11/cdev.png'
#Source repository browser, for links to your code
onlineSourceBrowser="http://code.google.com/p/android-casual/source/browse/"
cd "$startingFolder"
todoSearch=$(grep -n -r -e ".*todo.*" -e ".*TODO.*" trunk 2>&1)
itemnum=0
echo ''>todolist.html
echo ''>todo.txt
#build list
while IFS= read -r line
do
if [[ $line =~ .*matches || $line =~ .*\/Libraries\/.* || $line =~ .*CASPACCASUAL/changelog.txt.* ]]; then
continue;
else
echo $line
filename=$(echo "$line"| tr -s \ |sed s/\:.*// )
friendlyname=$(echo "$filename"| tr -s \ |sed s/.*\\\/// )
friendlyname=${friendlyname/'.java'/}
linenumber=$(echo "$line"| tr -s \ | awk -F':' '{print $2}')
message=$(echo "$line"| tr -s \ |sed -es/.*:// -es/.*://)
echo "file $filename \n lineNumber $linenumber \n message $message"
URL="$onlineSourceBrowser$filename#"$linenumber
echo "<a href=\"$URL\" target="_blank"><section class=\"card\"><h1><strong>${friendlyname//./.<wbr>}</strong> line $linenumber</h1>">>todolist.html
echo "$message<hr>">>todolist.html
echo "<small><small>${filename//"/"//<wbr>}</small></small></section></a>">>todolist.html
fi
itemnum=$[$itemnum+1]
done <<< "$todoSearch"
echo '</main>'>>todolist.html
#html doc
echo '<!DOCTYPE html>
<style>
@import url(http://fonts.googleapis.com/css?family=Roboto:400,100,100italic,300,300italic,400italic,500,700,500italic,900,700italic,900italic);
* { font-family: 'Roboto', sans-serif; line-height:1.2; }
body { background:#222; }
main {
display:block;
position:relative;
margin: 3vh auto;
width:28rem;
padding: 1.5rem 0 0;
background:#d5d5d5;
outline
border-radius:.25rem;
overflow:hidden;
transform:scale(.75);
transform-origin:center 3rem;
transition:transform .3s;
}
body:hover main {
transform:scale(1);
}
header {
width:28rem;
position:absolute;
z-index:0;
top:0; left:0; right:0;
height:8rem;
margin: 0vh auto;
background:url('$bannerpic') no-repeat center center;
background-size:100%;
}
body {
display: block;
margin: 0px;
}
input, .card {
position:relative;
z-index:2;
}
input {
left: -12rem;
display: block;
width: 24rem;
margin-left: 50%;
margin-top: 3.7rem;
border: 0;
font-size: 1.2rem;
padding: .75rem 1rem;
border-radius: 3px;
box-shadow: 0 1px 2px #aaa;
transition: .5s, margin-bottom .15s;
}
input:focus + header {
transform:translate3d(0,-10rem,0);
opacity:0;
}
.card {
padding:1.5rem;
box-shadow:0 1px 2px #aaa;
background:white;
margin:0 1rem 1rem;
border-radius:3px;
user-select:none;
animation:fly-in-from-left .5s 1s ease both;
transform-origin:top left;
}
.card:nth-child(even){
animation-name:fly-in-from-right;
animation-delay:1.1s;
transform-origin:top right;
}
@keyframes fly-in-from-left {
from {
transform:translateY(15rem) rotate(15deg);
opacity:0;
}
}
@keyframes fly-in-from-right {
from {
transform:translateY(15rem) rotate(-15deg);
opacity:0;
}
}
a {
color: inherit;
text-decoration: none;
font-weight:inherit;
}
a:visited{
color: inherit;
text-decoration: none;
font-weight:inherit;
}
a:hover
{
color: inherit;
text-decoration:none;
cursor:pointer;
}
.card:after {
position:absolute;
font-size:.9rem;
top:1.5rem;
right:1rem;
content:"i";
border:thin solid gray;
color:gray;
width:1rem;
line-height:1rem;
text-align:center;
border-radius:50%;
pointer-events:none;
}
h1 {
font-size:2rem;
font-weight:200;
}
strong {
font-weight:300;
color:#539D00;
}
h2 {
font-size:.9rem;
line-height:2.5;
color:gray;
font-weight:400;
}
.map {
background:whitesmoke;
margin:.5rem 0 0 -1.5rem;
width:28rem;
}</style>
</style><meta name="viewport" content="target-densitydpi=device-dpi, initial-scale=1.0, user-scalable=no" />
<head>
</head>
<body>
<meta name="viewport" content="width=device-width" />
'>todo.html
#header
echo '<header></header>
<form class="iform" id="iform"><input placeholder="Search, or say Ok Google" x-webkit-speech autocomplete="off" type="text" onKeyPress='"open('http://example.com/submit.php?url='+escape(q),'','resizable,location,menubar,toolbar,scrollbars,status');"'</form>
<main>
<section class="card"><h2>TODO list: '$itemnum' items</h2></section>
' >>todo.html
#list
cat todolist.html >>todo.html
rm todolist.html
cp todo.html "$outputFolder"
cat todo.txt
After the setup described above, it runs with the command "makeTodo" and will generate a webpage which contains clickable links to the exact lines of code which require "todo"ing. I hope this is helpful.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Good work! @AdamOutler :good:
Wow, it's really nice...!
Nice Work...
Very nice Script.
I am sure this will definately Help...
I will give it a Try. ..

How to Read PDF file Without save on Local storage windows phone 8 C#

I need to open pdf file without store on local storage. i tried this code but i am facing some issues when i am try to read pdf file through PDF Reader, Adobe Reader, etc. after click back navigation i deleted current file from local folder. But after closed my application and I am directly open PDF Reader, Adobe Reader... etc. File is exist(still have on my library). I could not delete the file. Please let me know is possible on windows phone 8 C#.
please see my code below.
Code:
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
try
{
using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var fileStream = store.OpenFile("your-file.pdf", FileMode.Truncate, FileAccess.ReadWrite, FileShare.ReadWrite))
{
fileStream.Flush();
fileStream.Close();
if (store.FileExists("your-file.pdf"))
{
store.DeleteFile("your-file.pdf");
}
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
await local.DeleteAsync(StorageDeleteOption.PermanentDelete);
}
}
}
catch
{
//File does not exist.
}
}
private async void Button_Click(object sender, RoutedEventArgs e)
{
//RestSharp from Nuget
var client = new RestClient("https://dvtp17lb47b1q.cloudfront.net");
var request = new RestRequest("/magazine/file/PDF-2.pdf?c34tP5IxEK=2b26c756615a40844a6564d13a3eb875", Method.GET);
var response = await client.ExecuteTaskAsync(request);
byte[] buffer = response.RawBytes;
using (IsolatedStorageFile storageFile = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = storageFile.OpenFile("your-file.pdf", FileMode.Create))
{
await stream.WriteAsync(buffer, 0, buffer.Length);
}
}
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile pdffile = await local.GetFileAsync("your-file.pdf");
// Launch the pdf file.
Windows.System.Launcher.LaunchFileAsync(pdffile);
}
Main Functionality is only read the pdf file without saving.

Categories

Resources