Friday, July 3, 2015

increase soundcloud cache

tl;dr: i can't link to the apk because i'm not getting banned for you. you can repeat these steps yourself if you're interested. i can't stop anyone from posting a link in the comments. sorry!


background

soundcloud used to let you cache a lot of songs for offline listening. then they took it away. i'm half sure they have some reason for doing it that has vaguely to do with money dollars. but, hey, when you have a nice feature and you take it away, peeps get mad. the mad peeps are here:
https://www.soundcloudcommunity.com/soundcloud/topics/how-do-i-change-the-size-of-the-mobile-audio-cache-on-android (warning, internet drama)

many users recommend downloading 2.8.3, which you can find in the crybaby fest linked above. personally, i'm not content rolling with an ancient version like some bucolic hillbilly. nah. i must break the latest version and get all those sweet sweet features.


compare old and new

i reckoned the best way to find where the cache was controlled would be to compare 2.8.3 and 2.8.4, where it changed. maybe there was just a setting somewhere they changed, or a number was reduced from "big" to "tiny". here's how i did it:

  1. acquire 2.8.3 and 2.8.4. former was in link above, latter was from play store. i used this extension to download from play
  2. convert apks to jars with enjarify
  3. use latest jd-gui to get java for whole app (file -> save all sources)
  4. use diff -rq <dir1> <dir2> to get a sense of what changed
  5. give up on diff inspection because delta was huge
  6. randomly search for "cache" in 2.8.3
thank you soundcloud, for not obfuscating your app at all. it was much easier to find what i was looking for with class and variable names. it takes about an hour to setup proguard such that you still get debugging symbols, but hey, whatever, right?

found some likely places for cache control in 2.8.3, but it looked like there was an api rewrite between 2.8.3 and 2.8.4, so even if i found it, it wouldn't help me, because none of that code was used in later versions.

enjarify is supposed to be this snazzy new dex -> java class conversion tool. the results were "meh". i'm sure it's going to be very good eventually, and i have more faith in the professionalism of the devs of enjarify than, say, other devs.


educated guess searching

started searching around for the word "cache". there's quite a lot of caching going on. i poked around a few files that looked like they were just setting up LRU caches for something, and those looked promising, but then i found: Lcom/soundcloud/android/playback/CacheConfig;.


results

public class CacheConfig
{

  // ~524 megs
  static final long MAX_SIZE_BYTES = 524288000L;

  // ~63 megs, aka "fuck you lol"
  static final long MIN_SIZE_BYTES = 62914560L;

  public static long getCacheSize(@Nullable String country) {
    if ((ScTextUtils.isBlank(country)) || (Locale.US.getCountry().equalsIgnoreCase(country))
        || (Locale.GERMANY.getCountry().equalsIgnoreCase(country))
        || (Locale.FRANCE.getCountry().equalsIgnoreCase(country))
        || (Locale.UK.getCountry().equalsIgnoreCase(country))) {
      return MIN_SIZE_BYTES;
    }

    return MAX_SIZE_BYTES;
  }

}

boom sha ka la ka. this must be it. if you're in the US, Germany, France, or UK, you get burned with a tiny, micro cache. here's what the fix looks like:
.method public static getCacheSize(Ljava/lang/String;)J
    .registers 3
    .param p0    # Ljava/lang/String;
        .annotation build Landroid/support/annotation/Nullable;
        .end annotation
    .end param

    .prologue
    .line 15
    # return "totally random" number, 555555
    const-wide/32 v0, 0x4fb10040
    return-wide v0

    invoke-static {p0}, Lcom/soundcloud/android/utils/ScTextUtils;->isBlank(Ljava/lang/String;)Z
    # ...

unfortunately, this creates new problems. as soon as you modify the code, you have to update the dex. if you update the dex, you break the signature and have to resign. if you resign, it breaks facebook logins, and probably some other stuff, because they uses signatures to generate a token that identifies which app is trying to do the login. luckily, antilvl knows how to handle spoofing signatures.



