1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
|
#!/bin/sh
if [ ${USER} == "root" ]
then
# Change file owner
chown -R 5000:5000 /opt/apps/org.tizen.browser/data
fi
##### Bookmark ######
if [ ! -f /opt/dbspace/.internet_bookmark.db ];
then
sqlite3 /opt/dbspace/.internet_bookmark.db 'PRAGMA journal_mode=PERSIST;
CREATE TABLE bookmarks(id INTEGER PRIMARY KEY AUTOINCREMENT, type INTEGER, parent INTEGER, address, title, creationdate, sequence INTEGER, updatedate, visitdate, editable INTEGER, accesscount INTEGER, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);
create index idx_bookmarks_on_parent_type on bookmarks(parent, type);
insert into bookmarks (type, parent, title, creationdate, editable, sequence, accesscount) values(1, 0, "Bookmarks", DATETIME("now"), 0, 1, 0);'
fi
##### History ######
if [ ! -f /opt/dbspace/.browser-history.db ];
then
sqlite3 /opt/dbspace/.browser-history.db 'PRAGMA journal_mode=PERSIST;
CREATE TABLE history(id INTEGER PRIMARY KEY AUTOINCREMENT, address, title, counter INTEGER, visitdate DATETIME, favicon BLOB, favicon_length INTEGER, favicon_w INTEGER, favicon_h INTEGER);'
fi
##### Geolocation ######
if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db ];
then
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db 'PRAGMA journal_mode=PERSIST;
create table geolocation(id integer primary key autoincrement, address, accept INTEGER,updatedate DATETIME);'
fi
##### Password ######
if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-credential.db ];
then
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-credential.db 'PRAGMA journal_mode=PERSIST;
create table passwords(id integer primary key autoincrement, address, login, password)'
fi
#### USER AGENTS #####
#initDB
#rm /opt/apps/org.tizen.browser/data/db/.browser.db
# create db
#FILE = /opt/apps/org.tizen.browser/data/db/.browser.db
if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser.db ];
then
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
create table user_agents(name primary key, value)'
# mobile
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
insert into user_agents values("Galaxy S", "Mozilla/5.0 (Linux; U; Android 2.3.7; en-gb; GT-I9000 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
insert into user_agents values("Galaxy S II", "Mozilla/5.0 (Linux; U; Android 2.3.5; en-gb; GT-I9100 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
insert into user_agents values("Galaxy S III", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-gb; GT-I9300 Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30");
insert into user_agents values("SLP Galaxy", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; GT-I9500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
insert into user_agents values("Tizen", "Mozilla/5.0 (Linux; U; Tizen 1.0; en-us) AppleWebKit/534.46 (KHTML, like Gecko) Mobile Tizen Browser/1.0");
insert into user_agents values("Galaxy Nexus", "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; Galaxy Nexus Build/IML74K) AppleWebKit/535.7 (KHTML, like Gecko) Mobile Safari/535.7");
insert into user_agents values("Samsung", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-I9200/1.0; U; Linux/SLP/2.0; ko-kr) AppleWebKit/534.4 (KHTML, like Gecko) Dolfin/2.0 Mobile");
insert into user_agents values("Samsung Dolfin", "SAMSUNG-GT-S8500/S8500XXJD2 SHP/VPP/R5 Dolfin/2.0 Nextreaming SMM-MMS/1.2.0 profile/MIDP-2.1 configuration/CLDC-1.1");
insert into user_agents values("Apple iPhone 3", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7E18 Safari/528.16");
insert into user_agents values("Apple iPhone 4", "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5");
insert into user_agents values("Apple iOS 5", "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A405 Safari/7534.48.3");
insert into user_agents values("Android 2.3 (Nexus One)", "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Nexus One Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
insert into user_agents values("Opera Mobi", "Opera/9.80 (Windows NT 6.1; U; Edition IBIS; en) Presto/2.6.30 Version/10.63");
insert into user_agents values("Samsung Bada", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/1.0; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WVGA SMM-MMS/1.2.0 OPN-B");
insert into user_agents values("Orange TV", "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 OrangeAppliTV/2.3.9");
insert into user_agents values("Chrome Browser for android", "Mozilla/5.0 (Linux; U; Android 4.0.1; ko-kr; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7");
insert into user_agents values("MANGO(Nokia 800C)", "Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Nokia; 800C)");
insert into user_agents values("System user agent", "");
insert into user_agents values("Samsung Bada 2.0", "Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8500/1.0; U; Bada/2.0; en-us) AppleWebKit/534.20 (KHTML, like Gecko) Mobile WVGA SMM-MMS/1.2.0 OPN-B Dolfin/3.0")'
# desktop
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser.db 'PRAGMA journal_mode=PERSIST;
insert into user_agents values("Samsung Desktop", "Mozilla/5.0 (U; Linux/SLP/2.0; ko-kr) AppleWebKit/533.1 (KHTML, like Gecko)");
insert into user_agents values("Firefox 5", "Mozilla/5.0 (Windows NT 6.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1");
insert into user_agents values("Firefox 5 Fennec(Mobile)", "Mozilla/5.0 (Android; Linux armv7l; rv:5.0) Gecko/20110615 Firefox/5.0 Fennec/5.0");
insert into user_agents values("Safari 5.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7");
insert into user_agents values("Google Chrome 18.0", "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.16 (KHTML, like Gecko) Chrome/18.0.1003.1 Safari/535.16");
insert into user_agents values("Internet Explorer 9", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
insert into user_agents values("Galaxy Tab 10.1", "Mozilla/5.0 (Linux; U; Android 3.0.1; en-us; GT-P7100 Build/HRI83) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13");
insert into user_agents values("iPad 2", "Mozilla/5.0 (iPad; U; CPU OS 4_3_5 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8L1 Safari/6533.18.5")'
fi
#init cookies DB
#rm /optpps/org.tizen.browser/data/db/dbspace/.browser-cookies.db
# create cookies db
#FILE = /opt/apps/org.tizen.browser/data/db/.browser-cookies.db
if [ ! -f /opt/apps/org.tizen.browser/data/db/.browser-cookies.db ];
then
sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'CREATE TABLE moz_cookies (id INTEGER PRIMARY KEY, name TEXT, value TEXT, host TEXT, path TEXT,expiry INTEGER, lastAccessed INTEGER, isSecure INTEGER, isHttpOnly INTEGER);'
#test cookie
#sqlite3 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db 'INSERT INTO moz_cookies values(NULL, "cookies_name_test", "cookies_value_test", "www.cookies_test.com", "cookies_path_test", 2011, NULL, 1, 0);'
fi
# Change db file owner & permission
if [ ${USER} == "root" ]
then
#chown root:root /opt/apps/org.tizen.browser/data/db
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser.db-journal
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal
chown :6002 /opt/dbspace/.browser-history.db
chown :6002 /opt/dbspace/.browser-history.db-journal
chown :6002 /opt/dbspace/.internet_bookmark.db
chown :6002 /opt/dbspace/.internet_bookmark.db-journal
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db
chown :6002 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db-journal
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser.db-journal
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-cookies.db-journal
chmod 666 /opt/dbspace/.browser-history.db
chmod 666 /opt/dbspace/.browser-history.db-journal
chmod 660 /opt/dbspace/.internet_bookmark.db
chmod 660 /opt/dbspace/.internet_bookmark.db-journal
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-credential.db-journal
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db
chmod 660 /opt/apps/org.tizen.browser/data/db/.browser-geolocation.db-journal
fi
##################################################
# set default vconf values
##################################################
if [ ${USER} == "root" ]
then
vconftool set -t string db/browser/browser_user_agent "System user agent" -g 6514 -f
vconftool set -t string db/browser/custom_user_agent "" -g 6514 -f
else
vconftool set -t string db/browser/browser_user_agent "System user agent" -f
vconftool set -t string db/browser/custom_user_agent "" -f
fi
|