here is my Android mainactivity class that should be injected but its not
You’re expecting magical things happen when you annotate something with @Inject
. While magical things will happen, it’s not that magical. You will need to do that yourself, by instantiating the component implementations that Dagger generated.
You can do this in a couple of ways, I will describe two.
First, in your MainActivity
‘s onCreate
:
private Vehicle vehicle; // Note, no @Inject annotation
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VehicleComponent vehicleComponent = DaggerVehicleComponent.create();
this.vehicle = vehicleComponent.provideVehicle();
Toast.makeText(this, String.valueOf(vehicle.getSpeed()), Toast.LENGTH_SHORT).show();
}
In this case, you create an instance of VehicleComponent
, implemented by Dagger, and fetch the Vehicle
instance from it. The vehicle
field is not annotated by @Inject
. This has the advantage that the field can be private
, which is a good thing to want.
Secondly, if you do want Dagger to inject your fields, you need to add an inject
method to your VehicleComponent
:
@Singleton
@Component(modules = {VehicleModule.class})
public interface VehicleComponent {
Vehicle provideVehicle();
void inject(MainActivity mainActivity);
}
In your MainActivity
class, you call inject(this)
, which will fill the vehicle
field:
@Inject
Vehicle vehicle; // Note, package-local
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
VehicleComponent vehicleComponent = DaggerVehicleComponent.create();
vehicleComponent.inject(this);
Toast.makeText(this, String.valueOf(vehicle.getSpeed()), Toast.LENGTH_SHORT).show();
}
This brings a bit of extra configuration, but is sometimes necessary.
I like the first method however.
As a final comment, let’s have a look at your VehicleModule
, and really use the power of Dagger.
Instead of using the module to create the instances yourself, you can make Dagger to that for you. You’ve already annotated the Vehicle
constructor with @Inject
, so Dagger will know to use this constructor. However, it needs an instance of Motor
, which it doesn’t know of. If you add an @Inject
annotation to the constructor of Motor
as well, and annotate the Motor
class with @Singleton
, you can get rid of the VehicleModule
altogether!
For example:
@Singleton
public class Motor {
private int rpm;
@Inject // Just an annotation to let Dagger know how to retrieve an instance of Motor.
public Motor(){
this.rpm = 10; //default will be 10
}
public int getRpm(){
return rpm;
}
public void accelerate(int value){
rpm = rpm + value;
}
public void brake(){
rpm = 0;
}
}
Your Vehicle
class:
@Singleton
public class Vehicle {
private Motor motor;
@Inject
public Vehicle(Motor motor){
this.motor = motor;
}
public void increaseSpeed(int value){
motor.accelerate(value);
}
public void stop(){
motor.brake();
}
public int getSpeed(){
return motor.getRpm();
}
}
You can now safely delete the VehicleModule
class, and remove the reference to it in your VehicleComponent
.
-
Clear=1
: Clears a previously injected error. This property must be combined with one of the other properties indicating the previously injected error to clear. -
Temperature
: Injects an artificial media temperature in degrees Celsius into the module. The firmware that is monitoring the temperature of the module will then be alerted and take necessary precautions to preserve the module. The value is injected immediately and will override the firmware from reading the actual media temperature of the device, directing it to use this value instead. This may cause adverse reactions by the firmware and result in an alert or log.Note: The injected temperature value will remain until the next reboot or it is cleared. The media temperature is an artificial temperature and will not cause harm to the part, although firmware actions due to improper temperature injections may cause adverse effects on the module. If the Critical Shutdown Temperature or higher is passed in, this may cause the module firmware to perform a shutdown in order to preserve the part and data. The temperature value will be ignored on clear.
-
Poison
: The physical address to poison.Note: The address must be 256 byte aligned (e.g., 0x10000000, 0x10000100, 0x10000200…).
Poison is not possible for any address in the PM region if the PM region is locked. Injected poison errors are only triggered on a subsequent read of the poisoned address, in which case an error log will be generated by the firmware. No alerts will be sent.
This command can be used to clear non-injected poison errors. The data will be zero’d after clearing. There is no requirement to enable error injection prior to request to clear poison errors.
The caller is responsible for keeping a list of injected poison errors in order to properly clear the injected errors afterwards. Simply disabling injection does not clear injected poison errors. Injected poison errors are persistent across power cycles and system resets.
-
PoisonType
: The type of memory to poison. One of:-
PatrolScrub
: Injects a poison error at the specified address simulating an error found during a patrol scrub operation, which is indifferent to how the memory is currently allocated. This is the default. -
MemoryMode
: Injects a poison error at the specified address currently allocated in Memory Mode. -
AppDirect
: Injects a poison error at the specified address currently allocated as App Direct.Note: If the address to poison is not currently allocated as the specified memory type, an error is returned.
-
-
PackageSparing=1
: Triggers an artificial package sparing. If package sparing is enabled and the module still has spares remaining, this will cause the firmware to report that there are no spares remaining. -
PercentageRemaining
: Injects an artificial module life remaining percentage into the persistent memory module. This will cause the firmware to take appropriate action based on the value and if necessary generate an error log and an alert and update the health status. -
FatalMediaError=1
: Injects a fake media fatal error which will cause the firmware to generate an error log and an alert.NOTE: When a fatal media error is injected, the BSR Media Disabled status bit will be set, indicating a media error. Use the disable trigger input parameter to clear the injected fatal error.
NOTE: Injecting a fatal media error is unsupported on Windows. Please contact Microsoft for assistance in performing this action.
-
DirtyShutdown=1
: Injects an ADR failure, which will result in a dirty shutdown upon reboot.
-
#3
еще бы вспомнить после какого мода все пошло не по тому месту, эх
-
#4
хоть у тебя и стандартная модель но попробуй поставить стандартную по новому
или попробуй пересобрать gta3.img
-
#5
хоть у тебя и стандартная модель но попробуй поставить стандартную по новому
или попробуй пересобрать gta3.img
ставил стандартную модель через модлоадер, все равно херня, скорее всего мод какой-то, буду методом перетаскивания из игры искать xD
Проблема решена, хоть и странно.
Проблема была в snailmatic.luac (https://www.blast.hk/threads/102157/)
Последнее редактирование: 12 Дек 2021
-
#6
еще бы вспомнить после какого мода все пошло не по тому месту, эх
ставил стандартную модель через модлоадер, все равно херня, скорее всего мод какой-то, буду методом перетаскивания из игры искать xD
Проблема решена, хоть и странно.
Проблема была в snailmatic.luac (https://www.blast.hk/threads/102157/)
интересно, как биндер связан с транспортом..xD
-
#7
интересно, как биндер связан с транспортом..xD
При этом в коде этого биндера нет ни одной строки с взаимодействием появления транспорта
|
Authenticator Code |
Thread Tools
|
Help Extreme Injector is screwing up |
|
#1 |
|||||||||||
Moontiz n00bie Join Date: Feb 2017 Location: de_unitedStates
Reputation: 60 Recognitions (1) Points: 2,913, Level: 5 Level up: 15%, 687 Points needed Activity: 10.9% Last Achievements |
everytime I try to injecto something it says this System.AccessViolationException: Unable to create thread in the specified proccess |
|||||||||||
Moontiz is offline |
|
|
#2 |
|||||||||||
harakirinox Eternal newbie Join Date: Nov 2016 Location: UK & France
Reputation: 81384 Recognitions
(1) (2) Points: 122,598, Level: 50 Level up: 33%, 3,502 Points needed Activity: 11.3% Last Achievements |
As the error says, it failed to create a thread in the game’s process, it is probably protected against this. I recommend that you spend some minutes reading the release post of Extreme injector with its features, it will help you better understand the tool you are using: |
|||||||||||
harakirinox is offline |
|
|
#3 |
|||||||||||
synthfx A Forum Hero Join Date: Aug 2014 Location: Germany
Reputation: 16912 Recognitions Points: 36,147, Level: 28 Level up: 94%, 153 Points needed Activity: 7.5% Last Achievements |
Quote:
Originally Posted by harakirinox As the error says, it failed to create a thread in the game’s process, it is probably protected against this. I recommend that you spend some minutes reading the release post of Extreme injector with its features, it will help you better understand the tool you are using: The loader code still gets injected via remote thread creation. |
|||||||||||
synthfx is online now |
|
|
#4 |
|||||||||||
harakirinox Eternal newbie Join Date: Nov 2016 Location: UK & France
Reputation: 81384 Recognitions
(1) (2) Points: 122,598, Level: 50 Level up: 33%, 3,502 Points needed Activity: 11.3% Last Achievements |
A solution for this would be to steal a handle with PROCESS_ALL_ACCESS (which includes PROCESS_CREATE_THREAD that is required for the API call CreateRemoteThread) from another process. I published the results of my research and my code here: __________________ Absolute beginners: Get started in game hacking here |
|||||||||||
harakirinox is offline |
|
Similar Threads |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Help] Extreme Injector error HELP ME!!! | skybliz | Counterstrike Global Offensive | 1 | 31st May 2016 09:51 AM |
Aimbot screwing up when close to the player | maxkunes | Counterstrike Global Offensive | 29 | 24th September 2015 09:27 PM |
[Coding] Screwing with Punkbuster (fake guid + name) | dudeinberlin | Battlefield 3 | 44 | 5th August 2013 11:38 AM |
[Help] Zea’s aimbot [extreme injector] | jonathan1764 | Battlefield Play4Free | 3 | 6th May 2013 07:07 AM |
[Help] Extreme Injector Error | maximalneraffee | Battlefield Play4Free | 5 | 11th January 2013 03:09 PM |
Tags |
occurred, thread, create, unable, csgo.exe, interx.dll, injecting, error, extreme, injecto |
«
Previous Thread
|
Next Thread
»
Forum Jump |
All times are GMT. The time now is 08:09 PM.
Contact Us —
Toggle Dark Theme
Terms of Use Information Privacy Policy Information
Copyright ©2000-2023, Unknowncheats� UKCS #312436
no new posts