getevent inside of application: Permission Denied - Galaxy S 4 Q&A, Help & Troubleshooting

Hello,
I am using a Galaxy S4 with an S View Cover. This cover has a magnet in it, which the phone uses to "know" if it is closed or open. It also has a little window in it.
All AOSP Roms except the Google Edition Roms for the Galaxy S4 don't support the S View Cover.
So I thought to myself, I should make something that makes the S View Cover useful on AOSP roms. Preferably an App which can be installed on any AOSP rom. So I poked around and found out that I can find out the state of the cover (i.e. open/closed) by using the getevent command inside of an adb shell.
The exact command that gives me the state of the cover is getevent /dev/input/event18
which gives me the events of the device "gpio_keys".
When I close the cover it returns the following numbers:
0005 0015 00000000
0000 0000 00000000
When I open the cover it returns this:
0005 0015 00000001
0000 0000 00000000
So what I need is the last number of the first line. I tried limiting the output of getevent with grep, but I've never used it before and I wasn't successful.
My programming abilities are very limited, especially when it comes to object oriented stuff like java. At work we use ABAP (a programming language for SAP ERP systems) and most of what we do doesn't require any understanding of objects. I already found some stuff that would allow me to run shell commands, but I can't get it working:
Code:
Log.v("MyApp", "Started");
String myStringArray[]= {"getevent","/dev/input/event18"};
String line;
try {
Process process = Runtime.getRuntime().exec(myStringArray);
InputStreamReader inputstreamreader = new InputStreamReader(process.getInputStream());
BufferedReader bufferedReader = new BufferedReader(inputstreamreader);
bufferedReader.read();
while ((line = bufferedReader.readLine()) != null) {
Log.v("MyApp", line);
}
InputStreamReader errstreamreader = new InputStreamReader(process.getErrorStream());
BufferedReader errReader = new BufferedReader(errstreamreader);
errReader.read();
while ((line = errReader.readLine()) != null) {
Log.v("MyApp", line);
}
} catch(java.io.IOException e){
}
Log.v("MyApp", "Finished");
This code produces an error message:
V/MyApp ( 6090): ould not open /dev/input/event18, Permission denied
When I use getevent in the adb shell it works without super user permissions (root). What permissions do I need to get this working?
I'm a beginner and I don't really understand android permissions.

Hmm.. I guess you'll need super user permissions to do something like that.
Try reading the following link: http://stackoverflow.com/questions/7707889/android-system-permissions-through-root
Hope it gives you some pointers in the right direction

If you need proper root support, use roottools. root in java is a pain in the ass, root tools fixes it
http://code.google.com/p/roottools/downloads/list
and i think there is some sysfs interface for this as well.
this is my output btw
Code:
add device 1: /dev/input/event19
name: "sec_touchkey"
add device 2: /dev/input/event2
name: "max77693-muic"
add device 3: /dev/input/event0
name: "pmic8xxx_pwrkey"
add device 4: /dev/input/event17
name: "apq8064-tabla-snd-card Headset Jack"
add device 5: /dev/input/event16
name: "apq8064-tabla-snd-card Button Jack"
add device 6: /dev/input/event18
name: "gpio-keys"
add device 7: /dev/input/event15
name: "ssp_context"
add device 8: /dev/input/event14
name: "step_cnt_sensor"
add device 9: /dev/input/event13
name: "step_det_sensor"
add device 10: /dev/input/event12
name: "sig_motion_sensor"
add device 11: /dev/input/event11
name: "geomagnetic_sensor"
add device 12: /dev/input/event10
name: "temp_humidity_sensor"
add device 13: /dev/input/event9
name: "proximity_sensor"
add device 14: /dev/input/event8
name: "light_sensor"
add device 15: /dev/input/event7
name: "gesture_sensor"
add device 16: /dev/input/event6
name: "pressure_sensor"
add device 17: /dev/input/event5
name: "gyro_sensor"
add device 18: /dev/input/event4
name: "accelerometer_sensor"
add device 19: /dev/input/event1
name: "sii8240_rcp"
could not get driver version for /dev/input/mice, Not a typewriter
add device 20: /dev/input/event3
name: "sec_touchscreen"
and then 4 and 8 gets spammed.
btw also set permissions to 666 when you want to read a file from an app

