Skip to content

Instantly share code, notes, and snippets.

View iniyan455's full-sized avatar
🎯
Focusing

Iniyan Murugavel iniyan455

🎯
Focusing
View GitHub Profile
@iniyan455
iniyan455 / deeplink adb
Created May 12, 2021 11:16
Deeplink Trigger from adb command
@iniyan455
iniyan455 / git tag
Created May 12, 2021 11:15
Git Tag
Git Tag
There are two tag
1.Lightweight Tag
2.Annotated Tag
Lightweight Tag is used for requires only a quick and easy tag command
git tag v1.o
@iniyan455
iniyan455 / Ssh
Created May 12, 2021 11:14
SSH integration in Android
How to add ssh in system and add in github
1. ssh-add -l
2.ssh-keygen -t rsa -b 4096 -C "joe@example.com"
3.Press Enter to accept the default file location
4.Enter a secure passphrase
5.cat .ssh/id_rsa.pub
Github
Settings -Select SSH and GPG keys - Click New SSH key -Enter a title in the field -Paste your public key into the Key field -Click Add SSH key
@iniyan455
iniyan455 / git crlf
Last active January 22, 2021 11:03
warning: CRLF will be replaced by LF in gradlew.bat
In Unix systems the end of a line is represented with a line feed (LF). In windows a line is represented with a carriage return (CR) and a line feed (LF) thus (CRLF). when you get code from git that was uploaded from a unix system they will only have an LF.
If you are a single developer working on a windows machine, and you don't care that git automatically replaces LFs to CRLFs, you can turn this warning off by typing the following in the git command line
git config core.autocrlf true
rm -f ./.git/index.lock
@iniyan455
iniyan455 / gist:2be6c17292be31a337fed071a6419c0c
Created December 12, 2020 12:54
About Proguard Mapping File upload to particular version while releasing apk in playstore
PROGUARD
Generally ProGuard is a tool to help minify, obfuscate, and optimize your code.
It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute towards the intrinsic 64k method limit of Android applications. Because of the latter issue, ProGuard is often recommended to be used both in development and production especially for larger applications.
ProGuard can be enabled by using the minifyEnabled option for any build type.
If you intend to use it for production, it is highly recommended you also enable it on your development.
https://miro.medium.com/max/2640/1*J-9cAvm8kSn001rXGDtwxg.png
Generally retracing this kind of error log have two ways.Lets discuss one by one
Get the mapping.txt file and retrace the logs using proguardgui
@iniyan455
iniyan455 / gist:92a04a87caf09ffc18f4eb53ccacf4a1
Created October 15, 2020 05:02
Context instead of Activity
public Activity getActivity(Context context)
{
if (context == null)
{
return null;
}
else if (context instanceof ContextWrapper)
{
if (context instanceof Activity)
{
@iniyan455
iniyan455 / DeadSystemException throws from os
Last active September 17, 2020 16:42
deadsystemexception-start-service-android
This crash is present on:
all Samsung devices 7.0
all Nexus devices on 7.1.2
When the device is being restarted, you cannot run an app. Any app, not just yours but any given app cannot run when the device is restarting. AFAIK it occurs when you try to do something when the system crashes.
Meaning if the system crashes and as it restarts your app starts a service or does something you get that error.
@iniyan455
iniyan455 / Security verdicts
Created September 17, 2020 09:12
Temparing code to find in android code
And now you just need to call the method isHacked from your onCreate method in your initial Activity to check that your application was renamed or relocated.
public boolean isHacked(Context context, String myPackageName, String google, String amazon)
{
//Renamed?
if (context.getPackageName().compareTo(myPackageName) != 0) {
return true; // BOOM!
}
//Relocated?
@iniyan455
iniyan455 / gist:2f8a006a47682076eccb19c0765ff5e4
Last active September 3, 2020 18:20
Live Template in android studio for common use case
File and code templates option in android studio to automate creation of recyclerview adapter.
AndroidStudio -> Preference->Editor->File and Code Template
Click plus icon at the top then you will see a panel with name, extension and code template editor. All you need to do is enter the template name, mention the extension(kt, java or xml) and paste the above template here and click OK. It’s done, all you need to do is just navigate to the package where you want to create the adapter and right click on it and select then you should see a file with name you mentioned while creating file template.
Feel free to comment if there any suggestions or improvements
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME}#end
@iniyan455
iniyan455 / gist:91bf8e62a87826a69e9f6eced615873a
Created June 29, 2020 08:10
Application Url or User credentials Security after Reverse Engineering
#About Security
Absolute security does not exist. Security is a set of measures, being piled up and combined, trying to slow down the inevitable.
https://medium.com/google-developer-experts/a-follow-up-on-how-to-store-tokens-securely-in-android-e84ac5f15f17
NDK Decode :-
String key1 = new String(Base64.decode(getNativeKey1(),Base64.DEFAULT));
String key2 = new String(Base64.decode(getNativeKey2(),Base64.DEFAULT));
https://medium.com/@abhi007tyagi/storing-api-keys-using-android-ndk-6abb0adcadad
https://medium.com/@himanshusoni501/safest-way-to-secure-your-app-server-credentials-7894fb4f4fe4