Active Topics

 


Reply
Thread Tools
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#1
Finally I did it, I'm sure it's far to be perfect, but here is my two first app
May will be useful for someone...

1. Alien Dalvik restart - It's just bottom for quick refreshing aliendalvik service.
v0.3
* sudo not needed anymore (used helper from meShell post, thanks)

2. Profile changer - This is a small One click app for changing profile to silent and back to general. You can put this icon where you can quickly find it instead go to lockscreen..

v0.5
* sudo NOT required anymore, this version also update icon on your homescreen (thanks to Coderus).

v0.4
* sudo NOT required anymore, but also can't change icon on your homescreen.

v0.2
* small changes in the commands




Download from my OpenRepos:
1. AlienDalvik restart
2. Profile changer

Beware, use it on your own risk !!!

PS. If someone can create more buty icons, I will repackage them...

Last edited by Schturman; 2014-02-07 at 22:18.
 

The Following 4 Users Say Thank You to Schturman For This Useful Post:
Posts: 2,076 | Thanked: 3,268 times | Joined on Feb 2011
#2
Originally Posted by Schturman View Post
Finally I did it, I'm sure it's far to be perfect, but here is my two first app
May will be useful for someone...

1. Alien Dalvik restart - It's just bottom for quick refreshing aliendalvik service.

2. Profile changer - This is a small One click app for changing profile to silent and back to general. You can put this icon where you can quickly find it instead go to lockscreen..


Both apps requared sudo installed on your phone. You can install it from mer-tools repository. (thanks to rcolistete)
Code:
$ devel-su
# ssu ar mer-tools
# ssu ur
# pkcon refresh
# pkcon install sudo
Also you need add this line: to:
Code:
nemo ALL=(ALL) NOPASSWD: ALL
to: /etc/sudoers (thanks to szopin)


That's all


Download from my OpenRepos:
1. AlienDalvik restart
2. Profile changer
You should not require people to setup their privileged behaviour as yours. You could make your DL one line editable to insert password for those who don't need mer tools repo, or the change to how su is called.

And I seriosuly mean it, if someone follows your instructions just to install profile changer they should be aware they in the meantime allowed all semi-android(just make sailfish wrapper that runs 'sudo x') or other applications easy way in, this really should not be dep for anything

Last edited by szopin; 2014-01-29 at 02:29.
 

The Following 3 Users Say Thank You to szopin For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#3
Maybe you are right, I'm not developer and not so tech, I just did it because it was easy for me instead creating script with pass asking.
If you think it better to remove this post, I will remove..

PS. can you explain it please:
just make sailfish wrapper that runs 'sudo x'

Last edited by Schturman; 2014-01-29 at 06:08.
 
Posts: 84 | Thanked: 79 times | Joined on Dec 2013
#4
It's not possible to use setuid?
 

The Following User Says Thank You to evk For This Useful Post:
Posts: 586 | Thanked: 471 times | Joined on Jan 2010 @ Finland
#5
reset alien is very good idea. its not that solid . many reboot because of that.
 

The Following User Says Thank You to Makeclick For This Useful Post:
Posts: 498 | Thanked: 836 times | Joined on Jun 2012 @ Finland
#6
I also think that reset alien dalvik is really good idea! This is something that i do quite regularly on terminal because of connection problems on android side.
__________________
- "Only two things are infinite, the universe and human stupidity, and I'm not sure about the universe."
- Albert Einstein
 

The Following User Says Thank You to Boxeri For This Useful Post:
meShell's Avatar
Posts: 60 | Thanked: 104 times | Joined on Dec 2009
#7
Originally Posted by evk View Post
It's not possible to use setuid?
setuid( 0 )

It is possible, I am using this "helper" to start my "vpnc" with a GUI-Button, because I did not get a response and did not find any "recommended way to run as privileged" via Sailfis-App.

So there are 3 steps.
  • compile helper program
  • change owner to root:root
  • change permissions to 4755


Example (added example with 2 commands seperated by "&&"):

Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
   setuid( 0 );
   system( "/usr/sbin/vpnc && /sbin/ip route add xxx.xxx.x.0/24 dev tun0);

   return 0;
}

compiled it with gcc on the phone like this:

Code:
gcc vpnc-helper.c -o vpnc-helper
devel-su
chown root:root vpnc-helper
chmod 4755 vpnc-helper
 

The Following User Says Thank You to meShell For This Useful Post:
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#8
Originally Posted by evk View Post
It's not possible to use setuid?
I don't really know how to do it...

My first target was to create working rpm file, that can be installable/uninstallable from desktop. Finally I got it...
But... when we press on the icon it run my script as USER and many commands I need to run as ROOT when I already user.. In my first version (sudo not installed yet) I used devel-su many times in one script, for example to run this command (echo silent > /usr/share/jolla-mods/temp) I needed write it like this to get it work:
Code:
echo rootme|devel-su -c sh -c "echo root|devel-su -c echo silent > /usr/share/jolla-mods/temp"
where is rootme = nemo user pass (from dev mode) and root = is root user pass
Too much weird combination
Now with sudo I run the same command like this (much easily):
Code:
sudo sh -c "sudo echo silent > /usr/share/jolla-profchanger/temp"
like you can see I used sudo twice because even I have sudo USER can't write to ROOT directory...

Also when and if I will learn how to package with root permission (I don't know what to write to .spec file for this), something like aegis manifest on N9, when after installation by pressing on the icon it will run script automatically as ROOT, it will be nice. But also here I have a problem.. For example this command we need to run as USER:
Code:
dbus-send --type=method_call --dest=com.nokia.profiled /com/nokia/profiled com.nokia.profiled.set_profile string:"silent"
I tried a meany diff variation to get i work under ROOT, but without success

Last edited by Schturman; 2014-01-29 at 07:47.
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#9
Originally Posted by meShell View Post
setuid( 0 )

It is possible, I am using this "helper" to start my "vpnc" with a GUI-Button, because I did not get a response and did not find any "recommended way to run as privileged" via Sailfis-App.

So there are 3 steps.
  • compile helper program
  • change owner to root:root
  • change permissions to 4755


Example (added example with 2 commands seperated by "&&"):

Code:
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>

int main()
{
   setuid( 0 );
   system( "/usr/sbin/vpnc && /sbin/ip route add xxx.xxx.x.0/24 dev tun0);

   return 0;
}
compiled it with gcc on the phone like this:

Code:
gcc vpnc-helper.c -o vpnc-helper
devel-su
chown root:root vpnc-helper
chmod 4755 vpnc-helper
Hmmm, thanks... don't sure If I understand it correctly, I need to create this files like your vpnc-helper to each command that I need to run as ROOT when I under USER?
For example in script included commands:
root command
user command
user command
root command
user command
Each root command is a different command, that mean I need a different my-helper files ?
And how I implement this and how to run this file in the script ?
 
Schturman's Avatar
Posts: 5,339 | Thanked: 4,133 times | Joined on Jan 2010 @ Israel
#10
Originally Posted by Boxeri View Post
I also think that reset alien dalvik is really good idea! This is something that i do quite regularly on terminal because of connection problems on android side.
This is exactly a reason why i did it It make me crasy when it happens while driving with waze and i needed to open terminal to restart it

PS. if someone can create more beauty icons it will be nice

Last edited by Schturman; 2014-01-29 at 08:38.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:48.