How to Hide & Protect API Keys in Your Android App (Reverse Engineering)

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 มิ.ย. 2022
  • To make sure only you can access your app's API keys, you need to follow some guidelines. In this video I'll show you what these are.
    ⭐ Get certificates for your future job
    ⭐ Save countless hours of time
    ⭐ 100% money back guarantee for 30 days
    ⭐ Become a professional Android developer now:
    pl-coding.com/premium-courses...
    💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:
    elopage.com/s/philipplackner/...
    Subscribe to my FREE newsletter for regular Android, Kotlin & Architecture advice!
    pl-coding.com/newsletter
    Join this channel to get access to perks:
    / @philipplackner
    Join my Discord server:
    / discord
    Regular programming advice on my Instagram page: / _philipplackner_
    Checkout my GitHub: github.com/philipplackner
    You like my free content? Here you can buy me a coffee:
    www.buymeacoffee.com/philippl...

ความคิดเห็น • 158

  • @al1gned
    @al1gned 2 ปีที่แล้ว +2

    Thank you soo much for this as I was actually looking for something like this like yesterday and see it come from you is really satisfying :))

  • @augustocera574
    @augustocera574 2 ปีที่แล้ว +2

    Thank you very much Philipp. I have struggled a lot with this issue. Now "we" solved it :P

  • @hdkloh6857
    @hdkloh6857 2 ปีที่แล้ว +3

    Thanks for sharing, It is a common interview question...

  • @haiderali7342
    @haiderali7342 ปีที่แล้ว

    Sir Your video Help me Alot in Andorid development Thanks Alot to keep it simple

  • @sharmpuneet
    @sharmpuneet 2 ปีที่แล้ว

    Thanks for considering my comment and making the video

  • @sumit_soni
    @sumit_soni 2 ปีที่แล้ว +1

    Thanks a lot Phillip ❤️💯💯

  • @raheemadamboev
    @raheemadamboev 2 ปีที่แล้ว +3

    Thanks bro, much love❤

  • @SurazVerma
    @SurazVerma 2 ปีที่แล้ว +6

    Hey Phillip, I've been using this approach for saving the API keys, but in a modular architecture is there a way to pass these values to the specific module (let's say in layered modular architecture in where you set your network config in one of the layers).

    • @Koki-hq1yc
      @Koki-hq1yc 5 หลายเดือนก่อน

      Did you solve this issue. I have same question

    • @SurazVerma
      @SurazVerma 5 หลายเดือนก่อน

      @@Koki-hq1yc unfortunately I couldn’t find any solution yet

  • @karentechnologies3990
    @karentechnologies3990 11 หลายเดือนก่อน +1

    Just keep appending new videos like this one to your android security playlist.

  • @praveens6832
    @praveens6832 ปีที่แล้ว

    Thank you for this informative video.

  • @tmjromao
    @tmjromao 2 ปีที่แล้ว +3

    Hello Philipp L. Many thanks for the explanation. Excellent as always. Could you do video explaining how to load data from local JSON file? many thanks

  • @ekennechilex2390
    @ekennechilex2390 ปีที่แล้ว +1

    What about in the case of SSL Pinning. How do you safe secure your certificate public key on the app since the app needs it to authenticate the data

  • @huseyintas9855
    @huseyintas9855 2 ปีที่แล้ว

    Thank you for this informative video

  • @atulkumar-bb7vi
    @atulkumar-bb7vi ปีที่แล้ว +1

    We can also Android NDK enviornment where we use c or c++ files, which are directly compiled to binary code. That is the best way to keep any confidential data on client side..

    • @ViktorYakunin
      @ViktorYakunin 4 หลายเดือนก่อน +1

      like you want to write to file using C++, how is this even different from java? or maybe you think that hardcoding C++ value and providing interface for java is something really hard? Open that binary file with text editor and you will find your key in 5 seconds

  • @haykmkrtchyan7093
    @haykmkrtchyan7093 2 ปีที่แล้ว

    Great one, I do it in this way too, except I create my own properties file for that api key.

  • @dev_jeongdaeri
    @dev_jeongdaeri 2 ปีที่แล้ว +1

    Thanks!😍

  • @clarkkent1473
    @clarkkent1473 ปีที่แล้ว

    Additionally one could via smalli, painstakingly attempt to log every variable, function parameters, and return value (similar to strace), and thus attempt to locate api-key-like values by inspecting the output

  • @anaslakhani
    @anaslakhani 2 ปีที่แล้ว

    Hey! I use Firebase Firestore to read The Base URL and API KEY's also how's that ? and with this approach I also change dynamic change things ??

  • @sellychandan
    @sellychandan 11 วันที่ผ่านมา

    Thanks for the video, I have two doubts about how we will handle The project is in CICD and when we are working as a team. in both cases we are not sharing the git ignore

  • @youngtigersivateja
    @youngtigersivateja 2 ปีที่แล้ว

    Hey Philipp, thanks for making this video, this might be helpful to secure API Keys to major extent. And Can you also help us secure different API Keys with same Key name for different builds?

  • @flowzk921
    @flowzk921 2 ปีที่แล้ว

    thanks man, using the Jetpack security library do have any tutorial around using it with Datastore

  • @hossamqandel5638
    @hossamqandel5638 2 ปีที่แล้ว

    you don't know how long i waited for this video tutorial
    is it possible to make a project app to download youtube videos on local or full guied for paging 3?

  • @felipefuenzalida5492
    @felipefuenzalida5492 ปีที่แล้ว

    yo bro, really thankya. Big respect

  • @programmingwithjackchew903
    @programmingwithjackchew903 2 ปีที่แล้ว

    hi Phillip can you do the tutorial regarding login and sign up using jetpack compose and room database thank you very much, I really need this course

  • @PassionforTechnology
    @PassionforTechnology 11 หลายเดือนก่อน +3

    hey buddy please update this video as kotlin is introduced as buildgradle lang and it's not working thhere

  • @alvarorafaelalcobamiranda6256
    @alvarorafaelalcobamiranda6256 ปีที่แล้ว

    i love the explication, one fan more :)

  • @ayoubdev
    @ayoubdev 2 ปีที่แล้ว

    is Same if you cerated in Build Type release ?? buildconfigfield

  • @mustafaammar551
    @mustafaammar551 2 ปีที่แล้ว

    very cool video
    thank you BRO 👍👍👍

  • @harwinderbenipal5332
    @harwinderbenipal5332 9 หลายเดือนก่อน +2

    Hi, How do we use this in manifest file?

  • @nareshnagaraj-kx1xb
    @nareshnagaraj-kx1xb ปีที่แล้ว

    good one Phillippuh , make a video series for API integration in android

  • @myfavourites6383
    @myfavourites6383 2 ปีที่แล้ว +8

    Hey Mate,
    Protecting Api keys from server is better option that this since generated build config file will expose all the keys.
    One more option we have is using CMake

  • @user-js7jt2cb4x
    @user-js7jt2cb4x 2 หลายเดือนก่อน

    Nice video! But made me think about CI, if i'm trying to use github actions and try to run a gradle action such as lintDebug, how would i do that if in the repository doesn't have the api_key explicitly

  • @grzegorzsamojedny
    @grzegorzsamojedny 2 ปีที่แล้ว

    Cool 😎
    Thank you. I like this kind of movies.

  • @divyanathanarul550
    @divyanathanarul550 2 ปีที่แล้ว

    Hi Philip. We can use KMS to protect the Api Keys. Please make video on that.

  • @siddheshpalkar3986
    @siddheshpalkar3986 2 ปีที่แล้ว

    Nice.. 👍 See if you can make video on hide api keys by using NDK CMake. Would be love to see it.. 😊

  • @rahulkumar-td7pn
    @rahulkumar-td7pn 2 ปีที่แล้ว

    i would rather put my api keys and keystore in my private app center account and access in my gradle file through build.gradle, in this it wont be exposed as plain text, whats ur say?

  • @user-yd8ux2ou6k
    @user-yd8ux2ou6k 3 หลายเดือนก่อน

    thanks a lot. Could we save some secret keys in jenkins and got the value from app? if could , could you please help share it, thanks a lot

  • @deepakbisht4957
    @deepakbisht4957 2 ปีที่แล้ว +1

    I hide my key in native c code as it contains garbage value and it's hard to access key from it. And I just don't put my key as it is... I always break the key in may parts and add some more symbols in it to make it harder after try to extract it from reverse engineered extracted APK...

  • @AjayChoudhary-on3uw
    @AjayChoudhary-on3uw ปีที่แล้ว

    Hi @philip,
    How about api key for Admob ads or fb ads?

  • @chienlichen6551
    @chienlichen6551 2 ปีที่แล้ว

    Thanks bro, is very vedio.

  • @DominikSchulzNeristance
    @DominikSchulzNeristance 2 ปีที่แล้ว +3

    One Addition, I think you stated it already in some comments this will just make it harder one that does want to find the key will find it for sure. However, even without decompiling an attacker will in first place just try to use a proxy e.g. Charles proxy maybe and check the requests if you do not use certificate pinning. I like your content but people may take it for the bulletproof solution because they may not listen carefully. And yes for 3rd party Apis its cool if you can have the key on your servers and enforce user authentication as well so no one unwanted may talk to your API 👍

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +4

      I think I stressed out multiple times that keeping an api key in the app is not 100% safe 🤔

    • @dmitriymorozov2680
      @dmitriymorozov2680 ปีที่แล้ว

      ​@@PhilippLackner keeping your API keys on the server requires you to have some kind of jwt token to be obtained and stored locally. Isn't that an issue storing it in sharedPrefs, protoStore, sqlite? (Even using encrypted storage)

    • @dmitriymorozov2680
      @dmitriymorozov2680 ปีที่แล้ว +1

      You still have to store say sqlcipher password somewhere in your compiled app in order to encrypt and decrypt sqlite database. And decompiled app will show this password.
      Maybe we can obtain jwt+sqlcipher pass on login session and store sclcipher password in encrypted sharedprefs to read/write encrypted sql? As far as I know encrypted sharedPrefs store its keys in OS protected storage

    • @LabGecko
      @LabGecko 9 หลายเดือนก่อน

      It amazes me that Google has not yet implemented an encrypted storage standard into Android Studio. This issue shouldn't be an us problem if we're using Android Studio to build apps for Google's ecosystem.

  • @ahoangnguyen6745
    @ahoangnguyen6745 2 ปีที่แล้ว +1

    I did a research on protecting the API key.
    with how on results you are very good. However, when the hacker gets your APK file, they will easily decompile the encrypted and get the API key easily.
    Currently, I find the best solution is to save the API key in a native C++ class or create a secure server that provides the API key

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      Option 1 can still be decompiled. Any api key can be found if someone really wants it

  • @go_better
    @go_better 2 ปีที่แล้ว

    Helloooo! Little offtopic here. Could you suggest some good, comfy android developers / freelancers community in discord? I'm trying to go that route, but I tend to lose hope while being alone, you know? Thanks for your vids, btw! They're awesome!

  • @Realmoviesstudios
    @Realmoviesstudios 5 หลายเดือนก่อน

    Thank you so much for this, but please how do I protect my web app,
    Like a WordPress website that I converted into an android app
    Is it protected as my website is protected?
    Please help me out, let me know, if I will need to protect the we app separately
    God bless you

  • @ThEGeEeK
    @ThEGeEeK 2 ปีที่แล้ว +1

    What you know I have done !! . The scarry part is that how easy is that !!! .Mailed to the concerned person.

  • @VikramsinhChampavat
    @VikramsinhChampavat ปีที่แล้ว

    Will this approach stop Google Play team to give an error of "Leaked GCP API Keys"?

  • @mostafaelnagar900
    @mostafaelnagar900 2 ปีที่แล้ว

    great great great
    if you could make a video about how to use Cmake to secure Api key
    it will be good

  • @ahmedmudassir1035
    @ahmedmudassir1035 ปีที่แล้ว

    what about the team member checks the data of the API file using debug mode? whats the purpose of hiding from team members?

  • @MenaSamer
    @MenaSamer 2 ปีที่แล้ว

    it will be good to add more videos about that topic

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +1

      What is still unclear?

    • @MenaSamer
      @MenaSamer 2 ปีที่แล้ว

      @@PhilippLackner everything is clear for me, I mean more tips about security as you mentioned at the end of the video

  • @kishanpmevada
    @kishanpmevada 2 ปีที่แล้ว

    Hello, Thank for the information, I just want to ask you a question, Can we store api key using native code with C++ ?? is that a legal way to put api keys in code ?

    • @dmytroberezhnyi717
      @dmytroberezhnyi717 2 ปีที่แล้ว

      it a is legal way, and I think it is more safe to store it there. But you should not store your API key in native code just like that. Make some magic function that builds your API key, so it is really hard to read the assembler code with some confused logic and get your API key

  • @moloodayat6039
    @moloodayat6039 5 หลายเดือนก่อน

    Can you make a video about certificate pinning?

  • @nitinpatil6235
    @nitinpatil6235 18 วันที่ผ่านมา

    insightful

  • @muhannddh
    @muhannddh 2 ปีที่แล้ว

    How about to secure room DB and encryption the record inside the room

  • @hansheng654
    @hansheng654 2 ปีที่แล้ว +4

    Api key shouldn't be used as authentication anyway. They are for authorisation. You should still be authenticated otherwise like oauth and perhaps retrieve the key from server dynamically.

    • @llothar68
      @llothar68 7 หลายเดือนก่อน

      How should this be a difference? Technically it’s the same problem

  • @manohar_reddy_anugu
    @manohar_reddy_anugu 2 ปีที่แล้ว

    Hi it was me who gave the firebase suggestion on stack over flow. Too Sad that it is still the only way .

  • @yeyaanshkit
    @yeyaanshkit 2 ปีที่แล้ว +1

    Hi Brother Philipp can you please create a guide video for becoming an Android Developer using Kotlin...
    Specially for Students in College..
    Like where to follow the materiel...
    Please a New video on this topic will be lit 😊 Please...

    • @peeranpc4262
      @peeranpc4262 ปีที่แล้ว

      Yaar you can start with Udacity courses. Trust me, they are free and top notch! I am speaking with experience because I asked the same question last year...

  • @sreeshtyraychoudhury2713
    @sreeshtyraychoudhury2713 2 หลายเดือนก่อน

    what if we want to share across other dev

  • @AhmedAli-ld6en
    @AhmedAli-ld6en 2 ปีที่แล้ว

    philip can you please make a video about paging 3 with rick and morty API and room caching

  • @rogercolque
    @rogercolque ปีที่แล้ว

    you said that i can get this key with other tools revers engineering?
    what aabout an API_KEY

  • @abhisheks2135
    @abhisheks2135 2 ปีที่แล้ว +1

    Please make a video to secure api keys from NDK.

  • @rvnareshkumar
    @rvnareshkumar 2 ปีที่แล้ว

    Can You do a video on Securing webservices calls

  • @kamertonaudiophileplayer847
    @kamertonaudiophileplayer847 2 ปีที่แล้ว

    I also used minSdk 21, but Android auto requires 23, so I bumped a little.

  • @andrewdunbar828
    @andrewdunbar828 7 หลายเดือนก่อน

    Is this using Groovy rather than Kotlin DSL? I'm having trouble following it. - Answer is yes by the way.

    • @OP-pv6un
      @OP-pv6un 7 หลายเดือนก่อน +1

      this using only Groovy (all old videos using Groovy) ,, Kotlin DSL is new 2023

    • @andrewdunbar828
      @andrewdunbar828 7 หลายเดือนก่อน

      @@OP-pv6un Ah I only really started Android in 2023 so didn't realize it was so new. Thanks.

  • @aurinkobay7118
    @aurinkobay7118 9 หลายเดือนก่อน +3

    hey people does anyone know which import goes into 4:08? Properties properties = new Properties() thnx
    I get
    Properties properties = new Properties()
    1st Properties has error Classifier 'Properties' does not have a companion object, and thus must be initialized here
    equal sign has red underline
    new Properties() - Properties ()
    Properties properties = new Properties()
    properties.load(project.rootProject.file("local.properties").newDataInputStream())
    buildConfigField("String", "ARC_API_KEY", "\"${properties.getProperty("ARCMAP_API_KEY")}\""
    load is red -Unresolved reference: load
    newDataInputStream() - Unresolved reference: newDataInputStream
    properties.getProperty - getProperty is red underline
    I am so lost it is not even funny ... thanx!

    • @naveenshah8032
      @naveenshah8032 8 หลายเดือนก่อน +1

      hey did you solved the error

    • @BCS_AAMIRASHRAF
      @BCS_AAMIRASHRAF หลายเดือนก่อน +1

      //protect api key
      val properties=Properties()
      properties.load(project.rootProject.file("local.properties").inputStream())
      buildConfigField ("String","API_KEY","\"${properties.getProperty("API_KEY")}\"")
      buildFeatures{
      viewBinding=true
      buildConfig = true
      }
      //hope the error got resolved

  • @ubersticks
    @ubersticks ปีที่แล้ว +1

    The "buildConfigField" causes an error with newer versions of Gradle and Android Studio: "Build Type contains custom BuildConfig fields, but the feature is disabled". You can fix this by adding
    android {
    ...
    buildFeatures {
    ...
    buildConfig = true
    }
    }

    • @LabGecko
      @LabGecko 9 หลายเดือนก่อน

      Just ran into this myself. To be clear for others, that code goes in the App level build.gradle file, listed in Android Studio Giraffe as build.gradle( :app)

  • @kingrajveer2885
    @kingrajveer2885 2 ปีที่แล้ว

    Please make one video for firebase rulse for specific app.

  • @OlafJapp
    @OlafJapp ปีที่แล้ว

    Its good to use API keys only on the server, but if someone is faking a client, then its possible to attack the server with replay attacks. So we need to secure also the communication with the server. And how can we tell the server that we are the original client? We still need an API key for our server?

    • @PhilippLackner
      @PhilippLackner  ปีที่แล้ว

      If the server uses it, the client can't abuse it though but only via the API the server exposes. If the server has a rate limit for example the client can't do anything about it since they still don't know the key. And if the server is really strict with incoming params the client can't get more info than a normal logged in user for example

  • @user-vj8dj1pb7l
    @user-vj8dj1pb7l 8 หลายเดือนก่อน

    be careful if you use multiple module structure. there is need to pay attention - which gradle to update

  • @muyassarabdullah1504
    @muyassarabdullah1504 2 หลายเดือนก่อน

    why in my code Properties not resolved

  • @pixamob8452
    @pixamob8452 2 ปีที่แล้ว +10

    It's okay to use the application signature as an additional key and check it on the server side to ensure that the request is coming from my application

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +3

      Exactly

    • @shlusiak
      @shlusiak 2 ปีที่แล้ว +10

      What stops an attacker to just send the right signature from a modified version of your app? You can't trust the client.

    • @moustafaelsaghier8552
      @moustafaelsaghier8552 ปีที่แล้ว

      Can you tell me more about this approach please?

    • @dmitriymorozov2680
      @dmitriymorozov2680 ปีที่แล้ว

      I would want to hear that approach too

    • @OlafJapp
      @OlafJapp ปีที่แล้ว +2

      If you use a application signature you can reuse that in a replay attack (sending the same signature from an attacker app).

  • @andrevini8099
    @andrevini8099 ปีที่แล้ว

    Hey guys, I have a doubt, If i put this apiKeys as local files how do you guys send them to github, or CD/CI softwares ?

    • @PhilippLackner
      @PhilippLackner  ปีที่แล้ว +1

      You'll need to create the local.properties file with your API key using a script step before building the project

  • @rameswartarai8452
    @rameswartarai8452 2 ปีที่แล้ว

    I like your videos. Can you create a video explaining how to prevent our app from rooted devices?

    • @maskedredstonerproz
      @maskedredstonerproz 2 ปีที่แล้ว

      Prevent them being installed on rooted devices?? why would you want that??

  • @alexjames1575
    @alexjames1575 ปีที่แล้ว

    I need a little help from you sir
    How can we get to communicate with each other.
    I need a little help with something.

  • @totktonadafrakc5948
    @totktonadafrakc5948 2 ปีที่แล้ว

    Downloading api key through firebase is meanless, as nothing prevents attackers from making app with the same package name and google-services and obtaining keys on launch.

  • @clarkkent1473
    @clarkkent1473 ปีที่แล้ว +2

    DO NOTE
    with smali editing, it is possible that someone could invoke Log.v on variables until an api key like value is reported
    if function chaining is done, eg
    FUNC(SECURE_GET());
    then one could unchain this to see what SECURE_GET returns

  • @ahmednashwan8111
    @ahmednashwan8111 2 ปีที่แล้ว

    This is so good, thanks a lot, but I think this solution is not the best, the attacker can access the key if he have experience on attacking, I think I have something more secure I wanna share that in next comment, and if that is good or not please discuss me about that, thanks a lot, have a nice day.

  • @valeriyo
    @valeriyo 2 ปีที่แล้ว

    Why are you still using Groovy gradle scripts, not Kotlin DSL? 😒

  • @911_Shorts
    @911_Shorts 10 หลายเดือนก่อน

    If I put my API Key in my server, then my server also has a server token which validates requests from either app or hacker sites. But now the question is, the server token is still in my app !! Hackers can get it and use it to find the actual API key !!

  • @ABCABC-sw8mh
    @ABCABC-sw8mh 3 หลายเดือนก่อน +1

    why using the api key directly in the code? you can just send a request to your own server that handles the api key and asks the api

    • @PhilippLackner
      @PhilippLackner  3 หลายเดือนก่อน

      Because lots of APIs don't work that way. For example the Google maps sdk for Android expects the key to be merged into the manifest. Also you still need to protect the server then, since what would keep an attacker back from making the same request?

  • @nevardreik
    @nevardreik 2 ปีที่แล้ว +8

    An even easier way of accessing local.properties is: val localProperties = gradleLocalProperties(rootDir) - then you can use localProperties["someKey"] to access its value.

    • @and70
      @and70 ปีที่แล้ว

      Ty for wasting my time, its not even working.

    • @nevardreik
      @nevardreik ปีที่แล้ว +2

      @@and70 you’re welcome.

  • @fatihkoc1520
    @fatihkoc1520 ปีที่แล้ว

    hey philip i cant access the api key in release version because its in local.properities what is the meaning of it when we cant use apikey :d

  • @haykmkrtchyan7093
    @haykmkrtchyan7093 2 ปีที่แล้ว

    Can I save it in EncryptedSharedPreferences? Or attackers can decrypt that?

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      How are you going to do that? You'll have a function call somewhere where you save the plain text api key in shared pref and therefore the key will be in memory once.

    • @haykmkrtchyan7093
      @haykmkrtchyan7093 2 ปีที่แล้ว

      @@PhilippLackner oh right 😅

  • @streetfood7161
    @streetfood7161 2 ปีที่แล้ว

    make jni folder and create file C to save the key and then use NDK to load the library, I think this is the best way.

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      Can still be found by reverse engineering

    • @sharmpuneet
      @sharmpuneet 2 ปีที่แล้ว

      Decompiling APK won’t work with NDK but hacker can use deassembler and check .so files. NDK is still better than saving in build.gradle. It makes life of a hacker a little difficult

    • @AmirRaza1
      @AmirRaza1 2 ปีที่แล้ว

      Do not put keys in plain string format in jni. Anyone can find .so file and extract that one.

  • @noelgozon2454
    @noelgozon2454 ปีที่แล้ว

    I am using NDK to secure my keys.

  • @rami8442
    @rami8442 2 ปีที่แล้ว

    Hi,
    Can you create some videos about firebase function with firestore ?
    Thank you

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      Did already

    • @rami8442
      @rami8442 2 ปีที่แล้ว

      @@PhilippLackner Sorry i mean "cloud firestore function triggers".

  • @peeranpc4262
    @peeranpc4262 2 ปีที่แล้ว

    What's the difference between the approach you showed in your dictionary app series and this one??
    Please explain a bit.
    Thank you! ❤️❤️❤️

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +1

      I don't remember what I did there haha

    • @peeranpc4262
      @peeranpc4262 2 ปีที่แล้ว

      @@PhilippLackner What you did is :
      In app gradle
      buildConfig("String", "API_KEY", API_KEY) instead of properties etc
      Is this the same as new approach??

  • @MadManiacsam
    @MadManiacsam 2 ปีที่แล้ว

    What if we make a cmake file and put api keys inside that ? Then use .gitignore.

  • @chirantanbhakhar5241
    @chirantanbhakhar5241 4 หลายเดือนก่อน

    Moral: We can only slow down the reverse engineering, Can't completely block third-party access to the API 🙂

  • @khapp7821
    @khapp7821 2 ปีที่แล้ว

    Please make the sound a little louder.

  • @AmirRaza1
    @AmirRaza1 2 ปีที่แล้ว

    Gradle in not the secure way to put keys. Anyone can find BuildConfig file after reverse engineer and extract that one easily.

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      Congrats for not fully watching the video

  • @hikmetqedirov8337
    @hikmetqedirov8337 2 ปีที่แล้ว

    👌👍

  • @shmnysm7481
    @shmnysm7481 ปีที่แล้ว

    Another solution is store api key inside an encrypted prepopulate local database

    • @PhilippLackner
      @PhilippLackner  ปีที่แล้ว

      How do you want to pre-populate it? At some place in your code you'll have to do that and the API key will be the parameter for that function in clear text.

    • @shmnysm7481
      @shmnysm7481 ปีที่แล้ว

      ​@@PhilippLackner prepopulate a Room database from a prepackaged database file that is located apk assets directory.

    • @PhilippLackner
      @PhilippLackner  ปีที่แล้ว

      @@shmnysm7481 Then the key will be somewhere in your code to decrypt it. Again, you can make it harder of course, but if someone really wants it, they'll find it.

  • @alexjames1575
    @alexjames1575 ปีที่แล้ว

    Hey bro

  • @danishmehmood5375
    @danishmehmood5375 ปีที่แล้ว

    not useful, anyone can crack the key and API hit during the call, with network trace.

  • @ashar9327
    @ashar9327 2 ปีที่แล้ว

    🌹🤗

  • @antimahesaclubamc5665
    @antimahesaclubamc5665 ปีที่แล้ว +1

    Please tutor in java dont on kotline.. please

  • @breakeract796
    @breakeract796 2 ปีที่แล้ว

    There is no secure by this way :D
    I think you never reverse app to get API key before :D
    This way just hide the key from source code, but when you build to apk file...the key must be provide and compress inside apk file :D

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว

      Oh, another one who didn't watch the video

    • @breakeract796
      @breakeract796 2 ปีที่แล้ว

      @@PhilippLackner Yes I did. You can easy to retrieve the API key by RE

  • @ssEACatt
    @ssEACatt ปีที่แล้ว

    This one felt a bit like click bait 😅"How to hide and protect" - "you can't", but only said after half the video content

  • @rajeshkanna9502
    @rajeshkanna9502 2 ปีที่แล้ว

    This may sound childish. But wont keeping our own safe word for the variable name "API_KEY" to something like "AWOOGA" make it difficult for them🤣
    edit:
    oh nvm. I just reached the end of video, and already realised the minifyenabled does the job

    • @PhilippLackner
      @PhilippLackner  2 ปีที่แล้ว +4

      Just call it ENCRYPTED_API_KEY, they'll think they can't use it and won't even try🌝

    • @rajeshkanna9502
      @rajeshkanna9502 2 ปีที่แล้ว

      @@PhilippLackner 🤣🤣🤣🤣

  • @alfa.voland
    @alfa.voland 11 หลายเดือนก่อน

    This is not hiding the key, but its absence)) as they say, there is no key and you don't need to protect anything😂