Can you guys please explain how to parse and understand what the values from this command returns:
Code:
getevent /dev/input/event0
?
I wish to just get the coordinate of the touch event.
From my understanding, even using "event0" isn't safe, as it could be something else that's the touchscreen. Is there anyway to get the correct one?

Related

Debugging a dll

I'm creating a project as a dll. Can anybody tell me how to go about debugging it. I attach it to the remote process "services.exe" but any breakpoints I put, dont hit and display an exclamation mark, saying that no executable code exists at that point..
How do you guys debug ur DLLs??
be sure that services.exe is the correct process
bye
Let me explain a bit. Actually I'm trying to write a WinMob service (This is my first time writing a service dll, infact, first time writing a dll).
I created a dll with the DLL_PROCESS_ATTACH case in the ul_reason_for_call calling a SPC_init function (exported using __declspec(dllexport)).
Moreover, I added these entries to the registry:
[HKEY_LOCAL_MACHINE\Services\ShantzABC]
"Order"=dword:00000009
"Index"=dword:00000000
"Prefix"="SPC"
"Keep"=dword:00000001
"Dll"="ShantzABC.dll"
"FriendlyName"="ShantzABC"
But the service didn't load. Then I added the line "services load ShantzABC" to the deployment options of my VS2005 project. Now, on pressing F5, the service loads (I know because I put a MessageBox() inside the SPC_init, which is now displayed on screen) BUT:
1. I can't see the ShantzABC.dll loaded in Remote Process Viewer tool (seeing for services.exe)
2. Moreover, I can't hit any breakpoints in my project, even the one kept on the MessageBox() line. (Though now they have stopped giving the error "not an executable line" that they were giving earlier)
Actually I'm trying to start a project which could benefit greatly if it was a service instead of me writing an exe for it..
So, any pointers??
EDIT: added a part of the code:
Code:
#include "stdafx.h"
#include "ShantzABC.h"
#include <windows.h>
#include <commctrl.h>
HINSTANCE g_hInst;
// This is an example of an exported function.
__declspec(dllexport) HRESULT SPC_init(void)
{
HRESULT result;
MessageBox(NULL, TEXT("initCtrl"), TEXT("INIT"), MB_OK);
result = S_OK;
return result;
}
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
HRESULT result;
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
//save instance handle
g_hInst = (HINSTANCE) hModule;
result = SPC_init();
MessageBox(NULL, TEXT("initCtrl"), TEXT("main"), MB_OK);
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
1. implements all the exported functions for service:
Init, Open, Close, Deinit, IOControl, Read, Seek, Write also if empty (just return 0)
2. instead to use F5 to debug it, try to deploy the dll and attach the process to debug it: Debug > Attach to process.... (vs2005's menu)
i hope this help you
Could you please direct me to an SW development environment, which documents the above functions, Reg_Key meanings etc. sort of a reference guide? What compilers/linkers do you guys use ?
crino said:
1. implements all the exported functions for service:
Init, Open, Close, Deinit, IOControl, Read, Seek, Write also if empty (just return 0)
2. instead to use F5 to debug it, try to deploy the dll and attach the process to debug it: Debug > Attach to process.... (vs2005's menu)
Click to expand...
Click to collapse
I implemented all the functions and just returned 1. (didnt return 0 because read on a msdn blog that returning 0 form dllmain or xxx_Init will unload the dll)
But again on attaching to services.exe, its not loading my dll(or unloads it soon after loading). (Dll is kept in \windows)
So, cant find the dll in the modules window and so cant load the symbols for it in order to debug it..

Cannot map to a Samba Share, but xp notebook can?

Hello,
Problem: Cannot get my pda (HTC Mogul) to connect to a samba share.
Behavior: Resco File Explorer (V7.03) keeps asking for a password when I try to map to a samba share.
Basic Setup Information:
ROUTER: Dynamic Type Configuration acting as a DHCP Server. The DNS is Automagic from the IP.
LAPTOP (windows xp): 192.168.1.38 / 255.255.255.0
SAMBA_PC (Suse 11) : 192.168.1.36 / 255.255.255.0
PDA (Sprint Mogul, Windows Mobile 6 Pro): 192.168.1.37 / 255.255.255.0
-----Below is my current smb.conf---------------
# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2008-06-07
[global]
workgroup = MCHOME
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
use spnego = No
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775
[linuxpodcasts]
comment = downloaded shows
inherit acls = Yes
path = /home/jason/Podcasts/
read only = No
[lacie]
comment = storage drive
inherit acls = Yes
path = /media/disk/
read only = No
------------------------------------------
PDA TESTING:
1) Ping \\LINUX-PD\lacie
Results: 24.A.B.C
Note: this number is unknown. It is only similar to the Router Configuration in the first number!
2) Ping 192.168.1.36
Results with Reply from 192.168.1.36
3) Ping \\LAPTOP
Results 24.A.B.C
Note: This is the same number as PDA Testing #1
-------------------------------------------
LAPTOP TESTING:
------------------------------------------
1) Ping \\LINUX-PD
Results: 24.A.B.C .Qu1nnLAN
Note: This is the same number as PDA Testing #1 including the name of the wireless lan!
2) Ping 192.168.1.36
Results with reply from 192.168.1.36
3) Ping 192.168.1.37
Results with reply from 192.168.1.37
4) net view \\LINUX-PD
<< shows all of the shares , Not Shown, The Command Completed successfully >>
5) net use g: \\LINUX-PD\lacie
<< asks for username / pass. The Command Completed successfully >>
6) From File MANAGER, I can sucessfully browse the network and view the shares!
From XP > Command Prompt: ipconfig /all
Windows IP config:
Host Name: LAPTOP
Primary DNS Suffix:
Node Type: Unknown
IP Routing Enabled: NO
WINS Proxy Enabled: NO
DNS Suffix Search List: Qu1nnLAN
...
Ethernet adapter wireless Network Connection
Connection Specific DNS Suffix: Qu1nnLAN
...
Connection
DHCP Enabled: Yes
Autoconfig Enabled: Yes
IP Address: 192.168.1.38
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.1
DHCP Server: 192.168.1.1
DNS Servers: 24.W.X.Y
24.W.X.Z
------------------------------------------
LINUX-PD TESTING: (Includes steps from Chapter 38 of the Samba Checklist)
------------------------------------------
1)
Ping 192.168.1.37
Results in Reply form 192.168.1.37
2)
linux-pd:~ # smbclient -L LINUX-pd
Enter password:
Domain=[MCHOME] OS=[Unix] Server=[Samba 3.2.0rc1-22.1-1795-SUSE-SL11.0]
Sharename Type Comment
--------- ---- -------
profiles Disk Network Profiles Service
users Disk All users
groups Disk All groups
print$ Disk Printer Drivers
linuxpodcasts Disk downloaded shows
lacie Disk storage drive
IPC$ IPC IPC Service (Samba 3.2.0rc1-22.1-1795-SUSE-SL11.0)
Photosmart_3200 Printer Photosmart 3210
HIDDEN Disk Home Directories
Domain=[MCHOME] OS=[Unix] Server=[Samba 3.2.0rc1-22.1-1795-SUSE-SL11.0]
Server Comment
--------- -------
LAPTOP Pentium M750 1.86GHz, 1GB RAM
LINUX-PD Samba 3.2.0rc1-22.1-1795-SUSE-SL11.0
Workgroup Master
--------- -------
MCHOME LINUX-PD
3)
linux-pd:~ # nmblookup -B LINUX-PD __SAMBA__
querying __SAMBA__ on 127.0.0.2
192.168.1.36 __SAMBA__<00>
4)
linux-pd:~ # nmblookup -d 2 '*'
added interface eth0 ip=fe80::213:20ff:fecb:7cbb%eth0 bcast=fe80::ffff:ffff:ffff:ffff%eth0 netmask=ffff:ffff:ffff:ffff::
added interface eth0 ip=192.168.1.36 bcast=192.168.1.255 netmask=255.255.255.0
querying * on 192.168.1.255
Got a positive name query response from 192.168.1.36 ( 192.168.1.36 )
192.168.1.36 *<00>
5)
linux-pd:~ # smbclient //LINUX-PD/lacie
Enter HIDDEN password:
Domain=[MCHOME] OS=[Unix] Server=[Samba 3.2.0rc1-22.1-1795-SUSE-SL11.0]
smb: \>
6)
linux-pd:~ # nmblookup -M MCHOME
querying MCHOME on 192.168.1.255
192.168.1.36 MCHOME<1d>
-------------------------------------------
Additional Questions:
1) how do you find the machine name on the PDA similar to how the LINUX-PD = 192.168.1.36?
2) why is the wireless router name showing up when I ping?
I am at a loss.
I will be posting to a Resco forum as well.
Any suggestions helping this newb would be great.
Thank you for your time
qu1nn
_______________
same problem here. did u fix it?
I got it working, albeit Resco doesnt remember the password correctly and it has to be entered in every time I start a new session.
make note and read before you read the next thread....
that resco is aware of the issue:
http://resco.net/pocketpc/explorer/faq.asp?faq=network#85
Check out my posting on rescos forums for what I had to do:
http://resco.net/forums/ShowPost.aspx?PostID=17810
I hope this helps
qu1nn

