[Script][Android] Streetpass Automation Script for Android

Discussion in '3DS - Tutorials' started by lpchaim, Aug 21, 2013.

  1. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    Hello everyone!
    This is a android shell script I began creating as soon as I heard of the strides in homemade streetpass relays here on Temp and other places in the net. My focus is on customization.
    It works quite like Chaldron's MAC Cycler, but on android. Since it can reverse tether your phone automatically, it's very useful for people without data plans like myself, or who only have access to a wireless router that can't clone its MAC easily. The way I have it setup, the internet connection comes from a wireless router to my PC, is shared with the phone by usb and is finally broadcast correctly from there.
    To add or exclude MAC addresses, simply edit '/data/script.autoStreetPass/macList.txt'. By default it includes the GbaTemp prime MACs, the other 'near Nintendo Zone' MACs and personal MACs taken from the official spreadsheet.

    Requirements
    • Root Access
    • ROM able to read the Wi-Fi MAC address from a file (only implemented for CyanogenMod based ROMs for now)
    • 'Wifi Tether for Root Users' app (found here)*
    • Usb tethering capabilities for reverse tethering, optional
    *Make sure the virtual access point is started manually at least once from inside the app so that it generates the config files required for the binary to run in standalone mode. It is not recommended to enable MAC address spoofing in its options.

    Usage
    To install the script, simply unzip the contents of its release file to the root of your sd card.
    My script was tested with Script Manager, but it should work with similar solutions. Navigate to /data/script.autoStreetpassForAndroid/ choose macCicle.sh, check Root and Wakelock, set your desired arguments and run. You can use the addon package SMWidgets to make a quick widget on the phone's launcher for quick access.
    If you want to use reverse tethering just connect your phone to your PC, share a connection with the usb network adapter and turn on usb tethering before running the script with the proper argument(s) (See Configuration for details).

    Configuration
    In the main script there are some variables that can be edited along with a brief summary where applicable.
    Thre is also file macList.txt, which stores all the MAC addresses that will be used. Invalid entries are ignored, as well as commentary lines denoted by '#' at their start.
    As for the script's arguments, see the script's help text below:

    Starts and manages a wifi access point while cicling through different MAC addresses -h Display help page -u ensure Enables usb reverse tethering Optional argument, if true quits on error -l loops Number of times to iterate through MAC list, default 1 Pass 0 for it to loop indefinitely -t delay<unit> Sets a custom delay beteen MAC changing Unit format: [s:seconds|m:minutes|h:hours|d:days]

    Download
    You can download it by going here and selecting the latest version. Also, please consider throwing me a penny for helping with college, by clicking here.

    Considerations
    Please report any issues here.
    Thank you to everyone who made unnoficial streetpass relaying possible, now I can finally complete some puzzles!
     
    Dartz150 and KaleoOmega like this.
  2. KaleoOmega

    KaleoOmega I just don't know what to do with myself...

    Member
    386
    171
    Apr 17, 2013
    Brazil
    Sounds nice, but, a question: it is possible to create a version without tethering, using data plans from the phone and activating-deactivating the phone router?

    At this moment I'm without internet at my home, except by the phone data plan... :P
     
  3. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    Yes, in fact it's disabled by default. You have to pass the -u switch to enable it. It should work fine with a mobile data connection, although I don't have one to test with. Also, do note it doesn't check for connectivity before starting the switches yet.
     
  4. RedHero

    RedHero GBAtemp Regular

    Member
    208
    5
    Dec 27, 2008
    Netherlands
    This method doesn't work for me. It essentially uses the same method as Zurce's Riilay app to change MACs. Basically, it changes the nvmac.info file manually. Which makes me wonder why the Wi-Fi tether app is necessary, since that app uses a different method that does work for me (I don't have nvmac.info and changing mac.info manually doesn't work). Sadly, development of Riilay seems to be on hold for now..

    The Wi-Fi tether app's method works fine for me though. MAC spoofing with that app clearly uses a different method that doesn't change the MAC in the file, but changes (or appears to change) the actual MAC of the device temporarily.

    Basically, this method would only work for people who have nvmac.info data folder and for people who can get that method to work manually. It might be worth checking to see how the Wi-Fi tether app spoofs the MAC. It might be more reliable than the method that changes the text files and it might work for more people.
     
  5. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    That's right. I based the script on this method because CyanogenMod ROMs use it and are the most popular ones. Also my phone has it, which makes testing easier. The way I have laid the basic sript, it's ready to replace MAC data in any form within a file, it's just a matter of adding the other methods when I discover other files to modify.
    As for the app's method, I will look into it, yes. As you said it seems to be temporary, not sure what to expect here...
     
  6. Maverynthia

    Maverynthia Member

    Newcomer
    38
    8
    Apr 1, 2010
    United States
    Please add the Wifi Tether method, I do not use Cyanogen ROMs because they are usually buggy. Wifi Tether works for me, but file based MAC changes don't.
     
  7. Zurce

    Zurce Member

    Newcomer
    33
    18
    Aug 16, 2013
    United States
    does this work with every phone or it's limited to the one who are compatible with the busybox method?
     
  8. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    As I already said, I will look into implementing a "on the fly" method like the one used by the wifi tether app.
    The thing is, college is taking a lot of my time right now, so please be patient.

    The only things it uses busybox for are unrelated to the actual file manipulation. At the moment it replaces the MAC in the file at '/data/.nvmac.info', which can be changed for other ROMs if necessary.
    I'm not sure if other ROMs have this file, I just know CM ones have it by default.
     
  9. PSeeCO

    PSeeCO Member

    Newcomer
    13
    1
    Feb 24, 2009
    Italy
    Leghorn
    On cyanogenmod 10.2 this method isn't working, which CM version are you on?
     
  10. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    Well, mine is 10.1.1
    Maybe I was wrong in assuming every CM rom uses the same method after all...
     
  11. PSeeCO

    PSeeCO Member

    Newcomer
    13
    1
    Feb 24, 2009
    Italy
    Leghorn
    Ok, I've been able to make it work without script, I'm happy anyway ;-)
     
    lpchaim likes this.
  12. Akotan

    Akotan Mathematical!

    Member
    558
    12
    Mar 14, 2004
    Brazil
    I searched my Nexus device for an MAC config file and I didn't find anything... so I'm stuck with a busybox method like Riilay.
    For someone who never streetpassed, 6 ones are good enough. XD
     
  13. Duo8

    Duo8 I don't like video games

    Member
    3,426
    1,133
    Jul 16, 2013
    I'm using CM 7.2 now and I don't recall my phone having that "nvmac.info". Not stock CM though.
     
  14. lpchaim
    OP

    lpchaim Advanced Member

    Newcomer
    75
    31
    Jan 6, 2013
    Brazil
    Oh, trust me, I know your pain :lol:
    My friends didn't even know what a 3ds was before seeing mine, and no one in my college's city owns one afaik haha

    Yeah, I risked a guess beause the ones I have seen seemed to have it as opposed to stock roms. Maybe it's manufacturer dependant.
    When I resume development on this I will try to implement a more universal changing method.
     
  15. subly

    subly Newbie

    Newcomer
    4
    1
    Jun 2, 2012
    France
    wrong thread sorry

    modo, you can delete this post
     
  16. Rainy456

    Rainy456 Newbie

    Newcomer
    8
    1
    Sep 14, 2014
    Libya
    It stucks at "Is this really a supported rom ?" :unsure:
    im on CM11 .