Page 1 of 2
[SOLVED] Where is homepage stored? Editing fbuxCache.db
Posted: Fri May 04, 2012 3:26 pm
by juusso
Does anyone know/found this? Which file? I would like to set homepage, but can`t find where. (sure w/o to start the Browser)
for example, favorites are stored in /mtd_rwarea/favorites.dat and favorites.datb.
/mtd_rwcommon/webkit/etc/WebkitPlugin/ServerConfigurations/searchPageConfig.xml has:
Code: Select all
<home>
<startpage><![CDATA[http://url.com]]></startpage>
</home>
But home set manually from browser didn`t apeared here.
EDIT: Need to set homepage as
http://localhost to get new WebIF on the screen per default.
Manually works nice.
Re: Where is homepage stored on TV?
Posted: Sun May 06, 2012 10:21 am
by DEUS
hi maybe you expected a answer from me. got it, there is fbuxCache.db in the upper directory, a SQL databasefile the relevant string in Hexeditor is marked.
now its problem is to edit, but shouldnt be to hard, any database tools on tv?
If you want set infopage as frame startpage and do some color to Navigation, as already on your pictures.
Re: Where is homepage stored on TV?
Posted: Mon May 07, 2012 9:03 am
by juusso
t.y.
i don`t see any problem to replace whole database file

Re: Where is homepage stored on TV?
Posted: Mon May 07, 2012 8:36 pm
by arris69
Re: Where is homepage stored on TV?
Posted: Tue May 08, 2012 5:12 pm
by juusso
Some short look at the fbuxCache.db using simple
firefox addon.
fbuxCache_db.png
The attached console tool quits w/o any sign of life.
Code: Select all
. /dtv/SGO.env
sqlite3
sqlite3 ?
sqlite3 --help
sure required files are placed and chmoded
Code: Select all
opt/privateer/usr/sbin/sqlite3
opt/privateer/lib/libsqlite3.so.0
EDIT: i must say "sorry". I was confused because nc doesn`t give any prompt. Double checked once again and binary made by arris works for reading, but gives errors on some writing commands (UPDATE made segmentation fault). But static linked binary for same command worked well as expected.
Code: Select all
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "UPDATE BrowserStateSET HomeURL='$HOMEPAGE'";
Segmentation fault
Re: Where is homepage stored? Editing fbuxCache.db
Posted: Wed May 09, 2012 12:18 pm
by juusso
Just compilled statically linked sqlite3, first impression is ok. Runs on B series and D series as well.
Code: Select all
wget http://sqlite.org/sqlite-autoconf-3071100.tar.gz
tar -zxvf ./sqlite-autoconf-3071100.tar.gz
cd ./sqlite-autoconf-3071100
./configure --disable-shared --enable-static
make clean
make all
EDIT: Success by changing/editing/updating any field.
Code: Select all
# nc 192.168.1.202 1023
. /dtv/SGO.env
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db
.database
seq name file
--- --------------- ----------------------------------------------------------
0 main /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db
.mode line
SELECT * FROM BrowserState;
PrivateBrowsingState = Off
BrowserFirstTimeStart = 0
CleanSiteState = Off
PopUpBlockState = On
AdBlockState = Off
HomeURL = http://localhost
NewPageState = frequency
BookmarkListState = channel
HistoryState = date
CleanSitePassWd = 0000
BookMarkViewType = grid
PIPDisplayPosition = 1
PIPStatus = 1
PIPSound = 0
EncodingAutoState = On
PointerSpeed = 3
IsUserHomeURL = 1
SELECT HomeURL FROM BrowserState;
http://localhost
UPDATE BrowserState SET HomeURL='http://samygo.tv';
SELECT * FROM BrowserState;
PrivateBrowsingState = Off
BrowserFirstTimeStart = 0
CleanSiteState = Off
PopUpBlockState = On
AdBlockState = Off
HomeURL = http://samygo.tv
NewPageState = frequency
BookmarkListState = channel
HistoryState = date
CleanSitePassWd = 0000
BookMarkViewType = grid
PIPDisplayPosition = 1
PIPStatus = 1
PIPSound = 0
EncodingAutoState = On
PointerSpeed = 3
IsUserHomeURL = 1
SELECT HomeURL FROM BrowserState;
HomeURL = http://samygo.tv
Editing required data from script:
Set homepage:
Code: Select all
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "UPDATE BrowserState SET HomeURL='http://forum.samygo.tv'";
read homepage
Code: Select all
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "SELECT HomeURL FROM BrowserState";
http://forum.samygo.tv
read whole table
Code: Select all
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "SELECT * FROM BrowserState";
Off|0|Off|On|Off|http://forum.samygo.tv|frequency|channel|date|0000|grid|1|1|0|On|3|1
..and... a bit other approach:
Code: Select all
HOMEPAGE='http://localhost'
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "UPDATE BrowserState SET HomeURL='$HOMEPAGE'";
sqlite3 /mtd_rwcommon/webkit/etc/WebkitPlugin/fbuxCache.db "SELECT HomeURL FROM BrowserState";
http://localhost
After changing database Browser must restart to use changed values.
@DEUC, needed to make queries for php/cgi
@arris, do we have php sqlite extension enabled on TV already? Then probably we don`t need any console tools...
http://fwebde.com/php/sqlite-php/ wrote:Code: Select all
try {
$db = new PDO('sqlite:/path/to/database.db');
} catch (Exception $e) {
die($e);
}
Code: Select all
< ?php
// PHP SQLite3 demo
// Connect to the database with PDO
try {
$db = new PDO('sqlite:/var/www/sqlite/database.db');
} catch (Exception $e) {
die ($e);
}
// Insert a post into the DB
if (isset($_POST['title']) && isset($_POST['content'])) {
try {
// Create a prepared statement
$stmt = $db->prepare("INSERT INTO POSTS (title, content) VALUES (:title, :content);");
$stmt->bindParam(':title', $title);
$stmt->bindParam(':content', $content);
// Fill in the values
$title = $_POST['title'];
$content = $_POST['content'];
$stmt->execute();
} catch (Exception $e) {
die ($e);
}
}
// Get posts from database
try {
$posts = $db->prepare('SELECT * FROM posts;');
$posts->execute();
} catch (Exception $e) {
die ($e);
}
?>
<h1>Posts - SQLite Example</h1>
< ?php while ($post = $posts->fetchObject()): ?>
<h2>< ?php echo $post->title ?></h2>
< ?php echo $post->content ?>
< ?php endwhile; ?>
<hr />
<h2>Add new Post</h2>
<form action="" method="post">
<p>
<label for="title">Title:</label>
<input type="text" name="title" />
</p>
<p>
<textarea name="content" rows="8" cols="50"></textarea>
</p>
<p>
<input type="submit" name="submit" value="Submit" />
</p>
</form>
Re: [SOLVED] Where is homepage stored? Editing fbuxCache.db
Posted: Thu May 10, 2012 7:51 am
by DEUS
does phpinfo say anything about sql? if not need to add it ( 5.2 not by default, needs client libary and --with-mysql=/usr when build), also would go then for the php editing.
and we just need current page, set localhost and set custom right, so just a hand full commands, or want to edit some config as well?
Re: [SOLVED] Where is homepage stored? Editing fbuxCache.db
Posted: Thu May 10, 2012 11:05 am
by arris69
juuso wrote:...
@arris, do we have php sqlite extension enabled on TV already? Then probably we don`t need any console tools...
...]
code create some db-file on b-series but not checked if table is created. and don't know about situarion on c- d- series...
Code: Select all
<?php
if ($db = new SQLiteDatabase('filename')) {
$q = @$db->query('CREATE TABLE IF NOT EXISTS tablename (id int, requests int, PRIMARY KEY (id))');
} else {
echo ("shit". PHP_EOL);
}
?>
Re: [SOLVED] Where is homepage stored? Editing fbuxCache.db
Posted: Thu May 10, 2012 11:13 am
by juusso
DEUS wrote:does phpinfo say anything about sql?
Code: Select all
mysql_config' '--with-pdo-mysql=/<...>/usr'
'mysql_config' '--without-pdo-sqlite=/<...>/usr'
SQLite
SQLite support enabled
PECL Module version 2.0-dev $Id: sqlite.c 298697 2010-04-28 12:10:10Z iliaa $
SQLite Library 2.8.17
SQLite Encoding iso8859
also would go then for the php editing.
ok. but console for me is much more easier than php... it`s yours horse.
and we just need current page, set localhost and set custom right, so just a hand full commands, or want to edit some config as well?
I think not only homepage, here we could change almost all settings, what normally we have to change in browser, using RC.
Re: [SOLVED] Where is homepage stored? Editing fbuxCache.db
Posted: Thu May 10, 2012 11:20 am
by arris69
so full working example , stolen from :
http://www.switchonthecode.com/tutorial ... -databases
Code: Select all
<?php
try
{
//create or open the database
$database = new SQLiteDatabase('myDatabase.sqlite', 0666, $error);
}
catch(Exception $e)
{
die($error);
}
$query = 'CREATE TABLE Movies ' .
'(Title TEXT, Director TEXT, Year INTEGER)';
if(!$database->queryExec($query, $error))
{
die($error);
}
//insert data into database
$query =
'INSERT INTO Movies (Title, Director, Year) ' .
'VALUES ("The Dark Knight", "Christopher Nolan", 2008); ' .
'INSERT INTO Movies (Title, Director, Year) ' .
'VALUES ("Cloverfield", "Matt Reeves", 2008); ' .
'INSERT INTO Movies (Title, Director, YEAR) ' .
'VALUES ("Beverly Hills Chihuahua", "Raja Gosnell", 2008)';
if(!$database->queryExec($query, $error))
{
die($error);
}
//read data from database
$query = "SELECT * FROM Movies";
if($result = $database->query($query, SQLITE_BOTH, $error))
{
while($row = $result->fetch())
{
print("Title: {$row['Title']} <br />" .
"Director: {$row['Director']} <br />".
"Year: {$row['Year']} <br /><br />");
}
}
else
{
die($error);
}
?>