Receiving error: Cannot convert from element type Object

Hello,
As the title states, I'm receiving an error that says "Cannot convert from element type Object to Bluetooth Device. The following is the highlighted code:
Code:
if (pairedDevices.size() > 0) {
findViewById(R.id.title_paired_devices).setVisibility(View.VISIBLE);//make title viewable
for (BluetoothDevice device : pairedDevices) {
mPairedDevicesArrayAdapter.add(device.getName() + "\n" + device.getAddress());
}
} else {
mPairedDevicesArrayAdapter.add("no devices paired");
}
I have a feeling it has something to do with java generics, but I'm not quite sure how to fix it. Would anyone be able to offer help?
Thanks
theBasher91 said:
Code:
for (BluetoothDevice device : pairedDevices)
Click to expand...
Click to collapse
Well I would suspect that pairedDevices is a list or array of type Object? Not sure as you dont post the actual error or line numbers... but cast within the for loop if this is the case
Code:
for (Object item : pairedDevices)
{
BluetoothDevice device = (BluetoothDevice) item;
}
Just a thought
Or, assuming that pairedDevices is an ArrayList or other type that implements the collections interface, you're best bet would be to ensure that it is parameterized correctly.
For example:
Code:
ArrayList<BluetoothDevice> = new ArrayList()<BluetoothDevice>