48 comments :

  1. modified version here: https://mega.co.nz/#!69oCkIJQ!0OWfDn6TK9HuUqJDG9s5TG5PTJd8nx8CqTMCy6W1Vcw

    ReplyDelete
  2. though antilvl signature spoof doesnot work on every app nowdays lohan bro it was amazing before i guess some other checks nowi tried so i make patcher to patch dalvikcache keeping developer signature same its much easy though :P
    regards
    jasi2169

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. and lohan cant we do like this much easy way

      public class CacheConfig
      {

      // ~524 megs
      static final long MAX_SIZE_BYTES = 524288000L;

      // ~63 megs, aka "fuck you lol"
      static final long MIN_SIZE_BYTES = 62914560L;

      public static long getCacheSize() {
      // just remove if condition all is good what you say :P every one is equal in our eyes
      return MAX_SIZE_BYTES;
      }

      }

      Delete
    3. you could patch the code in a lot of different ways. your way seems like it would work too.

      Delete
    4. did u saw android crackmes i sent 2 android cracmes in email ?

      Delete
  3. i got question, but not on this topic, but dont know where to post it. is it possible deobsfucate smali code ? application is protected by proguard i assume, class names are like a/b/c and fields have only 'a','b','c' . methods are the same names. only single letters. i would like if you point me to some web site where can i get more info about deobsfucating. (sorry for the english :) ). ps: i like this blog.

    ReplyDelete
    Replies
    1. no you cant get original class names but its still easy to patch though until something comes with arrays encryption if you got what i mean :)

      regards
      jasi2169

      Delete
    2. so figuring out how application works.

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Hi, Enjarify developer here. What problems did you have with Enjarify? Do you have any suggestions? (If so, please file an issue at https://github.com/google/enjarify)

    ReplyDelete
  6. If you guys are intersted in modding Android games, take a look at my blog

    http://iandrohackerdk.blogspot.dk/

    ReplyDelete
  7. By letting posting along with sound cloud like podcasts and all we can share what we are thinking and the piece of information towards the people. Thank you for made here with code.
    SEO Company in Chennai

    ReplyDelete
  8. Wonderful content.Thank you for sharing.
    If you are facing insufficient space on android there click here;
    Android Storage Space Running Out

    ReplyDelete
  9. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    SEOPHP
    Android
    SMO

    ReplyDelete
  10. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    SEOPHP
    Android
    SMO

    ReplyDelete
  11. This is the best blog for gaming people. Your all posts are very informative . thanks for sharing these information. Best of luck From Team Rally Racer

    ReplyDelete
  12. Nice blog..! I really loved reading through this article. Thanks for sharing such a
    amazing post with us and keep blogging... iot training in chennai | iot training in chennai quora | iot training and placement in chennai | iot training center in chennai | best iot training centre in chennai

    ReplyDelete
  13. fore more info...
    https://www.alltips24a2z.com/

    ReplyDelete
  14. Thanks for such a great article here. I was searching for something like this for quite a long time and at last, I’ve found it on your blog. It was definitely interesting for me to read about their market situation nowadays.angularjs best training center in chennai | angularjs training in velachery | angularjs training in chennai | angularjs training in omr

    ReplyDelete
  15. Your File 100% Working... Brother.. Thanks For Uploading....

    Please Visit Our Website, Mobile flashing Tools, Cracked Box, Frp Remover Tool, Country Unlock Tools, iPhone Unlock tools, Any Flash File Without Password, Etc File Tool Free Download BY AndroidtipsBD71



    ReplyDelete
  16. nice blog post and very valuable information , thanks a lot share a valuable information ! live video shareing , chat accross the world and viral your videos log in bigo live app download bigo live apk

    ReplyDelete
  17. A bewildering web journal I visit this blog, it's unfathomably heavenly. Oddly, in this present blog's substance made the purpose of actuality and reasonable. The substance of data is informative
    Oracle Fusion Financials Online Training
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training

    ReplyDelete
  18. Welcome to AG The Chief Beats! We will help you distinguish your sound and stand out from the rest. https://www.agthachiefbeats.com/

    ReplyDelete
  19. I love this post.

    โปรโมชั่นGclub ของทางทีมงานตอนนี้แจกฟรีโบนัส 50%
    เพียงแค่คุณสมัคร Gclub กับทางทีมงานของเราเพียงเท่านั้น
    ร่วมมาเป็นส่วนหนึ่งกับเว็บไซต์คาสิโนออนไลน์ของเราได้เลยค่ะ
    สมัครสล็อตออนไลน์ >>> goldenslot
    สนใจร่วมลงทุนกับเรา สมัครเอเย่น Gclub คลิ๊กได้เลย

    ReplyDelete
  20. Very cool!

    เว็บไซต์คาสิโนออนไลน์ที่ได้คุณภาพอับดับ 1 ของประเทศ
    เป็นเว็บไซต์การพนันออนไลน์ที่มีคนมา สมัคร Gclub Royal1688
    และยังมีหวยให้คุณได้เล่น สมัครหวยออนไลน์ ได้เลย
    สมัครสมาชิกที่นี่ >>> Gclub Royal1688
    ร่วมลงทุนสมัครเอเย่นคาสิโนกับทีมงานของเราได้เลย

    ReplyDelete
  21. I have seen some great stuff here. Worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. Your work is truly appreciated around the clock and the globe. Android stock rom

    ReplyDelete
  22. nice blog
    #foxangle
    https://www.foxangle.com/

    ReplyDelete
  23. #foxangle #foxangleindia
    We are Top-rated IT Training Company Run by Industry Experts
    Foxangle, The Leading IT Training Provider in Jaipur Infuse The Skills And Talent In All IT Aspirants By Applying Magical Ideas, Technical Concepts And Real Life Experiences To Build A Manpower Pool For Global Industrial Requirements.

    ReplyDelete
  24. This is a very interesting article to read. Thank you for giving very good information. Nice post.
    bigo live is Nice app. connect friends and relatives.

    Download the application
    BIGO LIVE APK
    BIGO LIVE LOGIN
    MESSENGER APP
    BIGO MOD APK
    DOWNLOAD FREE BIGO LIVE APK
    EARN MONEY ONLINE
    LIVE BROADCASTINGS

    ReplyDelete
  25. Thank you so much for the inclusion nice article and very informative.
    BIGO LIVE is a cross-platform application, which has the ability to work on all sort of modern platforms.Here you have much freedom to share anything as like as you share on your smartphone.
    Click Here:
    Bigo Live Connector
    Live Streaming
    Bigo Live MAC PC
    BIGO LIVE FOR iOS
    Watch Live Video Broadcasting
    Android App
    MultiPlatform Application

    ReplyDelete
  26. Nice article. Thanks for sharing valuable information.
    Bigo Live is also one of the most popular video broadcasting app
    Download the application
    BIGO LIVE APK
    BIGO LIVE LOGIN
    MESSENGER APP
    BIGO MOD APK
    Bigo Live Stream Games
    Bigo Live for Windows Phone
    Excellent Platform

    ReplyDelete
  27. Nice article. Thanks for sharing valuable information.
    Bigo Live is also one of the most popular video broadcasting app
    Download the application
    DOWNLOAD FREE BIGO LIVE APK
    EARN MONEY ONLINE
    LIVE BROADCASTINGS
    Bigo Online and Offline Activities
    Social Video Broadcasting
    Sign up for Bigo Live
    Video Calling App

    ReplyDelete

  28. Nice Article. Thank you for sharing the informative article with us. PlayBox is the best online Streaming App for android users. Click the below link to know more about
    PlayBox Online,

    PlayBox Online,

    PlayBox APP for Android,

    PlayBox APP for iOS,

    PlayBox Online,

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete

Do NOT post about or link to specific apps!