{"id":85,"date":"2013-07-28T07:55:00","date_gmt":"2013-07-27T22:55:00","guid":{"rendered":"https:\/\/www.picolix.jp\/blog\/2013\/07\/android.html\/"},"modified":"2019-04-02T10:26:54","modified_gmt":"2019-04-02T01:26:54","slug":"android","status":"publish","type":"post","link":"https:\/\/www.picolix.jp\/blog\/2013\/07\/android.html","title":{"rendered":"Android \u3067\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc"},"content":{"rendered":"<p>\u524d\u56de\u306e\u5bbf\u984c\u3067\u3001Android\u3067\u30a2\u30d7\u30ea\u304b\u3089\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u3092\u53d6\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p>Android\u3067\u30a2\u30d7\u30ea\u304b\u3089\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u3092\u53d6\u308b\u306b\u306froot\u6a29\u9650\u304c\u306a\u3044\u3068\u3060\u3081\u3067\u3059\u3002\uff08\u4e00\u90e8\u6a5f\u7a2e\u3067root\u3092\u53d6\u3089\u306a\u304f\u3066\u3082\u3067\u304d\u308b\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002\uff09<\/p>\n<p>Android 4.0\u4ee5\u964d\u3067\u306f\u3001root\u5316\u3057\u3066\u3042\u308c\u3070screencap,screenshot\u30b3\u30de\u30f3\u30c9\u3067\u7c21\u5358\u306b\u3068\u308c\u308b\u306e\u3067\u3059\u304c\u3001Android \u30d0\u30fc\u30b8\u30e7\u30f32.3\u3067\u306f\u4f7f\u3048\u307e\u305b\u3093\u3002<br \/>\n\u30d5\u30ec\u30fc\u30e0\u30d0\u30c3\u30d5\u30a1\u30fc\u3000\/dev\/graphics\/fb0\u304b\u3089\u76f4\u63a5\u53d6\u5f97\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\uff08\u3053\u306e\u30c7\u30d0\u30a4\u30b9\u306f,root\u3067\u306a\u3044\u3068\u30a2\u30af\u30a2\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002\uff09<\/p>\n<p>Android 4.0\u4ee5\u964d\u3067\u306f\u3001\u96fb\u6e90\u30dc\u30bf\u30f3+\u30dc\u30ea\u30e5\u30fc\u30e0\uff08\u2193\uff09\u540c\u6642\u62bc\u3057\u3067\u53d6\u308c\u307e\u3059\u304c\u3001\u30a2\u30d7\u30ea\u3067\u3053\u306e\u30ad\u30fc\u306e\u30a8\u30df\u30e5\u30ec\u30fc\u30c8\u3092\u3057\u3066\u3082\u3001\u300c\u96fb\u6e90\u30dc\u30bf\u30f3\u300d\u62bc\u4e0b\u306f\u3001\u3084\u306f\u308aroot\u3067\u306a\u3044\u3068\u53cd\u5fdc\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\n\u4eca\u56de\u3001\u81ea\u5206\u4f7f\u7528\u3057\u3066\u3044\u308b\u6a5f\u7a2e\uff1aSONY Xperia SO-01C 480&#215;854 Android \u30d0\u30fc\u30b8\u30e7\u30f32.3.2\u3067\u306f\u3001Google Play\u306b\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u308b\u30c4\u30fc\u30eb\u306f\u3069\u308c\u3082\u6b63\u5e38\u306b\u3068\u308c\u306a\u3044\u306e\u3067\u3059\u3002\u8d64\u307f\u304c\u304b\u304b\u3063\u305f\u753b\u50cf\u306b\u306a\u308b\u3002RBGA\u306e\u914d\u5217\u304c\u9055\u3046\u3088\u3046\u3067\u3059\u3002\u3057\u304b\u305f\u304c\u306a\u3044\u306e\u3067\u4f5c\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n<p>\u81ea\u5206\u306e\u30b9\u30de\u30db\u306froot\u3092\u53d6\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4eca\u56de\u306f\u3046\u307e\u304f\u3044\u3051\u3070\u3001\u30a2\u30d7\u30ea\u306b\u3059\u308b\u4e88\u5b9a<br \/>\n\uff08\u516c\u958b\u306f\u4eca\u306e\u3068\u3053\u308d\u8003\u3048\u3066\u3044\u307e\u305b\u3093\u3002\uff09<\/p>\n<p>1) \u30d5\u30ec\u30fc\u30e0\u30d0\u30c3\u30d5\u30a1\u30fc\u304b\u3089\u751f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97<br \/>\n#cp \/dev\/graphics\/fb0 \/sdcard\/fb0<\/p>\n<p>fb\u306e\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u306f\u30013,410,432\u3067\u3001480&#215;854\u30671\u30d4\u30af\u30bb\u30eb4\u30d0\u30a4\u30c8\u3068\u3059\u308b\u3068<br \/>\n+,-,x,\/\u3092\u601d\u8003\u932f\u8aa4\u3057\u3066\u4ee5\u4e0b\u306e\u5f0f\u306b\u305f\u3069\u308a\u3064\u3044\u305f\u3002<\/p>\n<p>(3410432-(65536 x 2))\/2 = 480 x 854 x 4<\/p>\n<p>\u3067\u3001\u5143\u30b5\u30a4\u30ba\u304b\u308965536&#215;2\u30d0\u30a4\u30c8\u4f59\u5206\u5f15\u3044\u3066\u3001\u30c0\u30d6\u30eb\u30d0\u30c3\u30d5\u30a1\u30ea\u30f3\u30b0\u3057\u3066\u3044\u308b\u306e\u30671\/2\u3059\u308b\u3068\u3001\u3061\u3087\u3046\u3069480 x 854 x 4\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>2) \u7121\u7406\u3084\u308aBMP\u306b\u3057\u3066\u307f\u308b\u3002<\/p>\n<p>fb0\u306b\u30d8\u30c3\u30c0\u30fc54\u30d0\u30a4\u30c8\u3092\u52a0\u3048\u307e\u3059\u3002<br \/>\nunsigned char header[54] = {<br \/>\n&nbsp; &nbsp; 0x42, 0x4d, 0x36, 0x05, 0x19, 0x00, 0x00, 0x00,0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,<br \/>\n\u3000\u30000x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x56, 0x03,0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,<br \/>\n\u3000\u30000x00, 0x00, 0x00, 0x05, 0x19, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br \/>\n&nbsp; &nbsp; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00<br \/>\n};<\/p>\n<div class=\"separator\" style=\"clear: both; text-align: left;\">\n<a href=\"https:\/\/www.picolix.jp\/blog\/wp-content\/uploads\/2013\/07\/fb0-000.png\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" height=\"320\" src=\"https:\/\/www.picolix.jp\/blog\/wp-content\/uploads\/2013\/07\/fb0-000.png\" width=\"179\" \/><\/a><\/div>\n<p>\n\u4e00\u5fdc\u3001\u753b\u50cf\u306b\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u4e0a\u4e0b\u53cd\u8ee2\u3057\u3066\u3001\u8272\u3082\u5c11\u3057\u304a\u304b\u3057\u3044\u3067\u3059\u3002\uff32\u3068\uff22\u304c\u5165\u308c\u66ff\u308f\u3063\u3066\u308b\u3002<\/p>\n<p>3) \u30c7\u30fc\u30bf\u5909\u63db\u3059\u308b\u3002\u884c\u5358\u4f4d\u3067\u4e0a\u4e0b\u3092\u5909\u63db\u3057\u3001BGRA -&gt; RGBA\u306b\u3059\u308b\u3002<\/p>\n<p>\n#include &lt;stdio.h&gt;<br \/>\n#include &lt;fcntl.h&gt;<br \/>\n#include &lt;sys\/types.h&gt;<br \/>\n#include &lt;sys\/stat.h&gt;<br \/>\n#include &lt;io.h&gt;<\/p>\n<p>#define BMP_SIZE (3410432-(65536*2))\/2<\/p>\n<p>unsigned char srcdata[BMP_SIZE];<br \/>\nunsigned char outdata[BMP_SIZE];<\/p>\n<p>unsigned char header[54] = {<br \/>\n&nbsp; &nbsp; 0x42, 0x4d, 0x36, 0x05, 0x19, 0x00, 0x00, 0x00,0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00,<br \/>\n&nbsp; &nbsp; 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x56, 0x03,0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00,<br \/>\n&nbsp; &nbsp; 0x00, 0x00, 0x00, 0x05, 0x19, 0x00, 0x00, 0x00,0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,<br \/>\n&nbsp; &nbsp; 0x00, 0x00, 0x00, 0x00, 0x00, 0x00<br \/>\n};<\/p>\n<p>int main(int argc, char *argv[]){<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>int fd,fd_out;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>long i,j;<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>unsigned char c;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>unsigned char *p;<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>fd = _open(&#8220;fb0&#8221;,O_RDONLY | O_BINARY );<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>if(fd == (-1)){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>return(-1);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>}<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>p = srcdata;<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/_read(fd,srcdata , 3410432 &#8211; (65536 * 2));<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>for(i = 0 ; i &lt; BMP_SIZE ; i+= 53760){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>_read(fd,p,53760);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>p += 53760;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>printf(&#8220;%in&#8221;,i);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>}<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>fd_out = _open(&#8220;fb0-001.bmp&#8221;,O_CREAT | O_WRONLY | O_TRUNC | O_BINARY,S_IREAD | S_IWRITE );<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>if(fd_out == (-1)){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>return(-1);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>}<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/\u3053\u308c\u3060\u3068\u3001\u4e0a\u4e0b\u9006\u3055\uff06\u8272\u629c\u3051(R&lt;-&gt;B)<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/_write(fd_out,header,54);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/_write(fd_out,srcdata,(3410432 &#8211; (65536 * 2))\/2);<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>unsigned int width = 480;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>unsigned int height = BMP_SIZE &nbsp;\/ 480 \/ 4;<\/p>\n<p>\n&nbsp; &nbsp; &nbsp; &nbsp; \/\/\u4e0a\u4e0b\u53cd\u8ee2<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>for(i = 0; i &lt; height; i++){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>for(j = 0; j &lt; width * 4; j++){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>outdata[(height &#8211; 1 &#8211; i) * width * 4 + j] = srcdata[i * width * 4 + j];<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>}<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>}<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>\/\/R,B\u5165\u308c\u66ff\u3048<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>int cnv = 0;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>for(i = 0 ; i &lt; BMP_SIZE ; i += 2){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>if(cnv == 0){<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>p = &amp;outdata[i];<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>c = outdata[i];<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>cnv++;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>}else{<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>*p = outdata[i];<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>outdata[i] = c;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">   <\/span>cnv = 0;<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\">  <\/span>}<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>}<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>_write(fd_out,header,54);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>_write(fd_out,outdata,BMP_SIZE);<\/p>\n<p><span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>_close(fd);<br \/>\n<span class=\"Apple-tab-span\" style=\"white-space: pre;\"> <\/span>_close(fd_out);<br \/>\n}<\/p>\n<div class=\"separator\" style=\"clear: both; text-align: left;\">\n<a href=\"https:\/\/www.picolix.jp\/blog\/wp-content\/uploads\/2013\/07\/fb0-001.png\" imageanchor=\"1\" style=\"margin-left: 1em; margin-right: 1em;\"><img decoding=\"async\" loading=\"lazy\" border=\"0\" height=\"320\" src=\"https:\/\/www.picolix.jp\/blog\/wp-content\/uploads\/2013\/07\/fb0-001.png\" width=\"179\" \/><\/a><\/div>\n<p>\n\u3053\u3046\u3059\u308b\u3068\u3001\u6b63\u5e38\u306a\u753b\u9762\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u3067\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u30c4\u30fc\u30eb\u304c\u4f5c\u308c\u307e\u3059\u3002\uff08\u8981root)<\/p>\n<p>\uff0aroot\u5316\u72b6\u614b\u3067\u30d1\u30ba\u30c9\u30e9\u3092\u52d5\u304b\u3059\u3068\u30c7\u30fc\u30bf\u304c\u521d\u671f\u5316\u3055\u308c\u307e\u3059\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002\u3068\u3044\u3063\u3066\u3082\/system\/bin\/su,\/system\/xbin\/su,\/sbin\/su\u306e\u3088\u3046\u306bsu\u304c\u306a\u3051\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<p>\n\u53c2\u8003\uff1a<br \/>\n\u30d3\u30c3\u30c8\u30de\u30c3\u30d7\u30d5\u30a9\u30fc\u30de\u30c3\u30c8<br \/>\n<a href=\"http:\/\/www.kuwalab.net\/technics\/bitmap\/\">http:\/\/www.kuwalab.net\/technics\/bitmap\/<\/a><br \/>\nRGB565\u306e\u6642\u306f\u300116bit \u306e\u30c7\u30fc\u30bf\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306a\u306e\u3067<br \/>\n\u5c11\u3057\u8abf\u6574\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n<a href=\"http:\/\/android-dev-log.ldblog.jp\/archives\/11346611.html\">http:\/\/android-dev-log.ldblog.jp\/archives\/11346611.html<\/a><\/p>\n<div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306e\u5bbf\u984c\u3067\u3001Android\u3067\u30a2\u30d7\u30ea\u304b\u3089\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u3092\u53d6\u308b\u65b9\u6cd5\u3067\u3059\u3002 Android\u3067\u30a2\u30d7\u30ea\u304b\u3089\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc\u3092\u53d6\u308b\u306b\u306froot\u6a29\u9650\u304c\u306a\u3044\u3068\u3060\u3081\u3067\u3059\u3002\uff08\u4e00\u90e8\u6a5f\u7a2e\u3067root\u3092\u53d6\u3089\u306a\u304f\u3066\u3082\u3067\u304d\u308b\u3082\u306e\u3082\u3042\u308a\u307e &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.picolix.jp\/blog\/2013\/07\/android.html\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Android \u3067\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30ad\u30e3\u30d7\u30c1\u30e3\u30fc&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[4,6],"_links":{"self":[{"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/posts\/85"}],"collection":[{"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":1,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":1319,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions\/1319"}],"wp:attachment":[{"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.picolix.jp\/blog\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}