Scripting Commands in Android App?

Hi All,
Things I am trying to do:
1. Connect to remote system
2. Run perl command and get the output on screen.
Could you please guide me on the process where in I can connect to a remote windows/unix machine and run build commands.
Any examples?
Thanks for your help.
Thanks,
Kino
Hi!
I've made something similar - An App that runs some shell scripts on an Ubuntu server over SSH.
Here are some code snippets, hope this helps you
Code:
JSch jsch = new JSch();
Session session = jsch.getSession([I]'ssh-username'[/I],IP, [I]'ssh-port'[/I]);
session.setPassword(SW); // SW ... password ssh-user (for me it's the same pw, ssh-user = su)
Properties prop = new Properties();
prop.put("StrictHostKeyChecking", "no");
session.setConfig(prop);
session.connect();
Channel channel = session.openChannel("exec");
Code:
if(SU) // If Command should run as SU
{
sudoCommand = "sudo -S -p '' " + command;
}
else
{
sudoCommand = command;
}
((ChannelExec) channel).setCommand(sudoCommand);
((ChannelExec) channel).setPty(true);
channel.connect();
OutputStream out = channel.getOutputStream();
ByteArrayOutputStream responseStream = new ByteArrayOutputStream();
channel.setOutputStream(responseStream);
if(SU)
{
out.write((SW + "\n").getBytes());
out.flush();
}
Thread.sleep(1000);
out.write(("logout" + "\n").getBytes());
out.flush();
Thread.sleep(500);
out.write(("exit" + "\n").getBytes());
out.flush();
out.close();
session.disconnect();
channel.disconnect();
Thank you LinuxForce. Thats helpful. I am trying to work on this.
LinuxForce said:
Hi!
I've made something similar - An App that runs some shell scripts on an Ubuntu server over SSH.
Here are some code snippets, hope this helps you
Click to expand...
Click to collapse

Hacking Clarity Ensemble phone

