maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Connman hacking (https://talk.maemo.org/showthread.php?t=100693)

Halftux 2019-03-10 20:06

Connman hacking
 
3 Attachment(s)
On Sailfish there is this connman, so for me I heard it the first time. However it seems this is not the only place where connman is used.

Here is some info:
https://01.org/connman
https://wiki.archlinux.org/index.php/ConnMan
http://www.embedded-computing.com/iot/the-connman

Source code:
https://git.merproject.org/mer-core/connman
https://git.merproject.org/mer-core/libconnman-qt
https://github.com/sailfishos/sailfi...lugin-iptables

Example Internet connection through USB:
https://together.jolla.com/question/...n-through-usb/

Looking through our forum I found these bt on and off dbus commands.

https://talk.maemo.org/showpost.php?...33&postcount=4

And you can use the same for wifi and gps too. Just replace the stars with wifi, gps or bluetooth.
on
Code:

dbus-send --system --print-reply --dest=net.connman /net/connman/technology/*** net.connman.Technology.SetProperty string:"Powered" variant:boolean:true
off
Code:

dbus-send --system --print-reply --dest=net.connman /net/connman/technology/*** net.connman.Technology.SetProperty string:"Powered" variant:boolean:false
Ok so far nothing new. What I really would like to know is the control of dhcp and iptables. If somebody know something it would be wounderful.

I looked in the cmst gui for connman and gave it a try. So it is a standard qt widget application so there is not so much to expect only problems and ugly look. But after a little tweeking it is working. I think partially so far I didn't test everything. So I removed the systray and replaced one combobox with listwidget.
So it is worth to look into the source code from cmst if you are interested in connman. Will add my not fully tested experimental binary. Be aware that this app runs as root!!!!

Maybe more to come in the future.

Halftux 2019-03-10 21:34

Re: Connman hacking
 
Oh btw there is a mistake in one of the pictures :D
A small bug in the software. I used the January 2019 release.
Who find it first can name it.:) Hint: for germans it is easier.

PamNor 2019-03-10 22:10

Re: Connman hacking
 
Beenden -> Exit

Halftux 2019-03-10 22:22

Re: Connman hacking
 
Quote:

Originally Posted by PamNor (Post 1555084)
Beenden -> Exit

Oh yes, I did not see:) there is one more on second picture.

nieldk 2019-03-11 18:18

Re: Connman hacking
 
Quote:

Originally Posted by Halftux (Post 1555085)
Oh yes, I did not see:) there is one more on second picture.

Aus=off
Sicherheit = Security

Halftux 2019-03-11 18:44

Re: Connman hacking
 
Quote:

Originally Posted by nieldk (Post 1555129)
Aus=off
Sicherheit = Security

Well done maybe for germans it is not easier because these are all known words.:)
I have seen only "Sicherheit" in the beginning.

Halftux 2019-03-11 20:04

Re: Connman hacking
 
Ok here I found the iptables part:

https://github.com/sailfishos/sailfish-connman-plugin-iptables


Still some info about dhcp is missing. The only thing what I could find is some qvariant map with networks settings including dhcp and dns. Maybe thats all I need, will see.

void UtService::initTestCase()
{
QVERIFY(waitForService("net.connman", "/", "net.connman.Manager"));
m_service = new NetworkService("/service0", QVariantMap(), this);
m_otherService = new NetworkService("/service0", QVariantMap(), this);
}

void UtService::testWriteProperties_data()
{
QTest::addColumn<QVariant>("newValue");

QTest::newRow("autoConnect") << QVariant(true);
QVariantMap ipv4Config;
ipv4Config["Method"] = "dhcp";
ipv4Config["Address"] = "10.0.24.24";
ipv4Config["Netmask"] = "255.255.224.0";
ipv4Config["Gateway"] = "10.0.24.1";
QTest::newRow("ipv4Config") << QVariant(ipv4Config);
QVariantMap ipv6Config;
ipv6Config["Method"] = "dhcp";
ipv6Config["Address"] = "fd30:84f5:4397:1676:d:e:a:d";
ipv6Config["PrefixLength"] = "65";
ipv6Config["Gateway"] = "fd30:84f5:4397:1676:d:e:a:1";
ipv6Config["Privacy"] = "disabled";
QTest::newRow("ipv6Config") << QVariant(ipv6Config);
QTest::newRow("nameserversConfig") << QVariant(QStringList() << "127.0.1.1" << "127.0.1.2");
QTest::newRow("domainsConfig") << QVariant(QStringList() << "foo.org" << "foo.com");
QVariantMap proxyConfig;
proxyConfig["Method"] = "auto";
proxyConfig["URL"] = "http://proxy.foo.org";
proxyConfig["Sercers"] = QStringList() << "proxy24.foo.org";
proxyConfig["Excludes"] = QStringList() << "drct1.com" << "drct2.com";
QTest::newRow("proxyConfig") << QVariant(proxyConfig);
}

void UtService::testWriteProperties()
{
QFETCH(QVariant, newValue);

testWriteProperty(m_service, m_otherService, QTest::currentDataTag(), newValue);
}

[1] https://git.merproject.org/mer-core/...ut_service.cpp

nthn 2019-03-11 22:03

Re: Connman hacking
 
Quote:

Originally Posted by Halftux (Post 1555130)
Well done maybe for germans it is not easier because these are all known words.:)
I have seen only "Sicherheit" in the beginning.

I don't get it, what was the bug?

Halftux 2019-03-11 23:05

Re: Connman hacking
 
Quote:

Originally Posted by nthn (Post 1555134)
I don't get it, what was the bug?

There is no bug only the translation is not finished.

PamNor 2019-03-12 07:37

Re: Connman hacking
 
deactiviert -> deactivated


All times are GMT. The time now is 02:52.

vBulletin® Version 3.8.8