Join Today
+ Reply to Thread
Results 1 to 1 of 1
  1. #1

    Default Motorola file access API

    Attached is a trivial java program to start USBNet on the A780. It reproduces what usbnet.lin does which is merely to write MotNet to /proc/usbd-switch. There are two problems with the file access API, the first is that the program needs special permissions to run (permfile.txt attached), and the second is that you can only access files within the pre-designated "root" directories of the phone, namely /phone/ which is actually /diska on the A780 and /HHHHHHHHHH/ (hex) which is your transflash card.

    I tried using .. but that gives me a security exception. Additionally, neither /diska nor the transflash card support symlinks or devices by default. Solution one is:
    mkdir /diska/proc; mount -o bind /ram/proc /diska/proc
    then you can write to /phone/proc/usbd-switch. The trouble with that is that you have to run those commands each time your phone boots.

    Solution two appears to be to create a symlink supporting filesystem on the transflash card, perphaps vfm or ext2 or someething that the kernel supports. I have only tried this theoretically, as I would prefer to get a spare transflash card before messing with my copilot data. However, symlinks do look like they're followed. My theoretical test was:
    mkdir /bind/root; mount -o bind / /diska/root; touch /tmp/abcd;chmod 666 /tmp/abcd;ln -s /tmp/foo /tmp/abcd
    Then I wrote to /phone/root/tmp/foo and the text went in /tmp/abcd. If this works with the transflash card then it will survive a reboot and might be useful for a few things. If anyone has reformatted their transflash, can they give it a go?

    To test, edit the attached jad which contains the following parameters:
    root: /phone
    File: proc/usbd-switch
    Text: MotNet
    install the jad, copy permfile.txt over /diska/.system/java/DownloadApps/MIDlet00NNN/permfile.txt
    and then run.

    Source attached also.

    Edited. It seemed I could only have two attachments, so I've put everything in usbnet.tar.gz
    Attached Files Attached Files


 
+ Reply to Thread

Similar Threads

  1. can't access mmc via file manager
    By anatanimation in forum E6 General Chat
    Replies: 5
    Last Post: 07-13-2009, 10:20 AM
  2. access file..
    By amithgc in forum Development
    Replies: 1
    Last Post: 08-25-2007, 08:50 AM
  3. J@ME file access
    By sreenathsreenath in forum A1200 General Chat
    Replies: 1
    Last Post: 04-14-2007, 04:15 PM
  4. Linux API to open any file?
    By mserougi in forum Development
    Replies: 2
    Last Post: 03-30-2006, 06:38 AM
  5. File Connection API from Motorola.
    By mudassar in forum A780 General Chat
    Replies: 0
    Last Post: 06-17-2005, 06:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Single Sign On provided by vBSSO

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1