The Clarity Ensemble phone is an Android-based captioning land-line phone. The newest model has an 8" touchscreen. Older model has 7" touchscreen. It comes with an app that runs at startup and keeps you from gaining access to the Android home screen or any other Android apps or settings. While booting up you momentarily see the time and can pull down to touch on Settings and bring up the regular Android settings but very soon as the boot process continues the splash screen and later the ThorB app will take over the screen.
In order to telnet to the device, you first need to start telnetd running on the Ensemble. This can be done by configuring your computer to appear to the Ensemble to be the update server. I directly connected the phone to a laptop Ethernet port. On the laptop, I installed a DHCP server, a DNS server, and a web server. I am running Windows and I used "DHCP Server for Windows" version 2.5.1, ApateDNS, and WWebserver with PHP 5.4.45. I set the laptop to a static IP of 8.8.4.4 since Wireshark revealed that the Ensemble was using that as the DNS server. I set ApateDNS server to return 8.8.4.4 as the IP address for all queries.
In my htdocs folder, I created a directory called thorbfota and inside that a directory called purple_prod. Inside purple_prod I created three files, download_file.php, query_site.php, and query_versions.php.
Code:
<?php
//download_file.php
ignore_user_abort(true);
set_time_limit(0);
//Replace with actual path to your files
$path = "C:/Users/User/Documents/ClarityEnsembleFiles/";
$dl_file = preg_replace("([^\w\s\d\-_~,;:\[\]\(\).]|[\.]{2,})", '', $_GET['filename']);
$dl_file = filter_var($dl_file, FILTER_SANITIZE_URL);
$fullPath = $path.$dl_file;
if ($fd = fopen ($fullPath, "r")) {
$fsize = filesize($fullPath);
$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);
switch ($ext) {
case "pdf":
header("Content-type: application/pdf");
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\"");
break;
case "bin":
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\"");
break;
case "zip":
header("Content-type: application/zip");
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\"");
break;
case "apk":
header("Content-type: application/vnd.android.package-archive");
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\"");
break;
//Add more headers for other content types here
default;
header("Content-type: application/octet-stream");
header("Content-Disposition: filename=\"".$path_parts["basename"]."\"");
break;
}
header("Content-length: $fsize");
header("Cache-control: private");
while(!feof($fd)) {
$buffer = fread($fd, 2048);
echo $buffer;
}
}
fclose ($fd);
exit;
Code:
<?php
//query_site.php
//This forum would not allow me to post links since this is my first post.
//Feel free to move the "h" below right up against the "ttp..."
echo "h" . "ttp://clarityengineering.us/thorbfota/purple_prod/";
?>
Code:
<?php
//query_versions.php
//Replace with actual path to your files
$path = "C:/Users/User/Documents/ClarityEnsembleFiles/";
//Replace file versions with your current version numbers
//To cause phone to update a file, use a number larger that the current version
$file = "ThorB.apk";
$file_ver = "2.63";
$fullPath = $path.$file;
echo $file . "=" . $file_ver . "," . strtoupper(md5_file($fullPath)) . "|\r";
$file = "thorb-ota.zip";
$file_ver = "20150305.182516";
$fullPath = $path.$file;
echo $file . "=" . $file_ver . "," . strtoupper(md5_file($fullPath)) . "|\r";
$file = "dcx.bin";
$file_ver = "b033";
$fullPath = $path.$file;
echo $file . "=" . $file_ver . "," . strtoupper(md5_file($fullPath)) . "|\r";
$file = "eep.bin";
$file_ver = "be25";
$fullPath = $path.$file;
echo $file . "=" . $file_ver . "," . strtoupper(md5_file($fullPath)) . "|\n";
echo "survey=0,0|";
?>
I found that eep.bin was actually just a shell script that is downloaded to the device and run as root. I put my update files in "C:\Users\User\Documents\ClarityEnsembleFiles" but you can put them anywhere you like, just make sure to update the php files above to reflect their location. So far I have only used eep.bin but to keep my php script happy I also created placeholder files, dcx.bin, thorb-ota.zip, and ThorB.apk and placed them with eep.bin in my ClarityEnsembleFiles folder. Below is my eep.bin that starts telnet and simulates pressing the Home button. Just touch "Home Sample" when the "Complete action using" window pops up on the Ensemble. The semicolon at the end of the line avoids having the carriage return kill the command. Alternatively, you could run dos2unix on the eep.bin file and not need the semicolon at the line end.
Code:
#eep.bin
telnetd -l /system/bin/sh;am start -a android.intent.action.MAIN -c android.intent.category.HOME;
Every time you change the eep.bin file and want to run it on the phone make sure to close the Software upgrade screen and touch "Check now" button and then "Upgrade" button.
To install apps on the phone, first download the apk file to the phone with wget and then run "pm install -r YourApp.apk".
I have not found a physical Home, Back or Menu button on the phone so one of the first things you may want to install is a software solution for those. I installed "To Home" and it didn't work when configured with the root option for "Floating Buttons". It works fine when configured with the non-root option for "Floating Buttons". I have not tried any of the several other soft button apps available.
There is a 14 pin connector on the underside of the phone that presumably is used in the factory to connect to a dock for programming. I have not investigated the function of any of the pins but I suspect USB is there as well as possibly serial port(s) and maybe JTAG.
Before connecting the phone to the internet, you probably will want to either disable/uninstall the ThorB.apk app or create a firewall on the phone or on your router to keep it from being able to automatically update and from being able to report back to it's maker.
Besides being available for purchase, the phone is also available from ClearCaptions at no charge if you provide them with a 3rd party certification of being hard of hearing.
As far as using the phone, "Federal law prohibits anyone but registered users with hearing loss from using this device with the captions on." So if your hearing it fine, make sure to turn captions off or don't turn them on.
Telnet is great but I wanted a more secure connection to the phone so I set up an Android cross-compiler and compiled the latest version of dropbear (dropbear-2016.73). I don't have a 64-bit computer so in order to use the latest version of the Android toolchain, I had to boot into Windows and install Cygwin.
Thanks to serasihay for patches to an earlier version of dropbear. I adapted them to work with the latest version of dropbear. The patch can be found by searching dropbear-2016.73-android-20160427.patch on pastebin. Most of the warnings generated during compile were from pre-patched dropbear code and can be viewed on pastebin by searching for "Compile warnings for compiling dropbear-2016.73.android"
After setting up the toolchain, dropbear can be compiled with the following commands:
Code:
tar jxf dropbear-2016.73.tar.bz2
cd dropbear-2016.73
patch -p1 < /path/to/patch/dropbear-2016.73-android-20160426.patch
./configure --build=x86-windows --host=arm-linux-androideabi --disable-zlib --disable-largefile --disable-loginfunc --disable-shadow --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx --disable-pututline --disable-pututxline --disable-lastlog
make MULTI=1 SCPPROGRESS=1 PROGRAMS="dropbear dropbearkey scp dbclient"
arm-linux-androideabi-strip.exe dropbearmulti
This generates a single binary file, dropbearmulti which you will want to copy to the phone to /system/xbin/dropbearmulti. Next, you will want to create symbolic links like this:
Code:
cd /system/xbin
ln -s dropbearmulti dbclient
ln -s dropbearmulti dropbear
ln -s dropbearmulti dropbearkey
ln -s dropbearmulti scp
I should probably redo the patch to enable the -R option to create the host keys but for now you can do it with:
Code:
mkdir /etc/dropbear
dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
dropbearkey -t ecdsa -f /etc/dropbear/dropbear_ecdsa_host_key
dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
To start dropbear every time the phone boots, I put my startup command in /system/etc/install-recovery.sh since it is called by init.rc. I would have put it straight in init.rc but init.rc is recreated from boot.img every boot and I didn't feel like getting into changing boot.img yet. Just make sure to make install-recovery.sh executable. The following line is what I use to start dropbear:
Code:
dropbear -A -N root -R /data/.ssh/authorized_keys -U 0 -G 0
Next you will need to copy your public key(s) into /data/.ssh/authorized_keys. You should now be able to ssh to your Clarity Ensemble phone. You can also use scp to copy files to and from the phone. If you use Putty pscp to transfer files, make sure to use the -scp option to force SCP protocol. If not, you will get the error "/usr/libexec/sftp-server: not found" since pscp tries to use sftp which is not installed on the phone.
So can you post a video or pics of what the device screen looks like now? can you actually use the device as a tablet?

Categories

Resources