<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ramoliya Yug on Medium]]></title>
        <description><![CDATA[Stories by Ramoliya Yug on Medium]]></description>
        <link>https://medium.com/@ramoliyayug55?source=rss-56078d6000ef------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2agslGBtQPFc5pzX</url>
            <title>Stories by Ramoliya Yug on Medium</title>
            <link>https://medium.com/@ramoliyayug55?source=rss-56078d6000ef------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 19:41:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramoliyayug55/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CLEARTEXT Not Permitted and Socket Errors in Android (Retrofit + Spring Boot + Kotlin)]]></title>
            <link>https://medium.com/@ramoliyayug55/cleartext-not-permitted-and-socket-errors-in-android-retrofit-spring-boot-kotlin-2efad0e01253?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/2efad0e01253</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 17:03:29 GMT</pubDate>
            <atom:updated>2025-07-26T17:03:29.586Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, while learning Spring Boot with Kotlin, I created a simple backend REST API as a learning project. To take things further, I decided to build an Android client app that communicates with this backend. The backend server was running locally on my machine, and everything worked great, until I tried to make my first network call from the Android app. that’s when the real frustration of development comes this comes first app gets crash and this is popup in the logcat</p><pre>java.net.UnknownServiceException: CLEARTEXT communication to 10.0.2.2 not permitted by network security policy</pre><p>these is the common error developers face when connecting an Android app to a local backend during development so let’s discuss what it is really</p><p><strong>CLEARTEXT Not Permitted :</strong></p><p>Android 9 (API level 28) and above block all unencrypted HTTP (cleartext) traffic by default. This is a security feature designed to enforce HTTPS across all apps.</p><p>However, during development, especially when your backend is running locally and you’re using URLs like <a href="http://10.0.2.2:8000/">http://10.0.2.2:8000</a> , this restriction becomes a problem.</p><p>To fix this, you have to explicitly allow cleartext communication to <a href="http://10.0.2.2:8000/">10.0.2.2</a></p><h4>Steps To Solve This Error :</h4><p>Step-1 : Allow Cleartext traffic</p><ul><li>i am using compose project so i created file networkSecurityConfig.xml under res/xml folder with this kind of code</li></ul><pre>&lt;network-security-config&gt;<br>    &lt;domain-config cleartextTrafficPermitted=&quot;true&quot;&gt;<br>        &lt;domain includeSubdomains=&quot;true&quot;&gt;10.0.2.2&lt;/domain&gt;<br>    &lt;/domain-config&gt;<br>&lt;/network-security-config&gt;</pre><p>Step-2 : Menifest Reference</p><ul><li>then i referenced this file in AndroidMenifest.xml in &lt;application&gt; tag</li></ul><pre>&lt;application<br>    android:networkSecurityConfig=&quot;@xml/network_security_config&quot;<br>    android:usesCleartextTraffic=&quot;true&quot;<br>    ... &gt;</pre><p>Step-3 : Add Internet Permission</p><ul><li>in AndroidMenifest.xml make sure to add this otherwise you will get new error java.net.SocketException</li></ul><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;</pre><p>Step-4 : Use Proper URL In Retrofit</p><pre>http://10.0.2.2:8000 // 8000 is port on which backend is running</pre><p>this is the process to solve when you want to run the client app on emulator but what if you want to test the app in the real android device</p><h4>For Real Devices :</h4><ul><li>for this you need to know the ip address</li><li>run command ‘ip a’ on ubuntu and for windows i guess it should be ‘ipconfig’ (just recheck it idk exactly about windows)</li><li>and then update this ip in the URL and config file</li></ul><blockquote>I hope this guide saves you hours of frustration. happy coding :)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2efad0e01253" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to GCD (Greatest Common Divisor)]]></title>
            <link>https://medium.com/@ramoliyayug55/the-ultimate-guide-to-gcd-greatest-common-divisor-31d9dd09bb22?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/31d9dd09bb22</guid>
            <category><![CDATA[dsa-problem]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Mon, 21 Jul 2025 12:26:55 GMT</pubDate>
            <atom:updated>2025-07-21T12:27:15.042Z</atom:updated>
            <content:encoded><![CDATA[<p>Number theory concepts are oftenly used in the dsa and cp and the most used topic is GCD so this will be the full guide to master the GCD.</p><h4>What is GCD ? :</h4><p>The GCD of two integers a and b is the largest integer d that divides both a and b without leaving a remainder.</p><p>in simple and mathematical terms</p><p>if gcd(a,b) = d then d|a and d|b and the d is the greatest number</p><h4>Basic Properties Of GCD :</h4><p><strong>1. gcd(a, b) = gcd(b, a) : </strong>GCD is commutative.</p><p><strong>2. gcd(a, 0) = a : </strong>This acts as the base case in recursive algorithms.</p><p><strong>3. gcd(a, b) = gcd(a-b, b) : </strong>This is used in the subtraction version of the Euclidean algorithm.</p><p><strong>4. gcd(a, b) = gcd(a%b, b) : </strong>This is the most efficient and commonly used method, known as the Euclidean algorithm.</p><h4>Approaches to Find GCD :</h4><p><strong>1. Naive Approach :</strong></p><ul><li>in this method we start form the min(a,b) and move downwards till the first divisor found look at the code.</li></ul><pre>public static int gcd(int a, int b) {<br>    for (int i = Math.min(a, b); i &gt;= 1; i--) {<br>        if (a % i == 0 &amp;&amp; b % i == 0) {<br>            return i; <br>        }<br>    }<br>    return 1;<br>}</pre><p><strong>2. Efficient Approach (Euclidean Algorithm) :</strong></p><ul><li>in this we use two properties of gcd that we learned above one is the base case one and other is modulo property just have a look in the recursive code</li></ul><pre>public static int gcd(int a, int b) {<br>    if (b == 0) return a;<br>    return gcd(b, a % b);<br>}</pre><p>in this eventually reminder becomes the 0 and the last non zero number is the GCD, now have a look on the Iterative version of that recursive version</p><pre>public static int gcd(int a, int b) {<br>    while (b != 0) {<br>        int temp = b;<br>        b = a % b;<br>        a = temp;<br>    }<br>    return a;<br>}</pre><h4>Time Complexities :</h4><p>Naive approach : O(min(a,b))</p><p>Euclidean Algo : O(log(min(a, b))) , because there is one more fact of the modulo operator which is a%b &lt; a/2, so every time we take modulo the number becomes half and this will lead to the logarithmic time complexity</p><h4>LCM from GCD :</h4><p>to find the lcm we again use the fact which is about the how gcd and lcm related which says multiplication of the lcm and gcd of two numbers is equal to multiplication of that two numbers.</p><p>so this is how we can find lcm very easily</p><pre>public static int lcm(int a, int b) {<br>    return (a * b) / gcd(a, b);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31d9dd09bb22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Ultimate Guide to Sorting in Java]]></title>
            <link>https://medium.com/@ramoliyayug55/the-ultimate-guide-to-sorting-in-java-608f1da8ff91?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/608f1da8ff91</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[sorting-algorithms]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Fri, 18 Jul 2025 12:17:50 GMT</pubDate>
            <atom:updated>2025-07-18T12:17:50.582Z</atom:updated>
            <content:encoded><![CDATA[<p>Every DSA journey begins with learning fundamental searching and sorting algorithms. While we study these for logical thinking and algorithmic understanding, in practice we rarely implement them from scratch. Instead, Java provides optimized, ready to use methods: Arrays.sort() for arrays and Collections.sort() for the Lists</p><p>Behind the scenes, these methods use highly optimized versions of algorithms like: Dual-Pivot Quicksort (for primitives) and TimSort (a hybrid of Merge Sort and Insertion Sort for objects)</p><p>But here’s what many beginners miss-these methods aren’t just for basic sorting. Their real power comes from the ability to fully customize sorting logic through comparators.</p><p>This will be the ultimate guide for you to learn sorting from basic to advanced techniques used in CP.</p><h4>1. Natural Order Sorting (Comparable) :</h4><p>this is normal sorting which by default rely on the Comparable interface, classes like Integer,String implement it</p><pre>int[] numbers = {5, 2, 9, 1};<br>Arrays.sort(numbers); // [1, 2, 5, 9]<br><br>String[] names = {&quot;John&quot;, &quot;Alice&quot;, &quot;Bob&quot;};<br>Arrays.sort(names); // [&quot;Alice&quot;, &quot;Bob&quot;, &quot;John&quot;]<br>Arrays.sort(names, name.CASE_INSENSITIVE_ORDER); // self explanatory<br><br>List&lt;Integer&gt; numsList = Arrays.asList(5, 2, 9, 1);<br>Collections.sort(numsList); // [1, 2, 5, 9]</pre><h4>2. Custom Sorting (Comparator) :</h4><p>when you need custom logic then use Comparator. for example,</p><p>2.1 Lambda Expressions:</p><pre>// Sort in descending order<br>Arrays.sort(numbers, (a, b) -&gt; b - a);<br><br>// Sort strings by length<br>Collections.sort(names, (s1, s2) -&gt; s1.length() - s2.length());</pre><p>but avoid using this (a,b) → b-a , this can lead to overflow</p><p>2.2 Method References :</p><pre>int[] arr = {3, 7, 2, 9, 5};<br>// Sort by mod 3 values<br>Arrays.sort(arr, (a, b) -&gt; Integer.compare(a % 3, b % 3));<br><br>// Sort by string length<br>Collections.sort(names, Comparator.comparingInt(String::length));<br><br>// Sort by length, then alphabetically<br>Collections.sort(names, <br>    Comparator.comparingInt(String::length)<br>              .thenComparing(Comparator.naturalOrder()));</pre><p>use this method reference to avoid overflow</p><h4>3. Advanced Sorting Techniques :</h4><p>3.1 Multi-Field Sorting</p><pre>class Person {<br>    String name;<br>    int age;<br>    double salary;<br>}<br><br>List&lt;Person&gt; people = ...;<br><br>// Sort by age → name → salary<br>Collections.sort(people, <br>    Comparator.comparingInt(Person::getAge)<br>              .thenComparing(Person::getName)<br>              .thenComparingDouble(Person::getSalary));</pre><p>3.2 Handling Null Values :</p><pre>List&lt;String&gt; listWithNulls = Arrays.asList(&quot;Bob&quot;, null, &quot;Alice&quot;);<br><br>// Nulls first<br>Collections.sort(listWithNulls, <br>    Comparator.nullsFirst(Comparator.naturalOrder()));//[null, &quot;Alice&quot;, &quot;Bob&quot;]<br><br>// Nulls last<br>Collections.sort(listWithNulls, <br>    Comparator.nullsLast(Comparator.naturalOrder()));//[&quot;Alice&quot;, &quot;Bob&quot;, null]</pre><p>3.3 Custom Order (Non-Natural) :</p><pre>List&lt;String&gt; customOrder = Arrays.asList(&quot;HIGH&quot;, &quot;MEDIUM&quot;, &quot;LOW&quot;);<br>List&lt;String&gt; priorities = Arrays.asList(&quot;MEDIUM&quot;, &quot;LOW&quot;, &quot;HIGH&quot;);<br><br>// Sort based on predefined priority<br>Collections.sort(priorities, <br>    Comparator.comparingInt(s -&gt; customOrder.indexOf(s))); //[&quot;HIGH&quot;, &quot;MEDIUM&quot;, &quot;LOW&quot;]</pre><p>we have covered the theory part now let’s jump into some specific patterns used in the DSA and CP</p><h4>4. DSA &amp; Competitive Programming Optimizations :</h4><p>4.1 the first use case is that sometimes we want to sort the 2D array based ton the second column</p><pre>Arrays.sort(arr, (a, b) -&gt; Integer.compare(a[1], b[1]));</pre><p>but also what we do when it get’s tie here are the methods too, you can litrally pass whole lamda in the parameter do not forget that</p><pre>Arrays.sort(arr, (a, b) -&gt; {<br>    if (a[1] == b[1]) return Integer.compare(a[0], b[0]);<br>    return Integer.compare(a[1], b[1]);<br>});</pre><p>4.2 there are many questions related to the frequencies of given data so sometimes we need to sort based on the hashmap frequency</p><pre>Map&lt;Integer, Integer&gt; freq = new HashMap&lt;&gt;();<br>for (int x : arr) freq.put(x, freq.getOrDefault(x, 0) + 1);<br><br>Arrays.sort(arr, (a, b) -&gt; {<br>    int fa = freq.get(a), fb = freq.get(b);<br>    if (fa == fb) return Integer.compare(a, b);<br>    return Integer.compare(fa, fb);<br>    // to sort in decending use return Integer.compare(fb, fa)<br>});</pre><p>4.3 sometimes some greedy algorithm question says like this, Choose highest value, but in tie, smallest weight, etc.</p><pre>Arrays.sort(arr, (a, b) -&gt; {<br>    if (a.value == b.value) return Integer.compare(a.weight, b.weight);<br>    return Integer.compare(b.value, a.value); // higher value first<br>});</pre><p>4.4 Sorting Using Comparator Chaining :</p><pre>Arrays.sort(objects, Comparator<br>    .comparing((Obj o) -&gt; o.primaryKey)<br>    .thenComparing(o -&gt; o.secondaryKey)<br>    .thenComparing(o -&gt; -o.tertiaryKey) // descending<br>);</pre><p>4.5 bonus method : Parallel Sorting (Large Datasets)</p><pre>int[] largeArray = new int[1_000_000];<br>Arrays.parallelSort(largeArray);</pre><p>some more tips for cp :</p><ul><li>Arrays.sort() is usually faster than Collections.sort().</li><li>If input is primitive array, you can’t use<strong> </strong>comparator directly, use Integer[] instead.</li><li>Sorting is O(N log(N)), so do not sort inside loops.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=608f1da8ff91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimized Prime Factorization in CP]]></title>
            <link>https://medium.com/@ramoliyayug55/optimized-prime-factorization-in-cp-716c1a084095?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/716c1a084095</guid>
            <category><![CDATA[dsa-problem]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Wed, 16 Jul 2025 12:57:25 GMT</pubDate>
            <atom:updated>2025-07-16T12:58:35.318Z</atom:updated>
            <content:encoded><![CDATA[<p>So, till now we have done questions like the if given number is prime or not or generate prime numbers till given numbers and like that but never solved like getting the prime factors of the number which is large too</p><p>today i was solving <a href="https://www.hackerrank.com/contests/projecteuler/challenges/euler003/problem?isFullScreen=true">HackeRrank projectEuler question-3</a> , the question is slightly different but for general i came up with this block of method which takes and number up to 10¹² and returns the list of prime factors in increasing sorted manner</p><pre>public static List&lt;Long&gt; primeFactors(Long n){<br>    List&lt;Long&gt; res = ArrayList&lt;&gt;();<br>    if(n&lt;=1) return res;<br>    while(n%2==0){<br>        res.add(2L);<br>        n/=2;<br>    }<br>    for(Long i=3;i&lt;=Math.sqrt(n);i++){<br>        while(n%i==0){<br>            res.add(i);<br>            n/=i;<br>        }<br>    }<br>    if(n&gt;=2){<br>        res.add(n);<br>    }<br>    return res;<br>}</pre><p>we can break the this approach in few little steps:</p><ol><li>divide the number by 2 untill it becomes the odd</li><li>then check all divisors from 3 to √n (because any factor &gt; √n has been checked in the loop already)</li><li>divide n each time when you find the factor</li><li>if the remaining number is still more than 2 it means that is prime so add that lastly</li></ol><p>The worst case time complexity is O(√n)</p><p>but it is very optimal due to skipping the even numbers and by each division number becomes smaller</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=716c1a084095" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Universal Divisibility Rule In CP]]></title>
            <link>https://medium.com/@ramoliyayug55/universal-divisibility-rule-in-cp-8ae09e9650af?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ae09e9650af</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[dsa-problem]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Tue, 15 Jul 2025 17:07:02 GMT</pubDate>
            <atom:updated>2025-07-15T17:07:03.279Z</atom:updated>
            <content:encoded><![CDATA[<p>Remember the time when we were kids and learned some basic divisibility rules starting with 2, 3, 5, 10… and later, maybe 9 and 11 in higher classes? Well,times have changed.</p><p>So today i was doing the <a href="https://www.geeksforgeeks.org/problems/divisible-by-13/1">problem of the day on gfg</a> at the first sight it seems very easy the question was just to check if given number is divisible by 13 or not that simple but there was the twist the constraints<strong> </strong>are to the 10⁵ and expected complexity was O(n) so at the very first we can think of using simple % operator but since the number is provided as a string and is too large to fit even in a long. so that will not work</p><pre>public static Boolean isDivisible(String num , int divisibleBy){<br>    int n = num.size();<br>    int rem = 0;<br>    for(int i=0;i&lt;n;i++){<br>        int digit = num.charAt(i)-&#39;0&#39;;<br>        rem = (rem * 10 + digit) % divisibleBy;<br>    }<br>    return rem == 0;<br>}</pre><p>this method takes a number as a string and integer this is the steps to understand this :</p><ol><li>take size and initialize the rem means reminder by 0;</li><li>then iterate through the each digit of the string and take one digit and convert to int</li><li>then update the reminder by Update the remainder by adding the digit and taking mod , This simulates the modulus of the full number without constructing it</li><li>the at last if the reminder still remains the 0 then its means the number is divisible</li></ol><p>you are building the number digit by digit like this</p><p>rem = (((((0 * 10 + d1) % divBy) * 10 + d2) % divBy) * 10 + d3) % divBy …</p><p>so this can be the universal divisibility rule checker method which can also handle the very large numbers as well and also we can add the edge cases like throw an exception while dividing with 0</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ae09e9650af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why System.out.print() Causes TLE for Large Input and Output]]></title>
            <link>https://medium.com/@ramoliyayug55/why-system-out-print-causes-tle-for-large-input-and-output-1f1ec02da642?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f1ec02da642</guid>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[dsa-problem]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Mon, 14 Jul 2025 15:09:33 GMT</pubDate>
            <atom:updated>2025-07-14T15:09:33.396Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently i have started CSES problem set and today i attempted the task number 5 here is the <a href="https://cses.fi/problemset/task/1070">link to task</a> so i simply did this to print first even number and then odd number so there was two loops like this</p><pre>for (int i = 2; i &lt;= n; i += 2) {<br>    System.out.print(i + &quot; &quot;);<br>}</pre><p>and when i submit this code it lead me to the tle(time limit exceed) and i was like what’s the problem it has only one loop and the constraints are also fine there is no place for the tle bbut it gave let me tell you the reason</p><p>Most competitive judges measure total runtime, including I/O time so if you algorithm runs in the O(n) but the this print statement adds another O(n) I/O delay to that and it lead to tle.</p><p>when we use the print() or print() statement inside loop of n then it first calls the print() method n times then it performs the string concatenations n times so this is how the O(n) I/O delay produces and also the print() method go through many layers</p><p>to prevent that i have used the StringBuilder so that append() method run in the O(1) and the printed the string which solved the problem so never use the print statements in the loop it is the forever rule of cp.</p><pre>// same thing using StringBuilder<br>StringBuilder sb = new StringBuilder();<br>for (int i = 2; i &lt;= n; i += 2) {<br>    sb.append(i).append(&quot; &quot;);<br>}<br>System.out.println(sb.toString());</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f1ec02da642" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Journey to Hide Secrets In Android App]]></title>
            <link>https://medium.com/@ramoliyayug55/journey-to-hide-secrets-in-android-app-d465eab09bd4?source=rss-56078d6000ef------2</link>
            <guid isPermaLink="false">https://medium.com/p/d465eab09bd4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[androiddev]]></category>
            <dc:creator><![CDATA[Ramoliya Yug]]></dc:creator>
            <pubDate>Sun, 13 Jul 2025 16:14:53 GMT</pubDate>
            <atom:updated>2025-07-13T16:14:53.791Z</atom:updated>
            <content:encoded><![CDATA[<p>So i made an app like 3 months ago, named anonymous chat app ChugliHub in which you can go there and your identity will be remain the hidden the random username will generate and there is no login and all that system just go and gossip but there is no point of gossip when there is no image sharing option and the firebase storage is become paid now so i figure out the way to use the github as a unlimited cloud storage</p><p>for that i need to use the github token to read and write to the github repo through my app so and at that time i also don’t know the clean architecture and mvvm patterns and the retrofit library so i made whole app using the core okHttp library and 4 files one data class, one adapter, one preference manager file and one main activity that’s it</p><p>and now i decided to make my own appstore like thing where all my app there people come to that site and can able to see the app i have made and published to that site and i don’t know that much react so i decided to make the whole appstore in html,css and js</p><p>for that i need to put the release-apk in one folder so that when the user clicks the download button that apk gets downloded so i firstly made release apk and pushed to the github then after some time mail came from the github saying you active token has been found on the recent commit and i was like what github actually read that binary apk file and found that hardcoded string where the token lies</p><p>then i was thinking the ways to hide this so next day i found the library called proguard so basically what it does that it maps the actual class and method name to some random for example it maps getimages → hah:i3&amp;er so that if someone do reverse engineering to that apk so its hard to decode the code so i simply did that and now what the app is stopped running even with correct active token then i did more research on this library and i found that when some response is coming in you app you need to map that to data class so if i map the data class to some weird then how it finds where to map so i want to protect that thing to go under the mapping so there is thing called the proguard rules file in which you can specify the all things about what you want to keep and what not so i did that and app starts working and then i made release apk and pushed to github then guess what github still able to find that token so i was like how then i read more things about the proguard and i found that it do not maps the hardcoded strings</p><p>then some really stupid idea came in my mind just look at this</p><pre>//suppose token is &quot;ghp_abc12xyz34Token&quot;<br>private val str1 = &quot;ghp_abc1&quot;<br>private val str2 = &quot;2xyz3&quot;<br>private val str3 = &quot;4Token&quot;<br>private val token = str1 + str2 + str3</pre><p>so i did this thinking that if github is performing the string matching then it will never able to do that it will find the broken string and this will bypass this but github still sent mail saying token found. so this idea also failed</p><p>then last idea came in my mind is that what if i store the token in my firebase and fetch it and this has no other choice to work so this was the story of hiding secrets in android app</p><p>if you are still reading and knows the more security things in the android then here is my contact details it would be very helpful and will love to connect</p><p><a href="https://www.linkedin.com/in/yug-ramoliya-25a3b0308/">https://www.linkedin.com/in/yug-ramoliya-25a3b0308/</a></p><p><a href="https://www.instagram.com/ramoliyayug7/">https://www.instagram.com/ramoliyayug7/</a></p><p><a href="https://github.com/ramoliyaYug/">https://github.com/ramoliyaYug/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d465eab09bd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>