Skip to content

Commit

Permalink
New version, refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kasnder committed Jul 21, 2022
1 parent 185241c commit f4a0964
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ At the moment, this project automatically implements a consent flow if your app
- Google Ads
- Facebook SDK
- AppLovin
- Flurry
- InMobi
- AppsFlyer
- Google Play Services Advertising Identifier Library

*Note that the use of Google and Facebook services in the EU is [likely illegal even with user consent](https://noyb.eu/en/austrian-dsb-eu-us-data-transfers-google-analytics-illegal), because data is sent to the US and can be used for unlawful surveillance of EU citizens.*
Expand All @@ -42,7 +45,7 @@ allprojects {
2. Add the library:
```gradle
dependencies {
implementation 'com.github.kasnder:app-consent-android:0.3'
implementation 'com.github.kasnder:app-consent-android:0.4'
}
```
3. Initialise the library by calling
Expand Down
4 changes: 2 additions & 2 deletions library/src/main/java/net/kollnig/consent/ConsentManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import net.kollnig.consent.library.FirebaseAnalyticsLibrary;
import net.kollnig.consent.library.FlurryLibrary;
import net.kollnig.consent.library.GoogleAdsLibrary;
import net.kollnig.consent.library.InmobiLibrary;
import net.kollnig.consent.library.InMobiLibrary;
import net.kollnig.consent.library.Library;
import net.kollnig.consent.library.LibraryInteractionException;

Expand Down Expand Up @@ -45,7 +45,7 @@ public class ConsentManager {
new AdvertisingIdLibrary(),
new GoogleAdsLibrary(),
new AppsFlyerLibrary(),
new InmobiLibrary(),
new InMobiLibrary(),
new FlurryLibrary()
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import lab.galaxy.yahfa.HookMain;

public class InmobiLibrary extends Library {
public class InMobiLibrary extends Library {
public static final String LIBRARY_IDENTIFIER = "inmobi";
static final String TAG = "HOOKED";

Expand Down Expand Up @@ -54,8 +54,8 @@ public Library initialise(Context context) throws LibraryInteractionException {

try {
Method methodOrig = (Method) HookMain.findMethodNative(baseClass, methodName, methodSig);
Method methodHook = InmobiLibrary.class.getMethod("replacementInit", Context.class, String.class, JSONObject.class, Object.class);
Method methodBackup = InmobiLibrary.class.getMethod("originalInit", Context.class, String.class, JSONObject.class, Object.class);
Method methodHook = InMobiLibrary.class.getMethod("replacementInit", Context.class, String.class, JSONObject.class, Object.class);
Method methodBackup = InMobiLibrary.class.getMethod("originalInit", Context.class, String.class, JSONObject.class, Object.class);
HookMain.backupAndHook(methodOrig, methodHook, methodBackup);
} catch (NoSuchMethodException e) {
throw new RuntimeException("Could not overwrite method");
Expand Down

0 comments on commit f4a0964

Please sign in to comment.